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.6.0.tar.gz (21.7 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.6.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pep610-0.6.0.tar.gz
Algorithm Hash digest
SHA256 915eed71f7354b66844282df8c628853f3a9eb20e67c316e6359dd39c6bbea64
MD5 b0a0eff89e6d1b0e509d81b445d1b4ac
BLAKE2b-256 1332393d7dd83da4b2c41af4a9d3b7fa2c5b26a64319b6bbad7a84ac9e780d62

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pep610-0.6.0-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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d04720cfdfd7a3779519d433ef27fba40a5cf717a6e7cb62f4c5ba3666c5cb6
MD5 4be93b3a2c454d2e90e5d81e147bd488
BLAKE2b-256 d2c165fa0353256432c44f77647f7ac31ffbb83bf3174de66f1dc226f47c301a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep610-0.6.0-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