# PiArgus
This package provides a python wrapper around [τ-ARGUS](https://research.cbs.nl/casc/tau.htm), a program to protect statistical tables.
This package takes care of generating all the required metadata and runs τ-ARGUS in the background to do the heavy work.
For this package to work, it is required to install τ-ARGUS locally first.
It's also recommended to read the [TauArgus manual](https://research.cbs.nl/casc/Software/TauManualV4.1.pdf) to understand how it should be used.
## Features
- Generate output tables from microdata or tabledata. It is recommended to generate from microdata.
- Metadata can be generated automatically, although using an existing rda-file is also possible.
- It's possible to create hierarchies, codelists, apriori files, recode files all from code or from existing files.
- Basic error checking of input is done before input is supplied to argus.
Feel free to [contribute](https://github.com/lverweijen/piargus) for other TauArgus-features.
[Feedback](https://github.com/lverweijen/piargus/issues) is welcome too.
## Installing
- Download and install the latest version of [τ-ARGUS](https://github.com/sdcTools/tauargus/releases).
- Then use [pip](https://pip.pypa.io/en/stable/getting-started/) to install piargus:
```sh
$ pip install --upgrade piargus
```
## Example
```python
import pandas as pd
import piargus as pa
tau = pa.TauArgus(r'C:\Users\User\Programs\TauArgus4.2.0b5\TauArgus.exe')
input_df = pd.read_csv('data/microdata.csv')
input_data = pa.MicroData(input_df)
output_table = pa.Table(['sbi', 'regio'], 'income', safety_rule="P(10)")
job = pa.Job(input_data, [output_table], directory='tau')
report = tau.run(job)
table_result = output_table.load_result()
print(report)
print(table_result)
```
Change `C:\Users\User\Programs\TauArgus4.2.0b5\TauArgus.exe` to the location where argus is installed.
See [Examples](https://github.com/lverweijen/tree/main/examples) for more examples.
## See also
The following packages in R offer similar functionality:
- https://github.com/sdcTools/sdcTable
- https://github.com/InseeFrLab/rtauargus
Raw data
{
"_id": null,
"home_page": "https://github.com/lverweijen/piargus",
"name": "piargus",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "statistical-disclosure-control tau-argus",
"author": "lverweijen",
"author_email": "lauwerund@gmail.com",
"download_url": "",
"platform": null,
"description": "# PiArgus\r\n\r\nThis package provides a python wrapper around [\u03c4-ARGUS](https://research.cbs.nl/casc/tau.htm), a program to protect statistical tables.\r\nThis package takes care of generating all the required metadata and runs \u03c4-ARGUS in the background to do the heavy work.\r\n\r\nFor this package to work, it is required to install \u03c4-ARGUS locally first.\r\nIt's also recommended to read the [TauArgus manual](https://research.cbs.nl/casc/Software/TauManualV4.1.pdf) to understand how it should be used.\r\n\r\n## Features\r\n\r\n- Generate output tables from microdata or tabledata. It is recommended to generate from microdata.\r\n- Metadata can be generated automatically, although using an existing rda-file is also possible.\r\n- It's possible to create hierarchies, codelists, apriori files, recode files all from code or from existing files.\r\n- Basic error checking of input is done before input is supplied to argus.\r\n\r\nFeel free to [contribute](https://github.com/lverweijen/piargus) for other TauArgus-features.\r\n[Feedback](https://github.com/lverweijen/piargus/issues) is welcome too.\r\n\r\n## Installing\r\n\r\n- Download and install the latest version of [\u03c4-ARGUS](https://github.com/sdcTools/tauargus/releases).\r\n- Then use [pip](https://pip.pypa.io/en/stable/getting-started/) to install piargus:\r\n\r\n```sh\r\n$ pip install --upgrade piargus\r\n```\r\n\r\n## Example\r\n\r\n```python\r\nimport pandas as pd\r\nimport piargus as pa\r\n\r\ntau = pa.TauArgus(r'C:\\Users\\User\\Programs\\TauArgus4.2.0b5\\TauArgus.exe')\r\ninput_df = pd.read_csv('data/microdata.csv')\r\ninput_data = pa.MicroData(input_df)\r\noutput_table = pa.Table(['sbi', 'regio'], 'income', safety_rule=\"P(10)\")\r\n\r\njob = pa.Job(input_data, [output_table], directory='tau')\r\nreport = tau.run(job)\r\ntable_result = output_table.load_result()\r\n\r\nprint(report)\r\nprint(table_result)\r\n```\r\n\r\nChange `C:\\Users\\User\\Programs\\TauArgus4.2.0b5\\TauArgus.exe` to the location where argus is installed.\r\nSee [Examples](https://github.com/lverweijen/tree/main/examples) for more examples.\r\n\r\n## See also\r\n\r\nThe following packages in R offer similar functionality:\r\n\r\n- https://github.com/sdcTools/sdcTable\r\n- https://github.com/InseeFrLab/rtauargus\r\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Python wrapper around TauArgus",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/lverweijen/piargus"
},
"split_keywords": [
"statistical-disclosure-control",
"tau-argus"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aaf2e7f20163ecfb7a9f2a4bf28f73a292d83e437759e1f57b6786bb46ad23c5",
"md5": "10b5a59fc9455f934eea4949e82cb523",
"sha256": "dce64d502bfdc6b11ffd2790830358f96a89e42c66c1fe175439853a648ee48d"
},
"downloads": -1,
"filename": "piargus-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "10b5a59fc9455f934eea4949e82cb523",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 54488,
"upload_time": "2023-11-08T22:10:32",
"upload_time_iso_8601": "2023-11-08T22:10:32.720832Z",
"url": "https://files.pythonhosted.org/packages/aa/f2/e7f20163ecfb7a9f2a4bf28f73a292d83e437759e1f57b6786bb46ad23c5/piargus-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-08 22:10:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lverweijen",
"github_project": "piargus",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "piargus"
}