https://github.com/nitzano/datazar
CLI Database & File Anonymizer
https://github.com/nitzano/datazar
anonymizer cli data fake
Last synced: 4 months ago
JSON representation
CLI Database & File Anonymizer
- Host: GitHub
- URL: https://github.com/nitzano/datazar
- Owner: nitzano
- License: agpl-3.0
- Created: 2024-09-29T11:55:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-22T15:29:13.000Z (over 1 year ago)
- Last Synced: 2025-01-24T04:37:24.923Z (about 1 year ago)
- Topics: anonymizer, cli, data, fake
- Language: TypeScript
- Homepage:
- Size: 469 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DataZar 📊👋
CLI Database & File Anonymizer
[](https://www.npmjs.com/package/datazar-cli)
[](https://github.com/xojs/xo)
[](https://github.com/nitzano/datazar/stargazers)


A command-line tool to anonymize and transform sensitive data in databases, files, and datasets without writing a single line of code. Supports various databases types and file formats.
- [Usage](#usage)
- [Examples](#examples)
- [PostgresSQL](#postgressql)
- [MongoDB](#mongodb)
- [SQLite](#sqlite)
- [CSV](#csv)
- [Anonymizers](#anonymizers)
- [Support](#support)
- [Databases](#databases)
- [Files](#files)
- [CLI](#cli)
- [anon-col](#anon-col)
- [License](#license)
# Usage
```
# npm
npx datazar-cli [options]
# pnpm
pnpm dlx datazar-cli [options]
# yarn
yarn dlx datazar-cli [options]
```
# Examples
## PostgresSQL
Mask `firstName` column in `users` table in `test` db:
```
npx datazar-cli anon-col postgres \
--uri postgresql:/localhost \
--database test \
--table users \
--column firstName \
mask
// { "firstName": "John" } => { "firstName": "****" }
```
## MongoDB
Scramble `lastName` column in `users` table in `test` db:
```
npx datazar-cli anon-col mongo
--uri mongodb://localhost \
--database test \
--table users \
--column lastName \
scramble
// { "lastName": "Smith" } => { "lastName": "hSmti" }
```
## SQLite
Mask `firstName` column in `users` table in `dev.db`:
```
npx datazar-cli anon-col sqlite \
--uri /home/dev.db \
--table users \
--column firstName \
mask
```
## CSV
Fake `email` column in `file.csv` with a fake one:
```
npx datazar-cli anon-col csv \
--file /home/file.csv \
--column email \
fake email
```
# Anonymizers
1. 🎭 **Mask** - Masks some or all of the letters of the previous value.
2. 🔀 **Scramble** - Scrambles the order of characters inside a string randomly.
1. 🍀 **Fake** - Generate fake data instead of the previous value
Coming Soon:
1. 🧽 **Remove** - removes the entire data
2. 🖋️ **Constant** – Substitutes sensitive words or phrases with placeholders or predefined values.
3. 🔐 **Hash** – Replaces the value with a cryptographic hash, making it irrecoverable.
4. 👓 **Blur** – Adds random variation to numerical values while keeping them within a reasonable range.
# Support
## Databases
1. MongoDB
2. PostgresSQL
3. MariaDB
4. MySQL
5. MSSQL
6. SQLite
7. Neo4J (Coming Soon)
8. DynamoDB (Coming Soon)
9. Redis (Coming Soon)
10. CouchDB (Coming Soon)
## Files
1. CSV
2. JSON (Coming Soon)
3. XML (Coming Soon)
4. XSLX (Coming Soon)
5. Parquet (Coming Soon)
6. YAML (Coming Soon)
# CLI
## anon-col
Anonymize a single column in a table
```
Usage: anon-col [engine_options] [anonymizer_options]
```
# License
DataZar
Copyright (C) 2024 Nitzan Ohana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .