{"id":27044103,"url":"https://github.com/math280h/redactdump","last_synced_at":"2025-04-05T05:19:03.259Z","repository":{"id":45273233,"uuid":"435894584","full_name":"math280h/redactdump","owner":"math280h","description":"Database dumps with support for redacting/replacing data","archived":false,"fork":false,"pushed_at":"2024-05-21T19:43:52.000Z","size":767,"stargazers_count":4,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T17:50:30.774Z","etag":null,"topics":["database-dump","database-tool","dump","mysql","postgres","postgresql","redaction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/math280h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-07T13:38:39.000Z","updated_at":"2024-04-08T15:56:45.000Z","dependencies_parsed_at":"2023-01-30T00:15:44.891Z","dependency_job_id":null,"html_url":"https://github.com/math280h/redactdump","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math280h%2Fredactdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math280h%2Fredactdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math280h%2Fredactdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/math280h%2Fredactdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/math280h","download_url":"https://codeload.github.com/math280h/redactdump/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289482,"owners_count":20914473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-dump","database-tool","dump","mysql","postgres","postgresql","redaction"],"created_at":"2025-04-05T05:19:02.714Z","updated_at":"2025-04-05T05:19:03.243Z","avatar_url":"https://github.com/math280h.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"logo.png\" alt=\"Logo\" width=\"400\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"type-lint badge\" src=\"https://github.com/math280h/redactdump/actions/workflows/type-lint.yaml/badge.svg\"/\u003e\n  \u003cimg alt=\"test badge\" src=\"https://github.com/math280h/redactdump/actions/workflows/test.yaml/badge.svg\"/\u003e\n  \u003ca href=\"https://deepsource.io/gh/math280h/redactdump/?ref=repository-badge}\" target=\"_blank\"\u003e\u003cimg alt=\"DeepSource\" title=\"DeepSource\" src=\"https://deepsource.io/gh/math280h/redactdump.svg/?label=active+issues\u0026show_trend=true\u0026token=zl4gwpMEiRHT9iPmjcCF0pWj\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://deepsource.io/gh/math280h/redactdump/?ref=repository-badge}\" target=\"_blank\"\u003e\u003cimg alt=\"DeepSource\" title=\"DeepSource\" src=\"https://deepsource.io/gh/math280h/redactdump.svg/?label=resolved+issues\u0026show_trend=true\u0026token=zl4gwpMEiRHT9iPmjcCF0pWj\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nEasily create database dumps with support for redacting data (And replacing that data with valid random values).\n\n**Supported databases**\n* MySQL\n* PostgreSQL\n\n_More coming soon..._\n\n## Installation\n\nTo install redactdump, run the following command:\n````shell\npip install redactdump\n````\n\n## Usage\n\n```shell\nusage: redactdump [-h] -c CONFIG\n\nredactdump\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c CONFIG, --config CONFIG\n                        Path to dump configuration.\n  -u USER, --user USER  Connection username.\n  -p PASSWORD, --password PASSWORD\n                        Connection password.\n  -d DEBUG, --debug DEBUG\n                        Enable debug mode.\n```\n\n## Configuration\n\nTo create a dump you currently must use a configuration file, however in the future you might be able to do it all via CLI.\n\n### Supported replacement values.\n\nredactdump uses faker to generate random data.\n\n`replacement` can therefore be any function from the following providers:\nhttps://faker.readthedocs.io/en/stable/providers.html\n\n**NOTE: redactdump is currently NOT tested with all providers, some might trigger bugs**\n\n### Example configuration:\n````yaml\nconnection:\n  type: pgsql\n  host: 127.0.0.1\n  port: 5432\n  database: postgres\n\nredact:\n  patterns:\n    column:\n      - pattern: '^[a-zA-Z]+_name'\n        replacement: name\n    data:\n      - pattern: '192.168.0.1'\n        replacement: ipv4\n      - pattern: 'John Doe'\n        replacement: name\n\noutput:\n  type: multi_file\n  naming: 'dump-[table_name]-[timestamp]' # Default: [table_name]-[timestamp]\n  location: './output/'\n````\n\n### Configuration Schema\n\nThe configuration schema can be found [here](redactdump/core/config.py)\n\n## Example\n\n\u003cdetails\u003e\n\u003csummary\u003eConfiguration\u003c/summary\u003e\n\n```yaml\nconnection:\n  type: pgsql\n  host: 127.0.0.1\n  port: 5432\n  database: postgres\n\nredact:\n  patterns:\n    column:\n      - pattern: '^new_'\n        replacement: name\n    data:\n      - pattern: '6'\n        replacement: random_int\n\noutput:\n  type: multi_file\n  naming: 'dump-[table_name]-[timestamp]' # Default: [table_name]-[timestamp]\n  location: './output/'\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eOriginal data\u003c/summary\u003e\n\n_(column_1, new_column)_\n\n```text\n6,\"\"\"John Doe\"\"\"\n6,\"John Doe\"\n6,\"John Doe\"\n6,John Doe\n1,\\John Doe\n1,--John Doe\n12312, John Doe\n99,!John Doe\n99,(John Doe)\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eOutput\u003c/summary\u003e\n\n```sql\nINSERT INTO table_name VALUES (890, 'Yolanda Mcdonald');\nINSERT INTO table_name VALUES (1982, 'Stephen Lewis');\nINSERT INTO table_name VALUES (2952, 'Janet Woodward');\nINSERT INTO table_name VALUES (9307, 'Joshua Price');\nINSERT INTO table_name VALUES (1, 'Tina Morrison');\nINSERT INTO table_name VALUES (1, 'Juan Mejia');\nINSERT INTO table_name VALUES (12312, 'Michael Thornton');\nINSERT INTO table_name VALUES (99, 'Adrian White');\nINSERT INTO table_name VALUES (99, 'Robin Jefferson');\n```\n\n\u003c/details\u003e\n\n## Known limitations\n\n### Data types not supported\n\n* box\n* bytea\n* inet\n* interval\n* circle\n* cidr\n* line\n* lseg\n* macaddr\n* macaddr8\n* pg_lsn\n* pg_snapshot\n* point\n* polygon\n* tsquery\n* tsvector\n* txid_snapshot\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmath280h%2Fredactdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmath280h%2Fredactdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmath280h%2Fredactdump/lists"}