{"id":13466740,"url":"https://github.com/intenthq/anon","last_synced_at":"2025-03-26T00:31:26.002Z","repository":{"id":144202299,"uuid":"133798513","full_name":"intenthq/anon","owner":"intenthq","description":"A UNIX Command To Anonymise Data","archived":true,"fork":false,"pushed_at":"2019-04-01T13:17:39.000Z","size":44,"stargazers_count":353,"open_issues_count":9,"forks_count":14,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-10-29T20:32:52.014Z","etag":null,"topics":["anonymity","anonymization","cli","csv","data","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intenthq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-17T10:36:20.000Z","updated_at":"2024-09-23T11:00:02.000Z","dependencies_parsed_at":"2023-06-18T06:46:11.659Z","dependency_job_id":null,"html_url":"https://github.com/intenthq/anon","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intenthq%2Fanon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intenthq%2Fanon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intenthq%2Fanon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intenthq%2Fanon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intenthq","download_url":"https://codeload.github.com/intenthq/anon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245566098,"owners_count":20636390,"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":["anonymity","anonymization","cli","csv","data","go","golang"],"created_at":"2024-07-31T15:00:49.507Z","updated_at":"2025-03-26T00:31:25.684Z","avatar_url":"https://github.com/intenthq.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"icon.svg\" width=\"300\" /\u003e\n\u003c/p\u003e\n\n# Anon — A UNIX Command To Anonymise Data\n[![Build Status](https://travis-ci.org/intenthq/anon.svg?branch=master)](https://travis-ci.org/intenthq/anon) \u003ca href=\"https://codecov.io/gh/intenthq/anon\"\u003e\n  \u003cimg src=\"https://codecov.io/gh/intenthq/anon/branch/master/graph/badge.svg\" /\u003e\n\u003c/a\u003e [![Go Report Card](https://goreportcard.com/badge/github.com/intenthq/anon)](https://goreportcard.com/report/github.com/intenthq/anon) [![License](https://img.shields.io/npm/l/express.svg)](https://github.com/intenthq/anon/LICENSE)\n![GitHub release](https://img.shields.io/github/release/intenthq/anon.svg)\n\nAnon is a tool for taking delimited files and anonymising or transforming columns until the output is useful for applications where sensitive information cannot be exposed.\n\n## Installation\n\nReleases of Anon are available as pre-compiled static binaries [on the corresponding GitHub release](https://github.com/intenthq/anon/releases). Simply download the appropriate build for your machine and make sure it's in your `PATH` (or use it directly).\n\n## Usage\n\n```sh\nanon [--config \u003cpath to config file, default is ./config.json\u003e]\n     [--output \u003cpath to output to, default is STDOUT\u003e]\n```\n\nAnon is designed to take input from `STDIN` and by default will output the anonymised file to `STDOUT`:\n\n```sh\nanon \u003c some_file.csv \u003e some_file_anonymised.csv\n```\n\n### Configuration\n\nIn order to be useful, Anon needs to be told what you want to do to each column of the CSV. The config is defined as a JSON file (defaults to a file called `config.json` in the current directory):\n\n```json5\n{\n  \"csv\": {\n    \"delimiter\": \",\"\n  },\n  // Optionally define a number of rows to randomly sample down to.\n  // To do it, it will hash (using FNV-1 32 bits) the column with the ID\n  // in it and will mod the result by the value specified to decide if the\n  // row is included or not -\u003e include = hash(idColumn) % mod == 0\n  \"sampling\": {\n    // Number used to mod the hash of the id and determine if the row\n    // has to be included in the sample or not\n    \"mod\": 30000\n    // Specify in which a column a unique ID exists on which the sampling can\n    // be performed. Indices are 0 based, so this would sample on the first\n    // column.\n    \"idColumn\": 0\n  },\n  // An array of actions to take on each column - indices are 0 based, so index\n  // 0 in this array corresponds to column 1, and so on.\n  //\n  // There must be an action for every column in the CSV.\n  \"actions\": [\n    {\n      // The no-op, leaves the input unchanged.\n      \"name\": \"nothing\"\n    },\n    {\n      // Takes a UK format postcode (eg. W1W 8BE) and just keeps the outcode\n      // (eg. W1W).\n      \"name\": \"outcode\"\n    },\n    {\n      // Hash (SHA1) the input.\n      \"name\": \"hash\",\n      // Optional salt that will be appened to the input.\n      // If not defined, a random salt will be generated\n      \"salt\": \"salt\"\n    },\n    {\n      // Given a date, just keep the year.\n      \"name\": \"year\",\n      \"dateConfig\": {\n        // Define the format of the input date here.\n        \"format\": \"YYYYmmmdd\"\n      }\n    },\n    {\n      // Summarise a range of values.\n      \"name\": \"range\",\n      \"rangeConfig\": {\n        \"ranges\": [\n          // For example, this will take values between 0 and 100, and convert\n          // them to the string \"0-100\".\n          // You can use one of (gt, gte) and (lt, lte) but not both at the\n          // same time.\n          // You also need to define at least one of (gt, gte, lt, lte).\n          {\n            \"gte\": 0,\n            \"lt\": 100,\n            \"output\": \"0-100\"\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n## Contributing\n\nAny contribution will be welcome, please refer to our [contributing guidelines](CONTRIBUTING.md) for more information.\n\n## License\n\nThis project is [licensed under the MIT license](LICENSE).\n\nThe icon is by [Pixel Perfect](https://www.flaticon.com/authors/pixel-perfect) from [Flaticon](https://www.flaticon.com/), and is licensed under a [Creative Commons 3.0 BY](http://creativecommons.org/licenses/by/3.0/) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintenthq%2Fanon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintenthq%2Fanon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintenthq%2Fanon/lists"}