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.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

pep610-0.5.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pep610-0.5.1.tar.gz.

File metadata

  • Download URL: pep610-0.5.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pep610-0.5.1.tar.gz
Algorithm Hash digest
SHA256 843082d0526a1696d83ea25052bd70602d7d2c9226da29eed5df1c553819516e
MD5 250ccbd342d6744aceb5f943bea99434
BLAKE2b-256 e58408b3f8e5a52dfd1917c90bf0eda9a26501d894b67bbbecf06c5aa3674ad1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep610-0.5.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pep610-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e92b47df8f2b7fb7f697172ae90b38e81d3decfeea99bb40767fbfabb69cfd57
MD5 ea580aa2cfe48a30a3d43efd87da5ba7
BLAKE2b-256 bdfcec46de6a5e69b1b49a2a7805b8540b8efcbd26b2a1614738850ab8126111

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep610-0.5.1-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page