Skip to main content

A packaging utility to treat folders as packages

Project description

Packagify

A packaging utility to access folders that aren't suitable to be used as packages, as python packages.

How to use

from packagify import Packagify
package = Packagify("/home/workspace/my_package")
object = package.import_module("module", ["object"])
object1, object2 = package.import_module("module", ["object1", "object2"])

How this works

  1. This class overrides the import functionality of python while importing the module.

    1. When the package tries to import certain modules from it's directory assuming the script ran from there, we change the level of import from absolute to relative.

    2. If a module adds a system path (using sys.path.append) we change the path to reflect the location of the module relative to the location from where we are loading the entire pacakage.

  2. After importing we revert back the functions to originals so that rest of the importing can work as is

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

packagify-1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

packagify-1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file packagify-1.0.tar.gz.

File metadata

  • Download URL: packagify-1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for packagify-1.0.tar.gz
Algorithm Hash digest
SHA256 56f83f448c58376cc740692e5a2f0acf7a15251819367ecc11f83990616bb77d
MD5 18520a56502bc377da9b64dda9ab582a
BLAKE2b-256 e500d7a9085f86b26ecb409fba756ca79fadb52371ba3c673d0d3f2f0ad727ce

See more details on using hashes here.

File details

Details for the file packagify-1.0-py3-none-any.whl.

File metadata

  • Download URL: packagify-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for packagify-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afb45b4c65e73aa1c9826125dd2247013ebce00b1206756190bc4ece8b02cae8
MD5 77136a40c645168a840e4bbf38bed0e1
BLAKE2b-256 19a5270950c4bd755ad468f11d7f60428a1aed81f13255c51bf5ea8c31abbdf2

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