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. Add more extensions if .py is not enough. Ignore node names, files, or directories if it keeps the code functional.

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

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𝟐𝟚𝟤𝟮𝟸🯲

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-1.0.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_vomit-1.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file py_vomit-1.0.0.tar.gz.

File metadata

  • Download URL: py_vomit-1.0.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for py_vomit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7f898eef654d116a8bb6e97b24bcf161f4c7109fc91b78774e3aa996b0a5c08c
MD5 d1b73c03577bfd9b6fa33b075a62e5fe
BLAKE2b-256 75d947c439150d22fa6e4cab402a01cc939eb9f21bb2a24229750215e612a528

See more details on using hashes here.

File details

Details for the file py_vomit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: py_vomit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for py_vomit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95d070e8b50ded59c82c7ecaadde64fcda162bcbb074711f79b89d94e998d336
MD5 4c26c5174aa9e2adc1249fdd98ae80de
BLAKE2b-256 31e4cfaeb20748f2f28ebe786b466581c9ed4a3a5bb67f622b235adc9852d3de

See more details on using hashes here.

Supported by

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