Metadata-Version: 2.4
Name: importloc
Version: 0.1.0
Summary: Import Python objects from arbitrary locations
Project-URL: Documentation, https://importloc.readthedocs.io
Project-URL: Homepage, https://github.com/makukha/importloc
Project-URL: Repository, https://github.com/makukha/importloc
Project-URL: Issues, https://github.com/makukha/importloc/issues
Project-URL: Changelog, https://github.com/makukha/importloc/releases
License: MIT
License-File: LICENSE
Keywords: import,import-module,import-object,import-string,python
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# importloc
> Import Python objects from arbitrary locations

<!-- docsub: begin -->
<!-- docsub: include docs/parts/badges.md -->
[![versions](https://img.shields.io/pypi/pyversions/importloc.svg)](https://pypi.org/project/importloc)
[![pypi](https://img.shields.io/pypi/v/importloc.svg#v0.1.0)](https://pypi.python.org/pypi/importloc)
[![tested with multipython](https://img.shields.io/badge/tested_with-multipython-x)](https://github.com/makukha/multipython)
[![using docsub](https://img.shields.io/badge/using-docsub-royalblue)](https://github.com/makukha/docsub)
[![license](https://img.shields.io/github/license/makukha/importloc.svg)](https://github.com/makukha/importloc/blob/main/LICENSE)
<!-- docsub: end -->


# Features

* Import module from file `path/to/file.py`
* Import object from file `path/to/file.py:object[.attr...]`
* Import object from module `[...package.]module:object[.attr...]`
* No dependencies


# Installation
<!-- docsub: begin -->
<!-- docsub: include docs/parts/installation.md -->
```shell
$ pip install importloc
```
<!-- docsub: end -->


# Usage

For more details, [read the docs](http://importloc.readthedocs.io).

## [module_from_file](https://importloc.readthedocs.io/en/latest/#importloc.module_from_file)

<!-- docsub: begin -->
<!-- docsub: include tests/test_module_from_file.txt -->
<!-- docsub: lines after 1 upto -1 -->
```doctest
>>> from importloc import *
>>> foobar = module_from_file('example/foobar.py')
>>> foobar
<module 'foobar' from ...example/foobar.py'>
```
<!-- docsub: end -->

## [object_from_file](https://importloc.readthedocs.io/en/latest/#importloc.object_from_file)

<!-- docsub: begin -->
<!-- docsub: include tests/test_object_from_file.txt -->
<!-- docsub: lines after 1 upto -1 -->
```doctest
>>> from importloc import *
>>> baz = object_from_file('example/foobar.py:baz')
>>> baz
<function baz at 0x...>
```
<!-- docsub: end -->

## [object_from_module](https://importloc.readthedocs.io/en/latest/#importloc.object_from_module)

<!-- docsub: begin -->
<!-- docsub: include tests/test_object_from_module.txt -->
<!-- docsub: lines after 1 upto -1 -->
```doctest
>>> from importloc import *
>>> baz = object_from_module('example.foobar:baz')
>>> baz
<function baz at 0x...>
```
<!-- docsub: end -->


# Changelog

Check repository [CHANGELOG.md](https://github.com/makukha/importloc/tree/main/CHANGELOG.md)
