py-vomit


Namepy-vomit JSON
Version 0.4.1 PyPI version JSON
download
home_page
SummarySomewhat unintelligible
upload_time2023-07-09 00:17:02
maintainerbhmt
docs_urlNone
authorbhmt
requires_python>=3.10
licenseMIT 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

[![Tests](https://github.com/bhmt/vomit/actions/workflows/tests.yml/badge.svg)](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": "",
    "name": "py-vomit",
    "maintainer": "bhmt",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "obfuscation,unicode,utf-8",
    "author": "bhmt",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/24/19/368835b902761cd1c540bce8d6ac912901d1667b2ee5347ea9e05e474576/py_vomit-0.4.1.tar.gz",
    "platform": null,
    "description": "# vomit\n\n[![Tests](https://github.com/bhmt/vomit/actions/workflows/tests.yml/badge.svg)](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```",
    "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": "0.4.1",
    "project_urls": {
        "Repository": "https://github.com/bhmt/vomit"
    },
    "split_keywords": [
        "obfuscation",
        "unicode",
        "utf-8"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95044f2f13d8d0dda0812f923e8cabcbc37dead24485f6d2f5043891eaccb9d7",
                "md5": "4388ae272bfd2e61c9bdb7582bce45a3",
                "sha256": "cb7eac4eb08974d2e062844ec5600621c1432628fee32a0c05331b9e41334f9c"
            },
            "downloads": -1,
            "filename": "py_vomit-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4388ae272bfd2e61c9bdb7582bce45a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 386777,
            "upload_time": "2023-07-09T00:17:00",
            "upload_time_iso_8601": "2023-07-09T00:17:00.888682Z",
            "url": "https://files.pythonhosted.org/packages/95/04/4f2f13d8d0dda0812f923e8cabcbc37dead24485f6d2f5043891eaccb9d7/py_vomit-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2419368835b902761cd1c540bce8d6ac912901d1667b2ee5347ea9e05e474576",
                "md5": "4aee1f73b0108ecc9e3776bdfd47ba94",
                "sha256": "afb078becc83d25c8b0afd5904037de5ae58befc01b75393858953484b98037b"
            },
            "downloads": -1,
            "filename": "py_vomit-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4aee1f73b0108ecc9e3776bdfd47ba94",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10016,
            "upload_time": "2023-07-09T00:17:02",
            "upload_time_iso_8601": "2023-07-09T00:17:02.720405Z",
            "url": "https://files.pythonhosted.org/packages/24/19/368835b902761cd1c540bce8d6ac912901d1667b2ee5347ea9e05e474576/py_vomit-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-09 00:17:02",
    "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"
}
        
Elapsed time: 0.09039s