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.2.tar.gz (13.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: python_files_merger-1.0.2.tar.gz
  • Upload date:
  • Size: 13.1 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.2.tar.gz
Algorithm Hash digest
SHA256 f656615ea22b43cf67c81126753c3cdbf11832c9057a9334cc208062ac21fe01
MD5 7b6cbc5f388682080b5156c4fe4ca1d7
BLAKE2b-256 8f33926fdba946040fcb810f52cf9c7af753e1b32e7292d5464ca7f4e6255571

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