Skip to main content

Import python object from string and return the reference of the object. The object can be a class, instance, variable and anything else, and can be from class, instance, module, global/local environment.

Project description

magic-import

Import python object from string and return the reference of the object. The object can be a class, instance, variable and anything else, and can be from class, instance, module, global/local environment.

Install

pip install magic-import

Test Passed On Python Versions

  • 2.7
  • 3.2
  • 3.3
  • 3.4
  • 3.5
  • 3.6
  • 3.7
  • 3.8
  • 3.9
  • 3.10
  • 3.11

Usage

from magic_import import import_from_string

listdir = import_from_string("os.listdir")
files = listdir(".")

Release

0.1.0

  • First release

0.1.1

0.1.2

0.1.3

0.2.0

  • Some updates.

0.2.2

  • Test passed on all python versions.

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

magic-import-0.2.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

magic_import-0.2.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file magic-import-0.2.2.tar.gz.

File metadata

  • Download URL: magic-import-0.2.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for magic-import-0.2.2.tar.gz
Algorithm Hash digest
SHA256 662592f5d6c21f71d9c79a76da56cfdc0f445cbeec8f3b73d3c8423c8fc85b62
MD5 19b37264c836b7c15c4f5b584fc99f68
BLAKE2b-256 484747041dbd2590678d470b4c3d9ef2f3ca779603dc336eee3684e06c0b681b

See more details on using hashes here.

File details

Details for the file magic_import-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for magic_import-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63ff636371c240c39f38bec5ae5bd87310df386d0343efbf3a6d66e27e5314aa
MD5 c4925a8e546d5837f52d78146a9c3ede
BLAKE2b-256 3ff523855a79e9bf59e83e7ed14c371de0b9b8c0c34be3cbe7ff35058d867e72

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