Skip to main content

Python, MicroPython and CircuitPython files merger

Reason this release was yanked:

deprecated

Project description

Python Files Merger

Python Version License Workflow Tests Coverage

The Python Code Merger is a tool that seamlessly combines multiple Python files into a single, well-organized unit while automatically handling imports, checking definition collisions, and resolving dependencies. It can also be used to merge standard Python files but works especially well hadnling files designed for microcontrollers. The package supports Python, MicroPython, and CircuitPython files.

Usage

Shell example

python -m python_files_merger src/*

or

python -m python_files_merger src/lorem.py src/ipsum.py

You can see shell option with python -m python_files_merger -h

File example

import python_files_merger

python_files_merger.merge(["src/**"], output="merged_files.py")

The function also returns the raw string, so you could do:

import python_files_merger

output_string = python_files_merger.merge(["src/**"])
print(output_string)

Only optional parameter is "output", that lets you choose where the output should be saved.

Contributing

Developing

You can download the repo and run the merger with python -m python_files_merger <files_to_merge>

Lint

pylint python_files_merger

Tests

You can click on the tests badge to check the tests status

pytest 

Coverage

You can clickon the coverage badge to check the code coverage

coverage run --source=python_files_merger -m unittest discover && coverage report

Reports and badges

Right now, badges are generated locally and uploaded to github, we should really do this in github workflows.

To generate reports and badges:

python genbadges.py

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

python_files_merger-1.0.1.tar.gz (13.2 kB view details)

Uploaded Source

File details

Details for the file python_files_merger-1.0.1.tar.gz.

File metadata

  • Download URL: python_files_merger-1.0.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for python_files_merger-1.0.1.tar.gz
Algorithm Hash digest
SHA256 94953f54751850be556d2cb68a19e679f2774615d9709c20170c95c1dfc0af25
MD5 a5a5bd8dd67738034bc3ebfe057256e0
BLAKE2b-256 779a6f62d29fe133f7e6b5ad992c68dd47d0a6f906a674aa367d6f218aac8e5d

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