Skip to main content

"Somewhat unintelligible"

Project description

vomit

Tests

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.

usage: python -m vomit [-h] (-e | -d) [-f FILE | -s SOURCE] [-i IGNORE] [-t EXT]

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 .py files recursively
  -i IGNORE, --ignore IGNORE
                        comma separated values of files and directories to skip when using --source
  -t EXT, --ext EXT     comma separated values of extensions to include along ".py" when using --source

or use vomit as a library

from vomit import to_unicode
from vomit import to_utf8
from vomit import UNICODE_MAP

print(to_utf8('a'))
# 'a'
print(to_unicode('a'))
# '𝔞'
print(UNICODE_MAP['0'])
# 00𝟎𝟘𝟢𝟬𝟶🯰

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-vomit-0.3.0.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

py_vomit-0.3.0-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page