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

Metadata

Release files for pygetimportables 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygetimportables 0.3.0
File Size Uploaded
pygetimportables-0.3.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygetimportables 0.3.0
File Interpreter ABI Platform
pygetimportables-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / pygetimportables-0.3.0.tar.gz

Download URL pygetimportables-0.3.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1cd28d18ad37a3be7fdd65db67097d59ae56ad66dd93f8b2fc533bb2e70eab6a
BLAKE2b-256 checksum
How to use checksums
c2d95a0d6f2f28b25ff0337b39df3b2198b0487ef31338e4a607f64b40cf189f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pygetimportables-0.3.0-py3-none-any.whl

Download URL pygetimportables-0.3.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e12468b0d3c8599550c2923aa44a249c671d2488f3c6ed0b3dc1933b2b82424a
BLAKE2b-256 checksum
How to use checksums
49d3408ec9840abe977d0a1f001d2bf6910b4a78ce790ec2943cd1b9b340b76e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page