Skip to main content

yp

A mapping view to pypi projects

To install: pip install yp

See also: pipoke, for more pypi interaction tools.

Example Usage

Get a mapping of all of pypi projects.

>>> from yp import Pypi
>>> p = Pypi()

The keys of this mapping are the project names. There are lots!

>>> len(p)  # doctest: +SKIP
405120
>>> 'numpy' in p and 'dol' in p
True
>>> 'no_way_this_is_a_package' in p
False

The values of the mapping are the corresponding project's info, which is a nested dict of good stuff.

>>> info = p['numpy']
>>> list(info)
['info', 'last_serial', 'releases', 'urls', 'vulnerabilities']

Tip: To only get the info you want, you'll

The project info is obtained, live, making requests to the https://pypi.python.org/pypi/{pkg_name}/json API, but the list of all project names is actually taken from a local file. You should update that file regularly (but not TOO regularly!) to be in sync with pypi.org. To do so, do this:

>>> Pypi.refresh_cached_package_names()  # doctest: +SKIP

If, on the other hand, you don't want all projects of Pypi to be the collection you're working with, you can specify what user they should belong to:

>>> p = Pypi(user='thorwhalen1')
>>> len(p)  # doctest: +SKIP
131

You can also explicitly give Pypi a collection of projects you want to work with:

>>> p = Pypi(proj_names={'numpy', 'pandas', 'dol'})
>>> len(p)
3

You can do a lot more by simply using the tools of dol to change the mapping you want to work with in all kinds of ways!

Extras

yp ships a cached list of every PyPI project name (yp/data/pkg_list.tsv.gz), so name lookups are instant and offline. The cache is loaded lazily -- the first lookup pays for it, import yp does not.

yp.refresh_saved_pkg_name_stub() fetches the current list and saves it to your app folder, which then takes precedence over the copy shipped with the package. (It writes there rather than into the installed package, which is read-only in many installs.) Pass save_to= to write elsewhere.

I also refresh the shipped copy from time to time and push the results. You can find the list (as a text file with one name per line) here: https://raw.githubusercontent.com/thorwhalen/yp/refs/heads/master/yp/data/pkg_list.txt

Skills

yp ships AI agent skills (SKILL.md files) that teach an agent how to drive its tools. They live in yp/data/skills/ (so they install with the package) and are mirrored into .claude/skills/ for Claude Code.

Skill What it helps you do
yp-name-availability Find an available PyPI name for a new package: brainstorm → fast cached pre-filter → authoritative live check → present the free options.
yp-name-cache Operate the cached PyPI name index: refresh it, check names fast/offline, understand freshness & normalization caveats.
yp-package-info Fetch live PyPI info: full project JSON, a tidy digest, latest version(s), last-upload time, a user's projects, bulk download.
yp-dependencies Inspect an installed package's dependency tree (direct/transitive, required vs installed, version conflicts).

Install one into an agent host with gh skill:

gh skill install thorwhalen/yp yp-name-availability

Metadata

Release files for yp 0.0.14

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

Source distribution (sdist)

Source distribution for yp 0.0.14
File Size Uploaded Provenance Actions
yp-0.0.14.tar.gz 4.0 MB Without provenance Details for yp-0.0.14.tar.gz

Built distribution (wheel)

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

Total release size: 8.1 MB

Release files / yp-0.0.14.tar.gz

Download URL yp-0.0.14.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b4098d34b2e53e3b5569a29520c59c9d15d7dfc07e33e9a849e4c75e8636cc0e
BLAKE2b-256 checksum
How to use checksums
65b80ee4eed5f296619b1ae4f88b1046ec9dd23485515cef5ab6be4c10b7fb2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / yp-0.0.14-py3-none-any.whl

Download URL yp-0.0.14-py3-none-any.whl
Size 4.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c870afa115a97e669c12163bf01023ac9e94f0f8091cf02135490cfbf962c6e0
BLAKE2b-256 checksum
How to use checksums
c6947a1c7e79191d2b8684108ca11bb7a4fabbabeae432e649160a7876bf2380
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for yp 0.0.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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