summaryrefslogtreecommitdiffstats
path: root/docs/api
diff options
context:
space:
mode:
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/__init__.md9
-rw-r--r--docs/api/destinations.md16
-rw-r--r--docs/api/records.md51
-rw-r--r--docs/api/scripts.md19
-rw-r--r--docs/api/sources.md10
-rw-r--r--docs/api/utils.md10
6 files changed, 115 insertions, 0 deletions
diff --git a/docs/api/__init__.md b/docs/api/__init__.md
new file mode 100644
index 0000000..8a74ad3
--- /dev/null
+++ b/docs/api/__init__.md
@@ -0,0 +1,9 @@
+```{caution}
+This API is not finalised, and may change in a patch version.
+```
+
+# `installer`
+
+```{eval-rst}
+.. autofunction:: installer.install
+```
diff --git a/docs/api/destinations.md b/docs/api/destinations.md
new file mode 100644
index 0000000..780392d
--- /dev/null
+++ b/docs/api/destinations.md
@@ -0,0 +1,16 @@
+```{caution}
+This API is not finalised, and may change in a patch version.
+```
+
+# `installer.destinations`
+
+```{eval-rst}
+.. automodule:: installer.destinations
+
+.. autoclass:: installer.destinations.WheelDestination
+ :members:
+
+.. autoclass:: installer.destinations.SchemeDictionaryDestination()
+ :members:
+ :special-members: __init__
+```
diff --git a/docs/api/records.md b/docs/api/records.md
new file mode 100644
index 0000000..b0201fd
--- /dev/null
+++ b/docs/api/records.md
@@ -0,0 +1,51 @@
+```{caution}
+This API is not finalised, and may change in a patch version.
+```
+
+# `installer.records`
+
+```{eval-rst}
+.. automodule:: installer.records
+```
+
+## Example
+
+```{doctest} pycon
+>>> from installer.records import parse_record_file, RecordEntry
+>>> lines = [
+... "file.py,sha256=AVTFPZpEKzuHr7OvQZmhaU3LvwKz06AJw8mT\\_pNh2yI,3144",
+... "distribution-1.0.dist-info/RECORD,,",
+... ]
+>>> records = parse_record_file(lines)
+>>> li = list(records)
+>>> len(li)
+2
+>>> record_tuple = li[0]
+>>> record_tuple
+('file.py', 'sha256=AVTFPZpEKzuHr7OvQZmhaU3LvwKz06AJw8mT\\_pNh2yI', '3144')
+>>> record = RecordEntry.from_elements(*record_tuple)
+>>> record
+RecordEntry(path='file.py', hash_=Hash(name='sha256', value='AVTFPZpEKzuHr7OvQZmhaU3LvwKz06AJw8mT\\_pNh2yI'), size=3144)
+>>> record.path
+'file.py'
+>>> record.hash_
+Hash(name='sha256', value='AVTFPZpEKzuHr7OvQZmhaU3LvwKz06AJw8mT\\_pNh2yI')
+>>> record.size
+3144
+>>> record.validate(b"...")
+False
+```
+
+## Reference
+
+```{eval-rst}
+.. autofunction:: installer.records.parse_record_file
+
+.. autoclass:: installer.records.RecordEntry()
+ :special-members: __init__
+ :members:
+
+.. autoclass:: installer.records.Hash()
+ :special-members: __init__
+ :members:
+```
diff --git a/docs/api/scripts.md b/docs/api/scripts.md
new file mode 100644
index 0000000..470d13e
--- /dev/null
+++ b/docs/api/scripts.md
@@ -0,0 +1,19 @@
+```{caution}
+This API is not finalised, and may change in a patch version.
+```
+
+# `installer.scripts`
+
+Provides the ability to generate executable launcher scripts, that are based on
+[`simple_launcher`]. A description of how these scripts work is available in
+simple_launcher's README.
+
+[`simple_launcher`]: https://bitbucket.org/vinay.sajip/simple_launcher/
+
+```{eval-rst}
+.. autoclass:: installer.scripts.InvalidScript()
+
+.. autoclass:: installer.scripts.Script()
+ :special-members: __init__
+ :members:
+```
diff --git a/docs/api/sources.md b/docs/api/sources.md
new file mode 100644
index 0000000..7ee8306
--- /dev/null
+++ b/docs/api/sources.md
@@ -0,0 +1,10 @@
+```{caution}
+This API is not finalised, and may change in a patch version.
+```
+
+# `installer.sources`
+
+```{eval-rst}
+.. automodule:: installer.sources
+ :members:
+```
diff --git a/docs/api/utils.md b/docs/api/utils.md
new file mode 100644
index 0000000..53a4c10
--- /dev/null
+++ b/docs/api/utils.md
@@ -0,0 +1,10 @@
+```{caution}
+This API is not finalised, and may change in a patch version.
+```
+
+# `installer.utils`
+
+```{eval-rst}
+.. automodule:: installer.utils
+ :members:
+```