PEP 610 Direct URL data parser
Project description
pep610
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8f41145378e136cb3eb3ca7ca88619851bcd8e505bf7e543ec6db2c42896d9e2
|
|
MD5 |
987c8cd0729d91263f0bcb5280319eff
|
|
BLAKE2b-256 |
c4c7ead488488ff03bcd9600b163c68d113953c44ea24b53e05dc7aace57c76c
|
Provenance
The following attestation bundles were made for pep610-0.5.0.post2.tar.gz
:
Publisher:
release.yaml
on edgarrmondragon/pep610
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pep610-0.5.0.post2.tar.gz
-
Subject digest:
8f41145378e136cb3eb3ca7ca88619851bcd8e505bf7e543ec6db2c42896d9e2
- Sigstore transparency entry: 191365338
- Sigstore integration time:
-
Permalink:
edgarrmondragon/pep610@8d16517286d2064d1d8cb10ad48e79ea4aa3df5c
-
Branch / Tag:
refs/tags/v0.5.0.post2
- Owner: https://github.com/edgarrmondragon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
release.yaml@8d16517286d2064d1d8cb10ad48e79ea4aa3df5c
-
Trigger Event:
push
-
Statement type:
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5fa1f5c29f4ec63e218452adfbee261365bdea6901dd972edfd4c98ce86d221b
|
|
MD5 |
3b1a5ed2320f7e8b9df1629dc17c9870
|
|
BLAKE2b-256 |
0b425c388fd0a4c324929f38ec54035f46fc09ab4a39b794433a7f3d529fb1ea
|
Provenance
The following attestation bundles were made for pep610-0.5.0.post2-py3-none-any.whl
:
Publisher:
release.yaml
on edgarrmondragon/pep610
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pep610-0.5.0.post2-py3-none-any.whl
-
Subject digest:
5fa1f5c29f4ec63e218452adfbee261365bdea6901dd972edfd4c98ce86d221b
- Sigstore transparency entry: 191365340
- Sigstore integration time:
-
Permalink:
edgarrmondragon/pep610@8d16517286d2064d1d8cb10ad48e79ea4aa3df5c
-
Branch / Tag:
refs/tags/v0.5.0.post2
- Owner: https://github.com/edgarrmondragon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
release.yaml@8d16517286d2064d1d8cb10ad48e79ea4aa3df5c
-
Trigger Event:
push
-
Statement type: