{"id":13813730,"url":"https://github.com/heynemann/importer","last_synced_at":"2025-05-13T16:32:57.988Z","repository":{"id":44474997,"uuid":"77569400","full_name":"heynemann/importer","owner":"heynemann","description":"Importer is a library to do dynamic importing of modules in python","archived":false,"fork":false,"pushed_at":"2016-12-29T01:34:32.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T04:01:39.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heynemann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-29T00:16:50.000Z","updated_at":"2016-12-29T19:47:26.000Z","dependencies_parsed_at":"2022-07-28T23:38:48.031Z","dependency_job_id":null,"html_url":"https://github.com/heynemann/importer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heynemann%2Fimporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heynemann%2Fimporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heynemann%2Fimporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heynemann%2Fimporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heynemann","download_url":"https://codeload.github.com/heynemann/importer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253981820,"owners_count":21994342,"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":[],"created_at":"2024-08-04T04:01:27.643Z","updated_at":"2025-05-13T16:32:57.971Z","avatar_url":"https://github.com/heynemann.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# importer\n\nImporter is a library to do dynamic importing of modules in python.\n\n## Installing\n\n```\n    $ pip install importer-lib\n```\n\n## Usage\n\n```\nfrom importer import Importer\n\n# sets importer.module_a to the sys module\nimporter.import_item('module_a', 'sys')\n\n# sets importer.module_b to the importer.core module\nimporter.import_item('module_b', 'importer.core')\n\n# sets importer.module_c to the Importer class\nimporter.import_item('module_c', 'importer.core', class_name='Importer')\n\n# Multiple Imports\n\n# sets importer.modules to the specified modules\nimporter.import_item('modules', ('importer.core', 'os', 'sys', 'preggy'))\n\n# sets importer.handlers to the the specified class in all modules\n# this is very useful for modules that have the\n# same class like request handlers (Handler class)\nimporter.import_item(\n    'handlers', (\n        'module.handlers.healthcheck',\n        'module.handlers.index',\n        'module.handlers.login',\n    ), class_name='Handler'\n)\n\n# Loading all modules\n# You can also specify several modules to load at once\n\n# this is the same as all the calls above combined\nimporter.load(\n    {'key': 'module_a', 'module_names': 'sys'},\n    {'key': 'module_b', 'module_names': 'importer.core'},\n    {'key': 'module_c', 'module_names': 'importer.core', 'class_name': 'Importer'},\n    {'key': 'modules', 'module_names': ('importer.core', 'os', 'sys', 'preggy')},\n    {'key': 'classes', 'module_names': (\n        'module.handlers.healthcheck',\n        'module.handlers.index',\n        'module.handlers.login',\n    ), 'class_name': 'Handler'},\n)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheynemann%2Fimporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheynemann%2Fimporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheynemann%2Fimporter/lists"}