Name | the-mask JSON |
Version |
0.0.1
JSON |
| download |
home_page | |
Summary | A package to hide/mask PII information in the JSON object |
upload_time | 2023-05-14 18:17:14 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | MIT |
keywords |
masking
pii
data-security
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h2 align="center">
A package to hide/mask PII information in the JSON object.
</h2>
<p align="center">
<a href="https://coveralls.io/github/parvathirajan/the-mask?branch=main"><img alt="Coverage Status" src="https://coveralls.io/repos/github/parvathirajan/the-mask/badge.svg?branch=main"></a>
<a href="https://github.com/parvathirajan/the-mask/blob/main/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a>
<a href="https://pypi.org/project/the-mask/"><img alt="PyPI" src="https://img.shields.io/pypi/v/the-mask"></a>
<a href="https://github.com/parvathirajan/the-mask"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>
## Installation and usage
### Installation
The-mask requires Python 3.6+ and can be easily installed using the most common Python packaging tools.
We recommend installing the latest stable release from PyPI with pip:
```bash
$ pip install the-mask
```
### Usage and documentation
the-mask is used to mask the PII or sensitive data in the JSON object
with more flexible way.
```python
from mask import mask
payload = {
"name": "Jennifer",
"email" "Jenn@abc.corp",
"salary": "250000"
}
data_to_mask = {
"name": "str", # It can also be `string`
"email": "email",
"salary": "znumber"
}
result = mask(payload, data_to_mask) # Option: 1
print(result)
# Result:
# {
# "name": "J******r",
# "email" "J**n@a**.corp",
# "salary": "0"
# }
# Alternative Way: If the user wanted to modify the Payload itself
# Pass the inplace option as True
mask(payload, data_to_mask, inplace = True) # Option: 2
print(payload)
# Result:
# {
# "name": "J******r",
# "email" "J**n@a**.corp",
# "salary": "0"
# }
```
##### How the Data to Mask param works?
| Type of Data | Example Dict Key | Value | Description |
|---------------------------------------------|------------------|---------|-----------------------------------------------------------------------------------------------------------------|
| Plain Text values i.e., Name, Address etc., | name | `str` | `string` or `str` can be passed to determine the value is a string |
| Email ID | emailAddress | `email` | `email` is to mask the email id i.e., `K***n@a**.corp` |
| Numerical Values | salary | `znumber` | `znumber` is used to convert the numerical value into 0 i.e., 250000 -> 0, 10000.90 -> 0.0, "1,135,000" -> "0" |
| Identity based Numerical Values | id | `number` | `number` converts the value into random number with equivalent length. |
## License
MIT
## Code of Conduct
Everyone participating in _the-mask_ project, and in particular in the issue tracker,
and pull requests is expected to treat other people with respect.
---
Give a ⭐️ if this project helped you!
Raw data
{
"_id": null,
"home_page": "",
"name": "the-mask",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "masking,PII,data-security",
"author": "",
"author_email": "Parvathirajan Natarajan <parvathi_rajan@hotmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e1/b7/f47f6ba2ebc66d82c6d7e59ea3efc3bbba7a1fc08d9f88151a1d251355a6/the-mask-0.0.1.tar.gz",
"platform": null,
"description": "<h2 align=\"center\">\n A package to hide/mask PII information in the JSON object.\n</h2>\n\n<p align=\"center\">\n<a href=\"https://coveralls.io/github/parvathirajan/the-mask?branch=main\"><img alt=\"Coverage Status\" src=\"https://coveralls.io/repos/github/parvathirajan/the-mask/badge.svg?branch=main\"></a>\n<a href=\"https://github.com/parvathirajan/the-mask/blob/main/LICENSE\"><img alt=\"License: MIT\" src=\"https://black.readthedocs.io/en/stable/_static/license.svg\"></a>\n<a href=\"https://pypi.org/project/the-mask/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/the-mask\"></a>\n<a href=\"https://github.com/parvathirajan/the-mask\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\n</p>\n\n## Installation and usage\n\n### Installation\n\nThe-mask requires Python 3.6+ and can be easily installed using the most common Python packaging tools. \n\nWe recommend installing the latest stable release from PyPI with pip:\n\n```bash\n$ pip install the-mask\n```\n\n### Usage and documentation\n\nthe-mask is used to mask the PII or sensitive data in the JSON object\nwith more flexible way.\n\n```python\nfrom mask import mask\npayload = {\n \"name\": \"Jennifer\",\n \"email\" \"Jenn@abc.corp\",\n \"salary\": \"250000\"\n}\ndata_to_mask = {\n \"name\": \"str\", # It can also be `string`\n \"email\": \"email\",\n \"salary\": \"znumber\"\n}\nresult = mask(payload, data_to_mask) # Option: 1\nprint(result)\n\n# Result:\n# {\n# \"name\": \"J******r\",\n# \"email\" \"J**n@a**.corp\",\n# \"salary\": \"0\"\n# }\n\n\n# Alternative Way: If the user wanted to modify the Payload itself\n# Pass the inplace option as True\nmask(payload, data_to_mask, inplace = True) # Option: 2\nprint(payload)\n\n# Result:\n# {\n# \"name\": \"J******r\",\n# \"email\" \"J**n@a**.corp\",\n# \"salary\": \"0\"\n# }\n```\n\n##### How the Data to Mask param works?\n\n| Type of Data | Example Dict Key | Value | Description |\n|---------------------------------------------|------------------|---------|-----------------------------------------------------------------------------------------------------------------|\n| Plain Text values i.e., Name, Address etc., | name | `str` | `string` or `str` can be passed to determine the value is a string |\n| Email ID | emailAddress | `email` | `email` is to mask the email id i.e., `K***n@a**.corp` |\n| Numerical Values | salary | `znumber` | `znumber` is used to convert the numerical value into 0 i.e., 250000 -> 0, 10000.90 -> 0.0, \"1,135,000\" -> \"0\" |\n| Identity based Numerical Values | id | `number` | `number` converts the value into random number with equivalent length. |\n\n\n## License\n\nMIT\n\n## Code of Conduct\n\nEveryone participating in _the-mask_ project, and in particular in the issue tracker,\nand pull requests is expected to treat other people with respect.\n\n---\n\nGive a \u2b50\ufe0f if this project helped you!\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package to hide/mask PII information in the JSON object",
"version": "0.0.1",
"project_urls": {
"Bug Tracker": "https://github.com/parvathirajan/the-mask/issues",
"Homepage": "https://github.com/parvathirajan/the-mask",
"Source Code": "https://github.com/parvathirajan/the-mask"
},
"split_keywords": [
"masking",
"pii",
"data-security"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6c3df56e099c2b03f83e860f01da0bc7afe0210d780b026ae85a4338ec7ebe25",
"md5": "9b8624d5a55e87170b2a64ddf2576b4c",
"sha256": "dcfd2622d8d97c28dd0e2e2fd5d8012ae4946e191feacadcd133039aefef1fff"
},
"downloads": -1,
"filename": "the_mask-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9b8624d5a55e87170b2a64ddf2576b4c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7107,
"upload_time": "2023-05-14T18:17:13",
"upload_time_iso_8601": "2023-05-14T18:17:13.237672Z",
"url": "https://files.pythonhosted.org/packages/6c/3d/f56e099c2b03f83e860f01da0bc7afe0210d780b026ae85a4338ec7ebe25/the_mask-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e1b7f47f6ba2ebc66d82c6d7e59ea3efc3bbba7a1fc08d9f88151a1d251355a6",
"md5": "ff3730c669b3d1b154cc5e8c99ae2e6b",
"sha256": "3fbb3e00841620086d891e98c21adb403527523111e96b2f4cd9bfd322470457"
},
"downloads": -1,
"filename": "the-mask-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "ff3730c669b3d1b154cc5e8c99ae2e6b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 8488,
"upload_time": "2023-05-14T18:17:14",
"upload_time_iso_8601": "2023-05-14T18:17:14.480463Z",
"url": "https://files.pythonhosted.org/packages/e1/b7/f47f6ba2ebc66d82c6d7e59ea3efc3bbba7a1fc08d9f88151a1d251355a6/the-mask-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-14 18:17:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "parvathirajan",
"github_project": "the-mask",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "the-mask"
}