Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Imports an object based on a string

Project description

import_string Documentation Status Updates

Imports an object based on a string


Imports an object based on a string. This is useful if you want to use import paths as endpoints or something similar. An import path can be specified either in dotted notation (.) or with a colon as object delimiter (:). If silent is True the return value will be None if the import fails.


import import_string

module = import_string('my_system.my_package.my_module')

function = import_string('my_system.my_module:some_function')

Class = import_string('my_system.my_module:SomeClass', silent=True)
# If path doesn't exist Class = None



0.1.0 (2016-06-30)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for import_string, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size import_string-0.1.0-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size import_string-0.1.0.tar.gz (22.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page