Skip to main content

Python Inliner merges in a single file all files from a Python package.

Project description

pinliner - Python Inliner

https://img.shields.io/:license-apache-blue.svg https://img.shields.io/pypi/v/pinliner.svg

This tool allows you to merge all files that comprise a Python package into a single file and be able to use this single file as if it were a package.

Not only will it behave as if it were the original package, but it will also show code in exceptions and debug sessions, and will display the right line number and file when logging.

Imports will work as usual so if you have a package structure like:

.
└── [my_package]
     ├── file_a.py
     ├── [sub_package]
     │    ├── file_b.py
     │    └── __init__.py
     ├── __init__.py

And with pinliner installed you execute:

$ mkdir test
$ pinliner my_package test/my_package.py
$ cd test
$ python

You’ll be able to use generated my_package.py file as if it were the real package:

>>> import my_package
>>> from my_package import file_a as a_file
>>> from my_package.sub_package import file_b

And __init__.py contents will be executed as expected when importing my_package package and you’ll be able to access its contents like you would with your normal package.

Modules will also behave as usual.

Installation

You can install pinliner globally in your system or use a virtual environment, this is how it could be done using a virtual environment:

$ virtualenv .venv
$ source .venv/bin/activate
$ pip install pinliner

After that you can run the tool with pinliner.

History

0.1.1 (2016-03-29)

  • Fix missing template file when installing

  • Reduce memory footprint to keep the package structure and code.

  • Include tagging of beginning of files in the output.

0.1.0 (2016-03-27)

  • Show code when debugging and on tracebacks

  • Improve internal package and module names

  • Fix line numbers (off by 1)

  • Package’s root namespace is no longer polluted by pinliner

  • Original filename for package/modules is stored so it will be reported by exceptions and logging.

0.0.1 (2016-03-26)

  • Basic functionality.

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

pinliner-0.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinliner-0.1.1-py2.py3-none-any.whl (9.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pinliner-0.1.1.tar.gz.

File metadata

  • Download URL: pinliner-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pinliner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 630682fae72c97ad29d7de5f755b188b53217aee08cd68924ad8b213dd01b000
MD5 59fcbe712b1400b1f84b61ee802591f4
BLAKE2b-256 ff2a20efab8cf9965eb8d0a6fe9a9c333276f057f4f1109b257987284437ccc6

See more details on using hashes here.

File details

Details for the file pinliner-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pinliner-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 532794b2fbc5a0bf7a4add59ec72ae00e29e785b5dc340e2982f6c8c7e86a840
MD5 f20ae5d5c1467779e38a7646a3361d94
BLAKE2b-256 32125e7ac55786d634ce174e37d27b53ddbcd566cfb2744f87caef965aeb2505

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