packagediscovery


Namepackagediscovery JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryPackage discovery based on Setuptools.
upload_time2025-09-01 07:59:00
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT License Copyright (c) 2025 Yukihiko Shinoda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords setuptools package discovery
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Package Discovery

[![Test](https://github.com/yukihiko-shinoda/package-discovery/workflows/Test/badge.svg)](https://github.com/yukihiko-shinoda/package-discovery/actions?query=workflow%3ATest)
[![CodeQL](https://github.com/yukihiko-shinoda/package-discovery/workflows/CodeQL/badge.svg)](https://github.com/yukihiko-shinoda/package-discovery/actions?query=workflow%3ACodeQL)
[![Code Coverage](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery/coverage.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery)
[![Maintainability](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery/maintainability.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery)
[![Dependabot](https://flat.badgen.net/github/dependabot/yukihiko-shinoda/package-discovery?icon=dependabot)](https://github.com/yukihiko-shinoda/package-discovery/security/dependabot)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/packagediscovery)](https://pypi.org/project/packagediscovery)
[![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fyukihiko-shinoda%2Fpackage-discovery)](http://twitter.com/share?text=Package%20Discovery&url=https://pypi.org/project/packagediscovery/&hashtags=python)

Package discovery based on Setuptools.

## Advantage

1. Debug packages that Setuptools discovered
2. Easy to filter packages to root packages only

### 1. Debug packages that Setuptools discovered

You can check the discovered packages by running the following Python code.

print_packages.py:

```python
from packagediscovery import Setuptools

print(Setuptools().packages)
```

```bash
$ python print_packages.py
['packagediscovery']
```

Since Package Discovery settings of Setuptools is a bit complicated so that we may want to know what packages Setuptools are discovering now.

cf. [Package Discovery and Namespace Packages - setuptools documentation]

### 2. Easy to filter packages to root packages only

You can filter the discovered packages to only include root packages by using the `root_packages` property.

filter_packages.py:

```python
from packagediscovery import Packages, Setuptools

setuptools = Setuptools()
print(f"Packages = {setuptools.packages}")
print(f"Root packages = {Packages(setuptools.packages).list_roots_only}")
```

```bash
$ python filter_packages.py
Packages = ['pyvelocity', 'pyvelocity.checks', 'pyvelocity.configurations', 'pyvelocity.configurations.files', 'pyvelocity.configurations.files.sections', 'pyvelocity.configurations.files.sections.pylint', 'pyvelocity.configurations.tools', 'pyvelocity.configurations.files.sections.pylint', 'pyvelocity.configurations.files.sections', 'pyvelocity.configurations.files', 'pyvelocity.checks', 'pyvelocity.configurations.tools', 'pyvelocity.configurations']
Root packages = ['pyvelocity']
```

## Quickstart

Install the package

```bash
$ pip install packagediscovery
```

<!-- markdownlint-disable no-trailing-punctuation -->
## How do I...
<!-- markdownlint-enable no-trailing-punctuation -->

### Discover packages

```python
from packagediscovery import Setuptools

setuptools = Setuptools()
print(f"Packages = {setuptools.packages}")
```

### Discover py modules

```python
from packagediscovery import Setuptools

setuptools = Setuptools()
print(f"Py modules = {setuptools.py_modules}")
```

### Discover project root

```python
from packagediscovery import Setuptools

setuptools = Setuptools()
print(f"Project root = {setuptools.project_root}")
```

### Filter packages to root packages only

```python
from packagediscovery import Setuptools

setuptools = Setuptools()
print(f"Packages = {setuptools.packages}")
print(f"Root packages = {Packages(setuptools.packages).list_roots_only}")
```

## Credits

This package was created with [Cookiecutter] and the [yukihiko-shinoda/cookiecutter-pypackage] project template.

[Cookiecutter]: https://github.com/audreyr/cookiecutter
[yukihiko-shinoda/cookiecutter-pypackage]: https://github.com/audreyr/cookiecutter-pypackage
[Package Discovery and Namespace Packages - setuptools documentation]: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "packagediscovery",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Yukihiko Shinoda <yuk.hik.future@gmail.com>",
    "keywords": "setuptools, package, discovery",
    "author": null,
    "author_email": "Yukihiko Shinoda <yuk.hik.future@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/62/14/9406f2d96299bd2540755977cf1ade8d7e8071f0f911a2b0ac9f4f89f87d/packagediscovery-0.2.0.tar.gz",
    "platform": null,
    "description": "# Package Discovery\n\n[![Test](https://github.com/yukihiko-shinoda/package-discovery/workflows/Test/badge.svg)](https://github.com/yukihiko-shinoda/package-discovery/actions?query=workflow%3ATest)\n[![CodeQL](https://github.com/yukihiko-shinoda/package-discovery/workflows/CodeQL/badge.svg)](https://github.com/yukihiko-shinoda/package-discovery/actions?query=workflow%3ACodeQL)\n[![Code Coverage](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery/coverage.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery)\n[![Maintainability](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery/maintainability.svg)](https://qlty.sh/gh/yukihiko-shinoda/projects/package-discovery)\n[![Dependabot](https://flat.badgen.net/github/dependabot/yukihiko-shinoda/package-discovery?icon=dependabot)](https://github.com/yukihiko-shinoda/package-discovery/security/dependabot)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/packagediscovery)](https://pypi.org/project/packagediscovery)\n[![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fyukihiko-shinoda%2Fpackage-discovery)](http://twitter.com/share?text=Package%20Discovery&url=https://pypi.org/project/packagediscovery/&hashtags=python)\n\nPackage discovery based on Setuptools.\n\n## Advantage\n\n1. Debug packages that Setuptools discovered\n2. Easy to filter packages to root packages only\n\n### 1. Debug packages that Setuptools discovered\n\nYou can check the discovered packages by running the following Python code.\n\nprint_packages.py:\n\n```python\nfrom packagediscovery import Setuptools\n\nprint(Setuptools().packages)\n```\n\n```bash\n$ python print_packages.py\n['packagediscovery']\n```\n\nSince Package Discovery settings of Setuptools is a bit complicated so that we may want to know what packages Setuptools are discovering now.\n\ncf. [Package Discovery and Namespace Packages - setuptools documentation]\n\n### 2. Easy to filter packages to root packages only\n\nYou can filter the discovered packages to only include root packages by using the `root_packages` property.\n\nfilter_packages.py:\n\n```python\nfrom packagediscovery import Packages, Setuptools\n\nsetuptools = Setuptools()\nprint(f\"Packages = {setuptools.packages}\")\nprint(f\"Root packages = {Packages(setuptools.packages).list_roots_only}\")\n```\n\n```bash\n$ python filter_packages.py\nPackages = ['pyvelocity', 'pyvelocity.checks', 'pyvelocity.configurations', 'pyvelocity.configurations.files', 'pyvelocity.configurations.files.sections', 'pyvelocity.configurations.files.sections.pylint', 'pyvelocity.configurations.tools', 'pyvelocity.configurations.files.sections.pylint', 'pyvelocity.configurations.files.sections', 'pyvelocity.configurations.files', 'pyvelocity.checks', 'pyvelocity.configurations.tools', 'pyvelocity.configurations']\nRoot packages = ['pyvelocity']\n```\n\n## Quickstart\n\nInstall the package\n\n```bash\n$ pip install packagediscovery\n```\n\n<!-- markdownlint-disable no-trailing-punctuation -->\n## How do I...\n<!-- markdownlint-enable no-trailing-punctuation -->\n\n### Discover packages\n\n```python\nfrom packagediscovery import Setuptools\n\nsetuptools = Setuptools()\nprint(f\"Packages = {setuptools.packages}\")\n```\n\n### Discover py modules\n\n```python\nfrom packagediscovery import Setuptools\n\nsetuptools = Setuptools()\nprint(f\"Py modules = {setuptools.py_modules}\")\n```\n\n### Discover project root\n\n```python\nfrom packagediscovery import Setuptools\n\nsetuptools = Setuptools()\nprint(f\"Project root = {setuptools.project_root}\")\n```\n\n### Filter packages to root packages only\n\n```python\nfrom packagediscovery import Setuptools\n\nsetuptools = Setuptools()\nprint(f\"Packages = {setuptools.packages}\")\nprint(f\"Root packages = {Packages(setuptools.packages).list_roots_only}\")\n```\n\n## Credits\n\nThis package was created with [Cookiecutter] and the [yukihiko-shinoda/cookiecutter-pypackage] project template.\n\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\n[yukihiko-shinoda/cookiecutter-pypackage]: https://github.com/audreyr/cookiecutter-pypackage\n[Package Discovery and Namespace Packages - setuptools documentation]: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Yukihiko Shinoda\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Package discovery based on Setuptools.",
    "version": "0.2.0",
    "project_urls": {
        "homepage": "https://github.com/yukihiko-shinoda/package-discovery",
        "repository": "https://github.com/yukihiko-shinoda/package-discovery"
    },
    "split_keywords": [
        "setuptools",
        " package",
        " discovery"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ef772d015bc6c8df50b37ee5df6236d17d57ea4f4f4c3e2b6ae0c46751014989",
                "md5": "abfa6778f14f248bc11e6447ee1fae93",
                "sha256": "012ab032a936314862bf94dce49fffcbea3fd2ffb47192e7e5084598cdf71c10"
            },
            "downloads": -1,
            "filename": "packagediscovery-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "abfa6778f14f248bc11e6447ee1fae93",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6187,
            "upload_time": "2025-09-01T07:58:59",
            "upload_time_iso_8601": "2025-09-01T07:58:59.782903Z",
            "url": "https://files.pythonhosted.org/packages/ef/77/2d015bc6c8df50b37ee5df6236d17d57ea4f4f4c3e2b6ae0c46751014989/packagediscovery-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "62149406f2d96299bd2540755977cf1ade8d7e8071f0f911a2b0ac9f4f89f87d",
                "md5": "e3f1fbcb274c5d70ec32fe2a935cb4b6",
                "sha256": "e386efd44b7899d373857004eacc5a5c0f6b2da3884e8ce21bd733f51d093b00"
            },
            "downloads": -1,
            "filename": "packagediscovery-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e3f1fbcb274c5d70ec32fe2a935cb4b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11098,
            "upload_time": "2025-09-01T07:59:00",
            "upload_time_iso_8601": "2025-09-01T07:59:00.660880Z",
            "url": "https://files.pythonhosted.org/packages/62/14/9406f2d96299bd2540755977cf1ade8d7e8071f0f911a2b0ac9f4f89f87d/packagediscovery-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-01 07:59:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yukihiko-shinoda",
    "github_project": "package-discovery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "packagediscovery"
}
        
Elapsed time: 1.90360s