Skip to main content

PEP 610 Direct URL data parser

Project description

pep610

PyPI - Version PyPI - Python Version PyPI - Downloads codecov Documentation Status

A Python library for parsing the Direct URL Origin structure from installed packages.

PEP 610 initially specified how the Direct URL Origin of installed distributions should be recorded, but the up-to-date, canonical specification is maintained on the PyPA specs page.


Table of Contents

Installation

pip install pep610

Usage

You can use pep610.read_from_distribution to parse the Direct URL Origin structure from a Distribution object:

from importlib import metadata

import pep610

dist = metadata.distribution("pep610")

if (
    (data := pep610.read_from_distribution(dist))
    and isinstance(data, pep610.DirData)
    and data.dir_info.is_editable()
):
    print("Editable installation, a.k.a. in development mode")
else:
    print("Not an editable installation")

Or, in Python 3.10+ using pattern matching:

from importlib import metadata

import pep610

dist = metadata.distribution("pep610")

match data := pep610.read_from_distribution(dist):
    case pep610.DirData(url, pep610.DirInfo(editable=True)):
        print("Editable installation, a.k.a. in development mode")
    case _:
        print("Not an editable installation")

Development

This project uses Tox.

Run all checks with:

tox run-parallel

License

pep610 is distributed under the terms of the Apache License 2.0.

Project details


Download files

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

Source Distribution

pep610-0.5.0.post2.tar.gz (105.8 kB view details)

Uploaded Source

Built Distribution

pep610-0.5.0.post2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pep610-0.5.0.post2.tar.gz.

File metadata

  • Download URL: pep610-0.5.0.post2.tar.gz
  • Upload date:
  • Size: 105.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pep610-0.5.0.post2.tar.gz
Algorithm Hash digest
SHA256 8f41145378e136cb3eb3ca7ca88619851bcd8e505bf7e543ec6db2c42896d9e2
MD5 987c8cd0729d91263f0bcb5280319eff
BLAKE2b-256 c4c7ead488488ff03bcd9600b163c68d113953c44ea24b53e05dc7aace57c76c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep610-0.5.0.post2.tar.gz:

Publisher: release.yaml on edgarrmondragon/pep610

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pep610-0.5.0.post2-py3-none-any.whl.

File metadata

  • Download URL: pep610-0.5.0.post2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pep610-0.5.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fa1f5c29f4ec63e218452adfbee261365bdea6901dd972edfd4c98ce86d221b
MD5 3b1a5ed2320f7e8b9df1629dc17c9870
BLAKE2b-256 0b425c388fd0a4c324929f38ec54035f46fc09ab4a39b794433a7f3d529fb1ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep610-0.5.0.post2-py3-none-any.whl:

Publisher: release.yaml on edgarrmondragon/pep610

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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