Skip to main content

compyner

ComPYner is a small tool to bundle a python file and all its imports into a single file. This was created due to the limitations of the micropython implementation on the spike prime, where there is no filesystem to store multiple files. We are aware that there are better ways to implement what we have done, but this is the least ugly code that will run on spike primes micropython.

Installation

Install compyner with pip, or another tool using PyPI:

pip install compyner

Usage

compyner <input> -o <output>

This command will read the file at <input>, "compyne" it and writes the result to <output>

If the -o/--output argument is not used, the result will be saved with the same name as the input file but with the suffix .cpyd.py.

Excluding modules

If any modules are imported that are in the standard library, these need to be excluded. Normally, the script detects these imports and excludes them automatically, but this does not work for some, like the collections module. Modules that are only availible in the standard library of the target environment should be excluded as well.

Modules that should be excluded should be passed as a space-seperated list to the --exclude argument.

Example

compyner main.py --exclude math -o output.py

This will combine the file main.py with all the files it imports, except for math, and output the result to output.py.

Known issues

None at the moment.

Authors

Metadata

Release files for compyner 0.3.1

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

Source distribution (sdist)

Source distribution for compyner 0.3.1
File Size Uploaded Provenance Actions
compyner-0.3.1.tar.gz 8.5 kB Without provenance Details for compyner-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for compyner 0.3.1
File Interpreter ABI Platform Actions
compyner-0.3.1-py3-none-any.whl Python 3 none any Details for compyner-0.3.1-py3-none-any.whl

Total release size: 18.9 kB

Release files / compyner-0.3.1.tar.gz

Download URL compyner-0.3.1.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ac992122d07c65eaf8432ea31ec1556198d1957ba654bb8465751507c6fe38c8
BLAKE2b-256 checksum
How to use checksums
f3f6f3de9fc2a2a6af2111b6a6546b48fa2bdaea784ee7469bcc9eaf4cd2b263
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.3 Windows/10

Release files / compyner-0.3.1-py3-none-any.whl

Download URL compyner-0.3.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00787cbbdc4d476076ce41552cbccf3c6796fcc1fbf326b586fe5cb4f940b033
BLAKE2b-256 checksum
How to use checksums
2b99115be72b07b5d9651d8d64ae2f2104e41a97ca8c8c9f1eb46c1586ade038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.3 Windows/10

Security for compyner 0.3.1

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