MCPcopy Index your code
hub / github.com/LianjiaTech/d18n

github.com/LianjiaTech/d18n @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
427 symbols 1,335 edges 99 files 170 documented · 40% updated 3y agov0.1.2 · 2021-10-29★ 1784 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Introduction

Language

logo

d18n is a numeronym short for "data-desensitization", sounds like "d-eighteen-n".

As its name says, d18n can mask data to make it desensitized. In addition, d18n can do many other things.

  • d18n is a portable RDBMS cmd client. e.g., MySQL, PostgreSQL, Oracle, SQL Server ...
  • save query result into a file, e.g., xlsx, csv, txt, sql, html, json ...
  • detect sensitive info (like PII) from a file or a SQL query.
  • import data from files into different types of databases.
  • lint data file, to check if its format is compatible before import it into some database.

It can be used as a portable cmd client or imported as a package by other tools.

For more details and latest updates, see doc and release notes.

Build

d18n develop with Golang 1.16+, please install first.

git clone https://github.com/LianjiaTech/d18n
cd d18n

# Mac or Linux
make build

# Windows
go build -o d18n.exe cmd\d18n\d18n.go

Cross-platform compile

Golang support many

~ $ make release
...

~ $ ls release
d18n.darwin-amd64  d18n.darwin-arm64  d18n.linux-amd64  d18n.windows-amd64

Quick Start

Simple Example

~ $ d18n --defaults-extra-file test/my.cnf --query "show databases"
+--------------------+
|      DATABASE      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sakila             |
| sys                |
| test               |
| world_x            |
+--------------------+

License

d18n is under the Apache 2.0 license. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

MaskFunc (FuncType)
(no doc)
mask/typo.go

Core symbols most depended-on inside this repo

NewLintStruct
called by 36
lint/lint.go
PanicIfError
called by 15
common/common.go
QuoteKey
called by 15
common/db.go
QuoteString
called by 14
common/db.go
ReserveMargin
called by 13
mask/string.go
SmokeInner
called by 12
mask/string.go
Fake
called by 12
mask/faker.go
NewConnection
called by 12
common/db.go

Shape

Function 317
Method 78
Struct 20
TypeAlias 9
FuncType 3

Languages

Go100%

Modules by API surface

mask/string_test.go32 symbols
mask/string.go32 symbols
common/db.go22 symbols
mask/encrypt.go17 symbols
mask/pii_test.go14 symbols
mask/pii.go14 symbols
lint/lint.go14 symbols
common/file.go13 symbols
mask/encrypt_test.go12 symbols
mask/config.go12 symbols
lint/csv.go12 symbols
mask/shuffle_test.go11 symbols

For agents

$ claude mcp add d18n \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page