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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: path_imports-1.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.1.tar.gz
Algorithm Hash digest
SHA256 12aede01bdf54b3352ad22b6c5847da59eacccaa446f91bd67d87431ebcaa7ba
MD5 8ec6470f09da5d5039feecce25c4149a
BLAKE2b-256 e077e7498e14a4c70289887714c9b991e0e38ab0926f28bac75480d4edde33ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for path_imports-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8037d241efb646b5b31ab30119e7298d5761d1cb559833cb94fe6f74502bf797
MD5 f0609590535ba003e27ebfe1de9c15c4
BLAKE2b-256 997506576834220d75fa843820c1c1be36cdf9bfa826d43c21f55fbd4b5e17cf

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