{"id":13813847,"url":"https://github.com/rochacbruno-archive/import_string","last_synced_at":"2025-12-13T16:42:07.392Z","repository":{"id":62570777,"uuid":"62327543","full_name":"rochacbruno-archive/import_string","owner":"rochacbruno-archive","description":"Imports an object based on a string  import_string('package.module:function_name')() - Based on werkzeug.utils","archived":true,"fork":false,"pushed_at":"2019-11-07T15:19:06.000Z","size":22,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T12:54:16.821Z","etag":null,"topics":["import","importer","metaprogramming"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rochacbruno-archive.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-30T16:49:45.000Z","updated_at":"2023-01-28T16:42:53.000Z","dependencies_parsed_at":"2022-11-03T17:15:36.256Z","dependency_job_id":null,"html_url":"https://github.com/rochacbruno-archive/import_string","commit_stats":null,"previous_names":["rochacbruno/import_string"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochacbruno-archive%2Fimport_string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochacbruno-archive%2Fimport_string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochacbruno-archive%2Fimport_string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rochacbruno-archive%2Fimport_string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rochacbruno-archive","download_url":"https://codeload.github.com/rochacbruno-archive/import_string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249198,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["import","importer","metaprogramming"],"created_at":"2024-08-04T04:01:32.722Z","updated_at":"2025-12-13T16:42:02.340Z","avatar_url":"https://github.com/rochacbruno-archive.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"DEPRECATED don't use it. Please do::\n\n    import importlib\n    foopath = 'src.apis.foo.Foo'\n\n    module_name = '.'.join(foopath.split('.')[:-1]) # to get src.apis.foo\n    foo_module = importlib.import_module(module_name)\n    clazz_name = foopath.split('.')[-1] # to get Foo\n    Foo = getattr(module_name, clazz_name)\n    print Foo()\n\n\n=============\nimport_string\n=============\n\n\n.. image:: https://img.shields.io/pypi/v/import_string.svg\n        :target: https://pypi.python.org/pypi/import_string\n\n.. image:: https://img.shields.io/travis/rochacbruno/import_string.svg\n        :target: https://travis-ci.org/rochacbruno/import_string\n\n.. image:: https://readthedocs.org/projects/import-string/badge/?version=latest\n        :target: https://import-string.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/rochacbruno/import_string/shield.svg\n     :target: https://pyup.io/repos/github/rochacbruno/import_string/\n     :alt: Updates\n\n\nImports an object based on a string\n\n\n* Free software: ISC license\n* Documentation: https://import-string.readthedocs.io.\n\n\nFeatures\n--------\n\nImports an object based on a string.  This is useful if you want to\nuse import paths as endpoints or something similar.  An import path can\nbe specified either in dotted notation (``.``)\nor with a colon as object delimiter (``:``).\nIf `silent` is True the return value will be `None` if the import fails.\n\nUsage\n-----\n\n.. code-block:: python\n\n    import import_string\n\n    module = import_string('my_system.my_package.my_module')\n\n    function = import_string('my_system.my_module:some_function')\n\n    Class = import_string('my_system.my_module:SomeClass', silent=True)\n    # If path doesn't exist Class = None\n\n\nLive demo\n---------\n\nSee it in action here: https://repl.it/EGdS/0\n\nCredits\n-------\n\n- This package was extracted from `werkzeug.utils` module\n- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frochacbruno-archive%2Fimport_string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frochacbruno-archive%2Fimport_string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frochacbruno-archive%2Fimport_string/lists"}