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.

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 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.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.0.1.tar.gz (15.5 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.0.1-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for pinliner-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4c054876240c144805d39e846347723ec4cb98e6ba99b2401a068d18e7cebd53
MD5 234832d2c72039ad00eda1263eb5c4c8
BLAKE2b-256 e69fafb5d857b92d869d2c226b9053e123f602d3921346583478cf0a46a76e6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pinliner-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 814b9bd0e77b59fb4e8f909ea470ea17e15bad2ce8ef3f4cdfb2a87352d00abd
MD5 0e0593ade27df63abd9bf4cdcdc06abd
BLAKE2b-256 5a4a5ca8f95dd0a55ba7bc10e29215c80eb17e7edb5c0e50e59e8f99b6a36a48

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