python-stdnum branch master updated. 1.13-24-ge49e0e9
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.13-24-ge49e0e9
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org, python-stdnum-commits [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.13-24-ge49e0e9
- Date: Sat, 25 Apr 2020 23:11:32 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".
The branch, master has been updated
via e49e0e9e213b36b4debfcefbf1edcfdb554432ea (commit)
from 417b50028255e54097f2a0bf49f8a9f0f7064705 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=e49e0e9e213b36b4debfcefbf1edcfdb554432ea
commit e49e0e9e213b36b4debfcefbf1edcfdb554432ea
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sat Apr 25 20:41:19 2020 +0200
Document function return behaviour
diff --git a/docs/index.rst b/docs/index.rst
index 020314f..8eb0ea9 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -16,24 +16,33 @@ Most of the number format modules implement the following
functions:
:mod:`an exception <.exceptions>` is raised that indicates the type of
error.
+ :raises ValidationError: When the specified number is invalid
+ :returns: str -- A compact (canonical) representation of the number
+
.. function:: module.is_valid(number)
Return either ``True`` or ``False`` depending on whether the passed number
is in any supported and valid form and passes all embedded checks of the
number. This function should never raise an exception.
+ :returns: bool -- ``True`` if validated, ``False`` otherwise
+
.. function:: module.compact(number)
Return a compact representation of the number or code. This function
generally does not do validation but may raise exceptions for wildly
invalid numbers.
+ :returns: str -- The compacted number
+
.. function:: module.format(number)
Return a formatted version of the number in the preferred format.
This function generally expects to be passed a valid number or code and
may raise exceptions for invalid numbers.
+ :returns: str -- A formatted number
+
The check digit modules generally also provide the following functions:
.. function:: module.checksum(number)
@@ -42,11 +51,15 @@ The check digit modules generally also provide the
following functions:
number that can be used to determine whether the provided number is
valid. It depends on the algorithm which checksum is considered valid.
+ :returns: int -- A numeric checksum over the number
+
.. function:: module.calc_check_digit(number)
Calculate the check digit that should be added to the number to make it
valid.
+ :returns: str -- A check digit that can be appended
+
Apart from the above, the modules may add extra parsing, validation or
conversion functions.
-----------------------------------------------------------------------
Summary of changes:
docs/index.rst | 13 +++++++++++++
1 file changed, 13 insertions(+)
hooks/post-receive
--
python-stdnum
- python-stdnum branch master updated. 1.13-24-ge49e0e9,
Commits of the python-stdnum project