Skip to main content

Import modules from anywhere on the file system.

Project description

Introduction

Import modules from anywhere on the file system.

Usage

import path_imports


# Import a certain file
foo_module = path_imports.import_from_path('somewhere/on your/file system/foo.py')

# Import a module from a certain directory
submodule = path_imports.import_from_directory('some/directory', 'root_module.submodule')

# Find the file path of a module
path = path_imports.find_module_location('my_module', directory='my project folder')
print(path)  # Output: "my project folder/my_module.py"

Installation

pip install path-imports

Documentation

There is no online documentation; however, the module has docstrings and type annotations. Your IDE should display all the relevant information to you.

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

path_imports-1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

path_imports-1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file path_imports-1.1.tar.gz.

File metadata

  • Download URL: path_imports-1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for path_imports-1.1.tar.gz
Algorithm Hash digest
SHA256 b38bcf620201b55af2aab54d1fa456aaa6c953f00078b0fa81fa0eecd027d9fe
MD5 dbf2fe8bbf49807bf5f4c4e6225dd642
BLAKE2b-256 f63b24086466edf40c9f368f0a2afbe1f98bf935e195448ab9946cc5bc0c8628

See more details on using hashes here.

File details

Details for the file path_imports-1.1-py3-none-any.whl.

File metadata

  • Download URL: path_imports-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for path_imports-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 896e57a6f6a0e30364c7f58fb87b014993f7299ddef1474ee382c8c842498a64
MD5 4fdecdefa202b1762487930818dd5e63
BLAKE2b-256 c6a96d82ee1625e0cae60dcf87df6be5b03da9cb1a6eecac04b4b411b3411988

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