Skip to main content

easy_import.py

Project description

easy_import

Python imports made easy! Import any module or package from anywhere - as though it was in your current working directory.

github

easy_import on github

Installation

Requires python 3.

pip install easy_import

Usage

"""
data_tools.py is a (fictious) module located....somwehere on your computer. 
But not in the current working directory.

Directly trying to import it will raise an ImportError since its not visible.

easy_import to the rescue!

It will search the entire storage (or a given directory) for the module and make it visible
for importing as though it was in the current working directory.
"""

from easy_import import EasyImport
with EasyImport("data_tools.py"):
    import data_tools

# etc

"""
Now we can use a function or class in data_tools.py
e.g. :
"""
smoothed_data = data_tools.smooth(data)

"""
Since searching the entire storage is s l o w, the locations of searched items
are cached to json files so the next time you run it, it will be super fast!

Check out example.py in the repository for a runnable example and more details.
"""

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

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

easy_import-0.4.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

easy_import-0.4-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file easy_import-0.4.tar.gz.

File metadata

  • Download URL: easy_import-0.4.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for easy_import-0.4.tar.gz
Algorithm Hash digest
SHA256 6a944ffdfe36ebfd0df24443b7ccfa65b7974b373a0eb986e18f18266a92155e
MD5 546450ff78d6d14ccd4afae3be5e8a45
BLAKE2b-256 0b3b08ef3dacbaea1d871e75cbc0c2613eeb8c06964194acc24bca53f939dfac

See more details on using hashes here.

File details

Details for the file easy_import-0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: easy_import-0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for easy_import-0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a1ef9d147409e9c922e5ef2763f0631f0d74e49e491329cdb77efe74893a99cd
MD5 82d03b6b39a22009bca38eea58a2f02e
BLAKE2b-256 5c2bd78905677cfff55ba1a95e52b8e25f59f12409a968c1dd901bb7a9206f63

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