{"id":18009725,"url":"https://github.com/alexpoulsen/importer","last_synced_at":"2026-04-20T13:37:54.675Z","repository":{"id":128072988,"uuid":"142644540","full_name":"AlexPoulsen/importer","owner":"AlexPoulsen","description":"Preventing insanity when dealing with local imports [currently broken in 3.7]","archived":false,"fork":false,"pushed_at":"2018-10-30T05:50:16.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T12:34:18.545Z","etag":null,"topics":["import","imports","module","module-loader","modules","packages","python","python36","python37"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexPoulsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-28T03:47:02.000Z","updated_at":"2019-04-02T01:09:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c60f40e-8b8d-4495-9c8a-ca78ba8bcdd6","html_url":"https://github.com/AlexPoulsen/importer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexPoulsen/importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPoulsen%2Fimporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPoulsen%2Fimporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPoulsen%2Fimporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPoulsen%2Fimporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexPoulsen","download_url":"https://codeload.github.com/AlexPoulsen/importer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexPoulsen%2Fimporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004913,"owners_count":26083802,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","imports","module","module-loader","modules","packages","python","python36","python37"],"created_at":"2024-10-30T02:10:26.837Z","updated_at":"2025-10-10T18:16:29.256Z","avatar_url":"https://github.com/AlexPoulsen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# importer\n\nPreventing insanity when dealing with local imports\n\nPushing Importer to the interpreter package directory with `push_importer_to_interpreter_path()`\n\nThe command copies the folder into itself ignoring git files and preventing infinite looping, initializes Importer with the copied version of itself and pushes it to the interpreter package directory, and deletes the created copy.\n\n```python\nimport importer\nIm = importer.Importer(\"moduleone\", \"moduletwo\")\nIm.moduleone.myfunc(\"foo\", 1, 2)\nIm.moduletwo.anotherfunc(3, 4, \"bar\")\nIm.modulethree.func(\"foo\", \"bar\", \"bat\")  # yes this works, assuming all three packages are in the directory\nIm.moduleone.__file__  # './moduleone/__init__.py'\nIm.path(\"moduleone\")  # '/Users/you/folders/moduleone/__init__.py/'\n```\n\nPackages with invalid characters in the name (-, /, $, +, etc) are now edited to remove them, and they are replaced with underscores. Even though this should work fine, you should still edit the package's name, if possible, to a valid name. Names starting with a number have it replaced with a _ by default.\n\nTested on py3.7, but should work on py3.6 as that is when f-strings were added. Importer could be backported further easily.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpoulsen%2Fimporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpoulsen%2Fimporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpoulsen%2Fimporter/lists"}