- Support Python 3.13
SUPPORTED_REPOSITORY_VERSION
increased to"1.3"
for compatibility with PEP 740
- Drop support for Python 3.7
- Support PEP 740
provenance_sha256
andprovenance_url
fields added toDistributionPackage
get_provenance()
method added toPyPISimple
NoProvenanceError
exception type added
- Add
url
fields to theDigestMismatchError
,NoDigestsError
, andNoMetadataError
classes
- Bugfix: Fix parsing of "true"
data-core-metadata
attributes and handling of the attribute's absence (contributed by @thatch)DistributionPackage.has_metadata
will now beNone
if this attribute was absent in the HTML returned by PyPI. Previously, it would beFalse
under this circumstance.
- Added
PyPISimple.get_package_metadata_bytes()
(contributed by @thatch) PyPISimple.get_package_metadata()
now always decodes responses as UTF-8 (contributed by @thatch)- Request methods now take optional
headers
arguments (contributed by @thatch)
- Migrated from setuptools to hatch
- Bugfix: When no
accept
argument is passed toPyPISimple.get_project_page()
, actually fall back to the value supplied on client instantiation, as documented (contributed by @thatch)
- Support PEP 708
tracks
andalternate_locations
attributes added toProjectPage
pypi_meta
,tracks
, andalternate_locations
attributes added toRepositoryPage
SUPPORTED_REPOSITORY_VERSION
increased to"1.2"
- Support Python 3.12
- Update for PEP 714
- Gave
PyPISimple
aget_package_metadata()
method - Added an examples page to the documentation
- Update pydantic to v2.0
- Support PEP 700
versions
field added toProjectPage
size
andupload_time
fields added toDistributionPackage
SUPPORTED_REPOSITORY_VERSION
increased to"1.1"
- Removed deprecated functionality:
DistributionPackage.get_digests()
PyPISimple.get_projects()
PyPISimple.get_project_files()
parse_simple_index()
parse_project_page()
parse_links()
- Drop support for Python 3.6
- Support Python 3.11
IndexPage
,ProjectPage
,DistributionPackage
, andLink
have been changed from NamedTuples to dataclasses- Replaced
DistributionPackage.yanked
with separateis_yanked
andyanked_reason
attributes parse_filename()
now raises anUnparsableFilenameError
on unparsable filenames instead of returning a triple ofNone
sPyPISimple.get_project_page()
now raises aNoSuchProjectError
on 404 responses instead of returningNone
- The functions for parsing data into
IndexPage
andProjectPage
instances have been replaced with classmethods:parse_repo_index_page()
→IndexPage.from_html()
parse_repo_index_json()
→IndexPage.from_json_data()
parse_repo_index_response()
→IndexPage.from_response()
parse_repo_links()
→RepositoryPage.from_html()
parse_repo_project_page()
→ProjectPage.from_html()
parse_repo_project_json()
→ProjectPage.from_json_data()
parse_repo_project_response()
→ProjectPage.from_response()
- Add a
RepositoryPage
class for representing the return value ofparse_repo_links()
(now calledRepositoryPage.from_html()
) - Renamed
DistributionPackage.from_pep691_details()
tofrom_json_data()
PyPISimple.stream_project_names()
now accepts JSON responses- Use pydantic internally to parse JSON responses
- Added constants for passing to
PyPISimple
and its methods in order to specify theAccept
header to send
- Support Python 3.10
- Support PEP 691
- Send "Accept" headers in requests (except for
stream_project_names()
) listing both the new JSON format and the old HTML format parse_repo_project_response()
andparse_repo_index_response()
now support both the JSON and HTML formats- Add
parse_repo_index_json()
andparse_repo_project_json()
functions - Gave
DistributionPackage
afrom_pep691_details()
classmethod DistributionPackage.has_metadata
will now beNone
if not specified by a JSON responseDistributionPackage.metadata_url
is now always non-None
- Send "Accept" headers in requests (except for
- Gave
DistributionPackage
adigests
attribute- The
get_digests()
method ofDistributionPackage
is now deprecated; usedigests
instead - Digest fragments are now removed from
DistributionPackage.url
when parsing HTML responses
- The
- Warn on encountering a repository version with a greater minor version than expected
- Gave
PyPISimple
adownload_package()
method
- Support PEP 658 by adding
has_metadata
,metadata_url
, andmetadata_digests
attributes toDistributionPackage
- Support Python 3.9
PyPISimple
is now usable as a context manager that will close the session on exit
- Drop support for Python 2.7, Python 3.4, and Python 3.5
DistributionPackage.has_sig
is nowNone
if the package repository does not report this information- Added type annotations
- Moved documentation from README file to a Read the Docs site
- Added new methods to
PyPISimple
:get_index_page()
— Returns anIndexPage
instance with aprojects: List[str]
attribute plus other attributes for repository metadataget_project_page()
— Returns aProjectPage
instance with apackages: List[DistributionPackage]
attribute plus other attributes for repository metadatastream_project_names()
— Retrieves project names from a repository using a streaming request
- New utility functions:
parse_repo_links()
— Parses an HTML page and returns a pair of repository metadata and a list ofLink
objectsparse_repo_project_page()
— Parses a project page and returns aProjectPage
instanceparse_repo_project_response()
— Parses arequests.Response
object containing a project page and returns aProjectPage
instanceparse_links_stream()
— Parses an HTML page as stream ofbytes
orstr
and returns a generator ofLink
objectsparse_links_stream_response()
— Parses a streamingrequests.Response
object containing an HTML page and returns a generator ofLink
objectsparse_repo_index_page()
— Parses a simple repository index/root page and returns anIndexPage
instanceparse_repo_index_response()
— Parses arequests.Response
object containing an index page and returns anIndexPage
instance
- The following functions & methods are now deprecated and will be removed in a
future version:
PyPISimple.get_projects()
PyPISimple.get_project_files()
parse_simple_index()
parse_project_page()
parse_links()
- Support Warehouse's
X-PyPI-Last-Serial
header by attaching the value to the objects returned byget_index_page()
andget_project_page()
- Support PEP 629 by attaching the repository version to the objects returned
by
get_index_page()
andget_project_page()
and by raising anUnsupportedRepoVersionError
when a repository with an unsupported version is encountered
- Support Python 3.8
DistributionPackage.sig_url
is now always non-None
, as Warehouse does not report proper values forhas_sig
- The
PyPISimple
constructor now takes an optionalsession
argument which can be used to specify arequests.Session
object with more complicated configuration than just authentication - Support for PEP 592;
DistributionPackage
now has ayanked
attribute
- Publicly (i.e., in the README) document the utility functions
- Gave
PyPISimple
anauth
parameter for specifying login/authentication details
- When fetching the list of files for a project, the project name is now used to resolve ambiguous filenames.
- The filename parser now requires all filenames to be all-ASCII (except for wheels).
- The filename parser now rejects invalid project names, blatantly invalid versions, and non-ASCII digits.
- RPM packages are now recognized.
Initial release