Skip to main content

pygetimportables

Documentation Status Code style: ruff-format PyPI

Python functions to get top-level importable names from a source tree or an already built wheel.

See https://discuss.python.org/t/script-to-get-top-level-packages-from-source-tree/40232?u=astrojuanlu

Installation

To install, run

(.venv) $ pip install pygetimportables

Usage

To get the top-level importable names directly from a source tree:

>>> from pygetimportables import get_top_importables
>>> get_top_importables(".")  # Wait a few seconds, requires working `uv pip install`
{'pygetimportables'}

To get the top-level importable names from an already built wheel:

(.venv) $ python -m build --installer uv
...
(.venv) $ python -q
>>> from pygetimportables import get_top_importables_from_wheel
>>> get_top_importables_from_wheel("dist/pygetimportables-0.1.0+d20231204-py3-none-any.whl")  # Fast
{'pygetimportables'}

Development

To run style checks:

(.venv) $ pip install pre-commit
(.venv) $ pre-commit -a

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygetimportables-0.3.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygetimportables-0.3.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pygetimportables-0.3.0.tar.gz.

File metadata

  • Download URL: pygetimportables-0.3.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pygetimportables-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1cd28d18ad37a3be7fdd65db67097d59ae56ad66dd93f8b2fc533bb2e70eab6a
MD5 954d8f6c40a2b0db892be4ea964ddc2d
BLAKE2b-256 c2d95a0d6f2f28b25ff0337b39df3b2198b0487ef31338e4a607f64b40cf189f

See more details on using hashes here.

File details

Details for the file pygetimportables-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pygetimportables-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e12468b0d3c8599550c2923aa44a249c671d2488f3c6ed0b3dc1933b2b82424a
MD5 dedf3dc96917d0cb0749093093f8f696
BLAKE2b-256 49d3408ec9840abe977d0a1f001d2bf6910b4a78ce790ec2943cd1b9b340b76e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.1

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page