Skip to main content

A package to automate setting up absolute imports and namespace.

Project description

absolute-import

About

Package providing a one-line functionality to set up a project for ability to perform absolute imports both after setup and with plain download. Additionally, provides namespaces support.

Usage

Absolute import

  1. In the root __init__.py.

    from absolute_import import absolute_import
    
    absolute_import(file=__file__)
    
  2. In the root __main__.py or root directly executable python files.

    from absolute_import import absolute_import
    
    if __name__ == "__main__":
    	absolute_import(file=__file__)
    

Absolute import and namespace

  1. In the root __init__.py.

    from absolute_import import absolute_import
    
    absolute_import(file=__file__, name=__name__, path=__path__)
    
  2. In the root __main__.py or root directly executable python files.

    from absolute_import import absolute_import
    
    if __name__ == "__main__":
    	absolute_import(file=__file__, name=__name__, path=__path__)
    

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

absolute-import-0.4.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file absolute-import-0.4.tar.gz.

File metadata

  • Download URL: absolute-import-0.4.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for absolute-import-0.4.tar.gz
Algorithm Hash digest
SHA256 ae52cd81cbd7f3bb2fafc8ae54e44e249e7e4d1d37748f27f4f23aacfc31757b
MD5 b8416ea52bcceb12c4248c42fc5c514a
BLAKE2b-256 b9bccaf8604ae6ceedd25dc33aa75ba2ef3c3cf407e4593d06bf6db58b4c2897

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page