Skip to main content

Strip comments from scripts, intended for use with MicroPython and other storage constrained environments

Project description

Nudatus is a tool to remove comments from Python scripts.

It was created for use in uflash to help squeeze longer programs onto the micro:bit but it should be suitable for various environments with restricted storage.

Note Nudatus uses the tokenizer built into Python so only supports the syntax of the version it’s running on, but it’s extremely unlikely this will cause you any issues (print is handled fine).

Personally I pronounce nudatus as new-dat-us which I appreciate is probably ‘wrong’.

Usage

Nudatus is designed to be embedded within a greater tool (like uflash or Mu by ntoll) but also provides a CLI tool:

nudatus [-h] [--version] [input] [output]

An input file must be specified but if output is omitted the result will be printed on stdout.

Calling from a Python script is quite simple:

import nudatus
source = '' # Input script
result = nudatus.mangle(source) # Result as str

0.0.5

  • Drop support for everything below Python 3.5

  • Format with black

  • Add type annotations (not that there is much to type)

0.0.2

  • Respect the contents of lists and dicts

0.0.1

  • Initial release.

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

nudatus-0.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

nudatus-0.0.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file nudatus-0.0.5.tar.gz.

File metadata

  • Download URL: nudatus-0.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for nudatus-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ba84a8e022cb4af0f995176383f5ff9fa83d57ded3cedc6aa4db1687f88cacec
MD5 c5f53fed3153080298b54e6547fd4b9a
BLAKE2b-256 234dcf8a2c68ef1f6653e3fb677e35e2fb3c549092853780a0cf6014beb83ec9

See more details on using hashes here.

File details

Details for the file nudatus-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: nudatus-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for nudatus-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 00284890d3b09aa90297eadcf9142504e13efc6e0ac5e5e8e8eb1947545296d1
MD5 c68f850bbc7184f6bf383bff89125f38
BLAKE2b-256 ab30014b1a127a66c93a7fbf18992aff1fd3478fd6385a68c4055e67b8c2b8b0

See more details on using hashes here.

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