You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,37 @@ The library can be imported in the usual manner:
37
37
import pratts
38
38
from pratts import pratts
39
39
40
+
Examples
41
+
^^^^^^^^
42
+
To generate a `Pratt certificate <https://en.wikipedia.org/wiki/Primality_certificate#Pratt_certificates>`__ for a prime number, it is sufficient to supply an iterable of appropriately chosen primes that make it possible to recursively construct the certificate:
Alternatively, a function that returns prime factors can be supplied (such as the |primefactors|_ function that is available in the `SymPy library <https://www.sympy.org/>`__):
54
+
55
+
.. code-block:: python
56
+
57
+
>>>from sympy import primefactors
58
+
>>> pratts(241, primefactors)
59
+
{2: [], 3: [2], 5: [2], 241: [2, 3, 5]}
60
+
61
+
A certificate can be verified by supplying its keys (such that the same certificate is generated and returned):
All installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements <https://peps.python.org/pep-0621>`__ for various development tasks. This makes it possible to specify additional options (such as ``docs``, ``lint``, and so on) when performing installation using `pip <https://pypi.org/project/pip>`__:
@@ -87,7 +118,7 @@ The version number format for this library and the changes to the library associ
87
118
88
119
Publishing
89
120
^^^^^^^^^^
90
-
This library can be published as a `package on PyPI <https://pypi.org/project/parts>`__ via the GitHub Actions workflow found in ``.github/workflows/build-publish-sign-release.yml`` that follows the `recommendations found in the Python Packaging User Guide <https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/>`__.
121
+
This library can be published as a `package on PyPI <https://pypi.org/project/pratts>`__ via the GitHub Actions workflow found in ``.github/workflows/build-publish-sign-release.yml`` that follows the `recommendations found in the Python Packaging User Guide <https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/>`__.
91
122
92
123
Ensure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule <https://docs.readthedocs.io/en/stable/automation-rules.html>`__ that activates and sets as the default all tagged versions.
0 commit comments