unearth
A utility to fetch and download python packages
What it is and what it does
Unearth is a library for finding and downloading Python packages from package indexes. It extracts and stabilizes the core package-finding logic, offering a documented, versioned API that downstream projects can rely on. It works alongside other low-level package-management tools to form a complete package-management toolkit.
You use it either as a Python library—instantiating a PackageFinder with index URLs and calling find_best_match() to locate a package that satisfies a requirement—or via its CLI to query indexes and inspect matching distributions. It returns structured metadata about candidates, including version, download URL, Python version requirements, and metadata links.
Use it for:
- Build a custom package manager or installer that needs stable package discovery without relying on pip's internal APIs.
- Query a private or custom PyPI-compatible index to find the best match for a requirement in an automated workflow.
- Inspect available versions and metadata for a package before deciding which to download.
- Integrate package finding into a tool that needs to locate distributions independently.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Finds and downloads Python packages from package indexes by matching requirements, providing a stable library API for package discovery.
Yes. Unearth is actively maintained, has no known vulnerabilities, low install friction, and fills a genuine gap by providing a stable, versioned API for package discovery. It is well-suited for anyone building package-management tools or workflows that need reliable access to package indexes.
Install
unearth on PyPI
pip
pip install unearthuv
uv add unearthpoetry
poetry add unearthInstalling unearth
Before you install
Active maintenance with a recent release and low install friction—only two runtime dependencies (packaging and httpx). Supports Python 3.9 onward.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for integration into other tools.
Quickstart
from unearth import PackageFinder
finder = PackageFinder(index_urls=["https://pypi.org/simple/"])
result = finder.find_best_match("flask>=2")
print(result.best)
Requires Python >=3.9
Verify before relying
- Whether the package finder respects all PyPI-compatible index formats and authentication schemes beyond basic HTTP.
- Performance characteristics when querying large indexes or handling thousands of package candidates.
- Stability guarantees and backward-compatibility policy beyond semantic versioning claims in the description.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — packaging, httpx |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,913,763/month — #1,353 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: unearth-0.18.3-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
pip-apiProvides an importable Python API that wraps…
permissive · top 1,000 on PyPI
pypi-simpleA client library for querying PyPI and…
permissive · top 15,000 on PyPI
resolvelibResolveLib provides a generic dependency…
permissive · top 1,000 on PyPI
installerA low-level library for unpacking and…
permissive · top 1,000 on PyPI
feufeu checks package availability, resolves…
permissive · top 5,000 on PyPI
pbs-installerDownloads and installs python-build-standalone…
permissive · top 1,000 on PyPI
findpythonLocates Python interpreters on your system by…
permissive · top 1,000 on PyPI
pyprojrootFinds your project's root directory and…
permissive · top 15,000 on PyPI
ensurecondaA CLI tool that finds or installs a conda/mamba…
permissive · top 15,000 on PyPI
pyrootutilsFinds your project root directory and…
permissive · top 5,000 on PyPI