summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMatthias Klose <doko@debian.org>2023-06-12 09:40:57 +0200
committergit-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com>2023-06-12 16:59:56 +0000
commit78f61aa4bc22e16591e6243459e49cedeb165ea6 (patch)
tree9df634ed594e142187d39459e2d9cd8c083855c7 /docs
parent3bc3c139c4a2eb34614168bd1446e7521ecfe006 (diff)
Imported using git-ubuntu import.
Notes
Notes: * New upstream version. * Bump standards version.
Diffstat (limited to 'docs')
-rw-r--r--docs/index.rst1
-rw-r--r--docs/metadata.rst42
2 files changed, 43 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst
index aafdae8..6850e9e 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -25,6 +25,7 @@ You can install packaging with ``pip``:
specifiers
markers
requirements
+ metadata
tags
utils
diff --git a/docs/metadata.rst b/docs/metadata.rst
new file mode 100644
index 0000000..b87574c
--- /dev/null
+++ b/docs/metadata.rst
@@ -0,0 +1,42 @@
+Metadata
+========
+
+.. currentmodule:: packaging.markers
+
+
+Both `source distributions`_ and `binary distributions`
+(_sdists_ and _wheels_, respectively) contain files recording the
+`core metadata`_ for the distribution. This information is used for
+everything from recording the name of the distribution to the
+installation dependencies.
+
+
+Usage
+-----
+
+.. doctest::
+
+ >>> from packaging.metadata import parse_email
+ >>> metadata = "Metadata-Version: 2.3\nName: packaging\nVersion: 24.0"
+ >>> raw, unparsed = parse_email(metadata)
+ >>> raw["metadata_version"]
+ '2.3'
+ >>> raw["name"]
+ 'packaging'
+ >>> raw["version"]
+ '24.0'
+
+
+Reference
+---------
+
+Low Level Interface
+'''''''''''''''''''
+
+.. automodule:: packaging.metadata
+ :members:
+
+
+.. _source distributions: https://packaging.python.org/en/latest/specifications/source-distribution-format/
+.. _binary distributions: https://packaging.python.org/en/latest/specifications/binary-distribution-format/
+.. _core metadata: https://packaging.python.org/en/latest/specifications/core-metadata/