python-minifier
python-minifier copied to clipboard
Transform Python source code into its most compact representation
hi, i tried this to minify code that needs to run on python 2.7 and python 3.7 sadly print() gets translated to print if minifying is run on 2.7 which...
First of all, i love this project. As i'm working on a micropython port (microbit) there always not enghoug space for the source in the mb. Reduces my actual project...
This: ```py from pymongo import MongoClient connection_str = 'connection_str' cluster = MongoClient(connection_str) database = cluster['db'] collection = database['col'] document = collection.find() if document['_id'] == 123: print('ok') ``` By default turns...
- Indentation can be minified - Sometimes it transforms a literal into a variable when the literal is only used once and it becomes less minified - Large numbers will...
Thanks for this! It cut my lambda function size in half and increase speed by 100ms :D
When running `pyminify --remove-literal-statements file.py`, any reference to `__doc__` anywhere in the processed module will disable removal of _any_ literal. The documentation states (emphasis mine): > "If the module uses...
Hi, awesome project. Is it planned to shorten private and/or protected class members similarly to local variables (unsafe transformation)? best
Hi @dflook, I am a hobbyist maker who has been using MicroPytohn on embedded devices with limited storage. The current libraries being used have module-level if statements to create cross-platform...
Adds Python 3.12 support - [x] Type parameter syntax - [x] Add type parameter syntax property tests - [ ] Add type parameter scoping rules - [ ] Update renamer...