monosplit
monosplit is your friendly neighborhood Python file splitter! It takes a hefty Python file and splits it into a neat module with smaller, manageable files. It's not too stupid, either! It figures out which imports are needed in each new file and keeps them intact. If a main function or standard main block is detected, it's moved the new module main at __main__.py.
Installation
monosplit is available on PyPI! Install it with pip:
pip install monosplit
git clone https://github.com/GRAYgoose124/pysplit.git
pip install [-e] monosplit
Usage
Add some # pragma newfile("name") statements to the file you want to split and run:
monosplit your_python_file.py
Watch as your file is transformed into a tidy module with smaller files. This new directory module can be imported or ran similarly to the original file!
Testing
Run the tests with the unittest module:
python -m unittest discover tests
License
PySplit is released under the MIT license.
Release files for monosplit 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| monosplit-0.1.2.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| monosplit-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / monosplit-0.1.2.tar.gz
| Download URL | monosplit-0.1.2.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe21212bf8595c5e73ac5c2f61ba031077a82797fb3de267036247c07ebb2e79
|
|
BLAKE2b-256 checksum How to use checksums |
4743858207355bdd25ebbab8814f0657dde33babaf23237928b1d327fb63878f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / monosplit-0.1.2-py3-none-any.whl
| Download URL | monosplit-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cfd3cd070f876a7cf6e8d67ec951471b600366f6f9c0fcd38eb8ef9d3f8e95b0
|
|
BLAKE2b-256 checksum How to use checksums |
9b2913311c59009a6e1d4d0cc85095f3995c209f61354be54b85e5be3812b569
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|