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.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

path_imports-1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: path_imports-1.0.tar.gz
  • Upload date:
  • Size: 4.7 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.0.tar.gz
Algorithm Hash digest
SHA256 efececc53f7ba216d2896687fd71938910196d321e513b6e150e5f36c2bab6be
MD5 1354d9926ca930c5e8986a3ac4a5e8bd
BLAKE2b-256 d58b7318acdc24ba719a3f6e0553c41d105ed4c56b70d0c69067b17c34dbd0d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: path_imports-1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c17802fdd04633af6c3327c1a3af16d01dc45dd21069e704c30093fe6ada359b
MD5 e410169fe331c959ea5fd0ad2f647c1c
BLAKE2b-256 b645e45e7de48ec2faf938ec635ef5d3fc48afdd4baf05722c824f121e8d0a93

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