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.

0.2.3

  • Doc update.

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magic_import-0.2.3-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file magic_import-0.2.3.tar.gz.

File metadata

  • Download URL: magic_import-0.2.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for magic_import-0.2.3.tar.gz
Algorithm Hash digest
SHA256 46997fdc651cc3d513f456172097ba2dd5e6ec0a17c02b11d4ae6d886b7674ae
MD5 53fc176f4b169da2528326fa1ad8b866
BLAKE2b-256 6e331806a928a5a00a9a92b1c5df2ba9c1b3fbed6950c8f1d3140ad31db0bfd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: magic_import-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for magic_import-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13c83fdd2fbd2a9d4f7534fb42a858e85c90bba1c80188131e93d6053c057f30
MD5 891c5fe30273a49d1eb458441358a9e5
BLAKE2b-256 c6fcad38412f7380c201fed6a8cc7178d855f4b89b5d48f5be6a2bc191def3da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page