Skip to main content

Get an object by name or dotted path, import if it necessary.

Install

pip install object_by_name

Usage

>>> from object_by_name import object_by_name
>>> object_by_name('test_package')
<module 'test_package' from ...>
>>> object_by_name('test_package.test_module')
<module 'test_package.test_module' from ...>
>>> object_by_name('test_package.test_module.TestClass')
<class 'test_package.test_module.TestClass'>
>>> object_by_name('test_package.test_module.instance')
<test_package.test_module.TestClass object at 0x...>
>>> object_by_name('test_package.test_module.instance.method')
<bound method TestClass.method of <test_package.test_module.TestClass ...>>

Release files for object_by_name 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for object_by_name 0.0.1
File Size Uploaded
object_by_name-0.0.1.tar.gz 1.8 kB Details

Release files / object_by_name-0.0.1.tar.gz

Download URL object_by_name-0.0.1.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7ed6123e9843ba3a728ee1517ff7a6cc7e935e78084cb436414a8a1254806c31
BLAKE2b-256 checksum
How to use checksums
f065b35ab51b03be876cab045ac1215bafc3aa217c17bd095ebf3c734332705d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page