Name | py-vomit JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | Somewhat unintelligible |
upload_time | 2024-12-14 18:10:47 |
maintainer | bhmt, torvalds |
docs_url | None |
author | bhmt, torvalds |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2023 bhmt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
obfuscation
unicode
utf-8
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# vomit
[](https://github.com/bhmt/vomit/actions/workflows/tests.yml)
Make your python code somewhat unintelligible but still readable and still **functional**.
Change the utf8 encoding of class names, function names, function args, and name nodes with a fitting unicode representation.
Or switch those back from unicode to utf8.
The ast is used and does not keep formating.
The changes are inplace if using a file or a directory for input.
## Installation
The package is available on pypi and can be installed using pip.
Activate a virtual environment and run
```
pip install py-vomit
```
## Usage
As a module run vomit with a required option to either encode or decode.
For input use a a stdin + stdout, a file, or a directory.
Add more extensions if `.py` is not enough.
Ignore node names, files, or directories if it keeps the code functional.
```shell
usage: python -m vomit [-h] (-e | -d) [-f FILE] [-s SOURCE] [-i [IGNORE ...]] [-r [IGNORE_REGEX ...]] [-n [IGNORE_NAMES ...]] [-t [EXT ...]] [-v]
options:
-h, --help show this help message and exit
-e, --encode indicate the file should be encoded
-d, --decode indicate the file should be decoded
-f FILE, --file FILE the file to encode or decode, defaults to stdin
-s SOURCE, --source SOURCE
the directory to encode or decode files recursively
-i [IGNORE ...], --ignore [IGNORE ...]
list of files and directories to skip when using source as input
-r [IGNORE_REGEX ...], --ignore-regex [IGNORE_REGEX ...]
list of files and directories as regex patterns to skip when using source as input
-n [IGNORE_NAMES ...], --ignore-names [IGNORE_NAMES ...]
list of node names to skip
-t [EXT ...], --ext [EXT ...]
list of extensions to include along ".py" when using source as input
-v, --verbose verbose output used for file or source as input
```
or use vomit as a library
```py
from vomit import to_unicode
from vomit import to_utf8
from vomit import UNICODE_MAP
print(to_utf8('🯳'))
# '3'
print(to_unicode('1'))
# '𝟙'
print(UNICODE_MAP['2'])
# 22𝟐𝟚𝟤𝟮𝟸🯲
```
Raw data
{
"_id": null,
"home_page": null,
"name": "py-vomit",
"maintainer": "bhmt, torvalds",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "obfuscation, unicode, utf-8",
"author": "bhmt, torvalds",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/75/d9/47c439150d22fa6e4cab402a01cc939eb9f21bb2a24229750215e612a528/py_vomit-1.0.0.tar.gz",
"platform": null,
"description": "# vomit\n\n[](https://github.com/bhmt/vomit/actions/workflows/tests.yml)\n\nMake your python code somewhat unintelligible but still readable and still **functional**.\n\nChange the utf8 encoding of class names, function names, function args, and name nodes with a fitting unicode representation.\nOr switch those back from unicode to utf8.\n\nThe ast is used and does not keep formating.\n\nThe changes are inplace if using a file or a directory for input.\n\n## Installation\n\nThe package is available on pypi and can be installed using pip.\nActivate a virtual environment and run\n\n```\n\npip install py-vomit\n\n```\n\n## Usage\n\nAs a module run vomit with a required option to either encode or decode.\nFor input use a a stdin + stdout, a file, or a directory.\nAdd more extensions if `.py` is not enough.\nIgnore node names, files, or directories if it keeps the code functional.\n\n\n```shell\n\nusage: python -m vomit [-h] (-e | -d) [-f FILE] [-s SOURCE] [-i [IGNORE ...]] [-r [IGNORE_REGEX ...]] [-n [IGNORE_NAMES ...]] [-t [EXT ...]] [-v]\n\noptions:\n -h, --help show this help message and exit\n -e, --encode indicate the file should be encoded\n -d, --decode indicate the file should be decoded\n -f FILE, --file FILE the file to encode or decode, defaults to stdin\n -s SOURCE, --source SOURCE\n the directory to encode or decode files recursively\n -i [IGNORE ...], --ignore [IGNORE ...]\n list of files and directories to skip when using source as input\n -r [IGNORE_REGEX ...], --ignore-regex [IGNORE_REGEX ...]\n list of files and directories as regex patterns to skip when using source as input\n -n [IGNORE_NAMES ...], --ignore-names [IGNORE_NAMES ...]\n list of node names to skip\n -t [EXT ...], --ext [EXT ...]\n list of extensions to include along \".py\" when using source as input\n -v, --verbose verbose output used for file or source as input\n\n```\n\n\nor use vomit as a library\n\n```py\n\nfrom vomit import to_unicode\nfrom vomit import to_utf8\nfrom vomit import UNICODE_MAP\n\nprint(to_utf8('\ud83e\udff3'))\n# '3'\nprint(to_unicode('1'))\n# '\ud835\udfd9'\nprint(UNICODE_MAP['2'])\n# 2\uff12\ud835\udfd0\ud835\udfda\ud835\udfe4\ud835\udfee\ud835\udff8\ud83e\udff2\n\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 bhmt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Somewhat unintelligible",
"version": "1.0.0",
"project_urls": {
"Repository": "https://github.com/bhmt/vomit"
},
"split_keywords": [
"obfuscation",
" unicode",
" utf-8"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31e4cfaeb20748f2f28ebe786b466581c9ed4a3a5bb67f622b235adc9852d3de",
"md5": "4c26c5174aa9e2adc1249fdd98ae80de",
"sha256": "95d070e8b50ded59c82c7ecaadde64fcda162bcbb074711f79b89d94e998d336"
},
"downloads": -1,
"filename": "py_vomit-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c26c5174aa9e2adc1249fdd98ae80de",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 8428,
"upload_time": "2024-12-14T18:10:44",
"upload_time_iso_8601": "2024-12-14T18:10:44.662798Z",
"url": "https://files.pythonhosted.org/packages/31/e4/cfaeb20748f2f28ebe786b466581c9ed4a3a5bb67f622b235adc9852d3de/py_vomit-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "75d947c439150d22fa6e4cab402a01cc939eb9f21bb2a24229750215e612a528",
"md5": "d1b73c03577bfd9b6fa33b075a62e5fe",
"sha256": "7f898eef654d116a8bb6e97b24bcf161f4c7109fc91b78774e3aa996b0a5c08c"
},
"downloads": -1,
"filename": "py_vomit-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "d1b73c03577bfd9b6fa33b075a62e5fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 10067,
"upload_time": "2024-12-14T18:10:47",
"upload_time_iso_8601": "2024-12-14T18:10:47.276919Z",
"url": "https://files.pythonhosted.org/packages/75/d9/47c439150d22fa6e4cab402a01cc939eb9f21bb2a24229750215e612a528/py_vomit-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-14 18:10:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bhmt",
"github_project": "vomit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "py-vomit"
}