Skip to main content

Python, MicroPython and CircuitPython files merger

Reason this release was yanked:

deprecated

Project description

Python Version License Workflow Tests Coverage

The Python Files 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 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.3.tar.gz (13.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: python_files_merger-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ddd5ef81e2c98bf76b85f80b944c1d0eb54ecf4703b12afe6a769af7c6c661e8
MD5 d29d77abcbc275e96d17e2405a6d6db4
BLAKE2b-256 365886ee9d1ff8db3c46ca068ada84060ad169e7f28ff9f0bfdc83f16b6a2148

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