Skip to main content

python-code-splitter

A tool to split Python code by classes and functions.

Install

pip install python-code-splitter

Usage

python-code-splitter path/to/file.py

Class and function definitions are extracted from the target file and written into separate new files (including decorators and comments). The new file name will be {class name or function name converted to snake_case}.py. The remaining content of the target file is moved to __init__.py. Necessary import statements are added to the top of each file.

The command has a --git option.

python-code-splitter path/to/file.py --git

It automatically creates a git branch based on the target file path, and commits in review-friendly units.

You can also use the --targets option to move only classes or functions.

python-code-splitter path/to/file.py --targets class

Metadata

Release files for python-code-splitter 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-code-splitter 0.2.2
File Size Uploaded Provenance Actions
python_code_splitter-0.2.2.tar.gz 40.5 kB Without provenance Details for python_code_splitter-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-code-splitter 0.2.2
File Interpreter ABI Platform Actions
python_code_splitter-0.2.2-py3-none-any.whl Python 3 none any Details for python_code_splitter-0.2.2-py3-none-any.whl

Total release size: 50.6 kB

Release files / python_code_splitter-0.2.2.tar.gz

Download URL python_code_splitter-0.2.2.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01ed35f08b83e6b4513d4c9f6cca625cf39e1bffd03586a2ec37b55522154a84
BLAKE2b-256 checksum
How to use checksums
e6010790f2db4aef38e5ab511ba14cb49a0bdfbf752c836f6c3bf1ab3704892a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / python_code_splitter-0.2.2-py3-none-any.whl

Download URL python_code_splitter-0.2.2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91f65d15ae09969a50dd05a3a347c133cd1d6e53d968147cde3fed3913e17bd1
BLAKE2b-256 checksum
How to use checksums
bcabcc71261467fed388145f95d4f4979476092402478610e8ecda51cd0c6160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Security for python-code-splitter 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page