Metadata-Version: 2.1
Name: py-vomit
Version: 0.4.1
Summary: Somewhat unintelligible
Project-URL: Repository, https://github.com/bhmt/vomit
Author: bhmt
Maintainer: bhmt
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.
License-File: LICENSE
Keywords: obfuscation,unicode,utf-8
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Security
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Code Generators
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: check
Requires-Dist: mypy>=1.3.0; extra == 'check'
Requires-Dist: ruff>=0.0.277; extra == 'check'
Requires-Dist: tox>=4.6.0; extra == 'check'
Provides-Extra: test
Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
Requires-Dist: pytest>=7.3.1; extra == 'test'
Description-Content-Type: text/markdown

# 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'])
# 2２𝟐𝟚𝟤𝟮𝟸🯲

```