{"id":16539794,"url":"https://github.com/rickstaa/stand_alone_sub_package_folder_example","last_synced_at":"2026-05-09T11:51:35.485Z","repository":{"id":104253588,"uuid":"319320724","full_name":"rickstaa/stand_alone_sub_package_folder_example","owner":"rickstaa","description":"Example repository for including stand alone subpackages into other python packages.","archived":false,"fork":false,"pushed_at":"2021-06-12T16:23:42.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T07:28:51.042Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rickstaa.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":"2020-12-07T12:58:52.000Z","updated_at":"2022-06-04T15:07:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb7ac796-db32-4292-84da-490d8e7e8b94","html_url":"https://github.com/rickstaa/stand_alone_sub_package_folder_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Fstand_alone_sub_package_folder_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Fstand_alone_sub_package_folder_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Fstand_alone_sub_package_folder_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickstaa%2Fstand_alone_sub_package_folder_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickstaa","download_url":"https://codeload.github.com/rickstaa/stand_alone_sub_package_folder_example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241773854,"owners_count":20018179,"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-10-11T18:50:34.553Z","updated_at":"2026-05-09T11:51:30.442Z","avatar_url":"https://github.com/rickstaa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stand alone sub package folder example\n\nThis is a small example repository you can use when you want to ship a stand-alone python package inside another python package. It was created as a simple test repository when I for one of my products needed a meta package that contained multiple packages that could also be installed individually. While doing so I wanted to make sure I did not have redundant folders in the package import name_space of the meta package. For example I want users to have the ability to import the `PythonClass` found under the  `main_package.stand_alone_subpackage.stand_alone_subpackage.subpackage_module.python_module` under a shortened namespace `main_package.stand_alone_subpackage.subpackage_module.python_module`. Meaning I want to get rid of the redundant `stand_alone_subpackage` namespace that was created because the subpackage also has to work as a stand alone [pypi](https://pypi.org/) package.\n\n## Current working methods\n\nAfter asking [a question on stackoverflow](https://stackoverflow.com/questions/63464555/create-name-space-package-that-contains-standalone-installable-sub-package/63465830#63465830) I came up with a setup that allows getting rid of the redundant folder. The code for this is found in the `setup.py` file. Using this setup.py file you can install the package with the shortened namespace package using the `pip install .` command. I also looked for a way to put all this logic inside the setup.cfg file [see this issue on setuptools](https://github.com/pypa/setuptools/issues/2467). This however is not yet possible without converting all the sub packages to [name_space packages](https://packaging.python.org/guides/packaging-namespace-packages/) and using the [recommended name_space packages folder structure](https://github.com/pypa/sample-namespace-packages/tree/master/native). For my solution I did not want to do this since this makes the folder structure more complicated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickstaa%2Fstand_alone_sub_package_folder_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickstaa%2Fstand_alone_sub_package_folder_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickstaa%2Fstand_alone_sub_package_folder_example/lists"}