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.

Files for absolute-import, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size absolute-import-0.4.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page