checkdigit
Advanced tools
@@ -36,3 +36,3 @@ # /usr/bin/env python | ||
| def convert(digit: int, isbn: bool = True) -> str: | ||
| def convert(digit: int, isbn10: bool = True) -> str: | ||
| """Converts digits to strings and replaces 10 and 11. | ||
@@ -42,6 +42,6 @@ | ||
| digit: The code to be modified. | ||
| isbn: Whether the code is ISBN or not. | ||
| isbn10: Whether the code is ISBN-10 or not. | ||
| """ | ||
| if digit == 10: | ||
| return "X" if isbn else "0" | ||
| return "X" if isbn10 else "0" | ||
| return "0" if digit == 11 else str(digit) | ||
@@ -48,0 +48,0 @@ |
@@ -61,3 +61,3 @@ # /usr/bin/env python | ||
| # Return final check digit and type of barcode | ||
| return convert(10 - (total_sum % 10)) | ||
| return convert(10 - (total_sum % 10), False) | ||
| return "Invalid" | ||
@@ -64,0 +64,0 @@ |
+2
-3
| Metadata-Version: 2.1 | ||
| Name: checkdigit | ||
| Version: 0.4.0 | ||
| Version: 0.5.0 | ||
| Summary: A check digit library for data validation | ||
@@ -96,4 +96,3 @@ Home-page: https://checkdigit.rtfd.io | ||
| * `CRC <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.crc.html#module-checkdigit.crc>`_ | ||
| (credit to `@sapieninja <https://github.com/sapieninja>`_) | ||
| * `GS1 Standards <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.gs1.html#module-checkdigit.gs1>`_ (credit to `@OtherBarry <https://github.com/OtherBarry>`_) | ||
| * `GS1 Standards <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.gs1.html#module-checkdigit.gs1>`_ | ||
| * EAN-8/13 | ||
@@ -100,0 +99,0 @@ * GDTI |
+1
-2
@@ -68,4 +68,3 @@ .. image:: https://raw.githubusercontent.com/harens/checkdigit/master/art/logo.png | ||
| * `CRC <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.crc.html#module-checkdigit.crc>`_ | ||
| (credit to `@sapieninja <https://github.com/sapieninja>`_) | ||
| * `GS1 Standards <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.gs1.html#module-checkdigit.gs1>`_ (credit to `@OtherBarry <https://github.com/OtherBarry>`_) | ||
| * `GS1 Standards <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.gs1.html#module-checkdigit.gs1>`_ | ||
| * EAN-8/13 | ||
@@ -72,0 +71,0 @@ * GDTI |
+7
-7
| [tool.poetry] | ||
| name = "checkdigit" | ||
| version = "0.4.0" | ||
| version = "0.5.0" | ||
| description = "A check digit library for data validation" | ||
@@ -30,7 +30,7 @@ authors = ["harens <harensdeveloper@gmail.com>"] | ||
| pylint = "2.13.9" | ||
| mypy = "^0.991" | ||
| black = "^23.1a1" | ||
| isort = "^5.11.4" | ||
| pydocstyle = "^6.2.3" | ||
| coverage = "^7.0.5" | ||
| mypy = "^1.1" | ||
| black = "^23.3" | ||
| isort = "^5.11.5" | ||
| pydocstyle = "^6.3.0" | ||
| coverage = "^7.2.2" | ||
| pre-commit = "^2.21.0" | ||
@@ -40,3 +40,3 @@ pyupgrade = "^3.3.1" | ||
| sphinx-autobuild = "^2021.3.14" | ||
| pytest = "^7.2.1" | ||
| pytest = "^7.2.2" | ||
| pytest-cov = "^4.0.0" | ||
@@ -43,0 +43,0 @@ pytest-sugar = "^0.9.6" |
-26
| # -*- coding: utf-8 -*- | ||
| from setuptools import setup | ||
| packages = \ | ||
| ['checkdigit'] | ||
| package_data = \ | ||
| {'': ['*']} | ||
| setup_kwargs = { | ||
| 'name': 'checkdigit', | ||
| 'version': '0.4.0', | ||
| 'description': 'A check digit library for data validation', | ||
| 'long_description': ".. image:: https://raw.githubusercontent.com/harens/checkdigit/master/art/logo.png\n :alt: checkdigit logo\n :target: https://github.com/harens/checkdigit\n :align: center\n\n|\n\n.. image:: https://img.shields.io/github/actions/workflow/status/harens/checkdigit/test.yml?logo=github&style=flat-square\n :alt: GitHub Tests status\n :target: https://github.com/harens/checkdigit/actions\n\n.. image:: https://img.shields.io/codecov/c/github/harens/checkdigit?logo=codecov&style=flat-square\n :alt: Codecov\n :target: https://app.codecov.io/gh/harens/checkdigit\n\n.. image:: https://img.shields.io/pypi/dm/checkdigit?logo=python&logoColor=white&style=flat-square\n :alt: PyPi - Downloads\n :target: https://pepy.tech/project/checkdigit\n\n.. image:: https://img.shields.io/codefactor/grade/github/harens/checkdigit?logo=codefactor&style=flat-square\n :alt: CodeFactor Grade\n :target: https://www.codefactor.io/repository/github/harens/checkdigit/\n\n=========\n\n.. image:: https://repology.org/badge/vertical-allrepos/python:checkdigit.svg\n :alt: checkdigit repology\n :target: https://repology.org/project/python:checkdigit/versions\n :align: right\n\n**checkdigit** is a pure Python library built for identification numbers.\nYou want to validate a credit card number, or maybe even calculate a missing digit on an ISBN code?\nWe've got you covered š.\n\nWant to know more? Check out the `API Reference and documentation <https://checkdigit.readthedocs.io/en/latest/reference.html>`_!\n\nInstallation\n------------\n\n`MacPorts <https://ports.macports.org/port/py-checkdigit/summary>`_ š\n*************************************************************************\n\n.. code-block::\n\n sudo port install py-checkdigit\n\n`PyPi <https://pypi.org/project/checkdigit/>`_ š\n**************************************************\n\n.. code-block::\n\n pip install checkdigit\n\n⨠Features\n------------\n\n* š¦ Works out of the box with all `supported Python versions <https://endoflife.date/python>`_ (3.7-3.11).\n* āØļø `PEP 561 compatible <https://www.python.org/dev/peps/pep-0561>`_, with built in support for type checking.\n* š Zero runtime dependencies. What you see is what you get.\n* š§® Capable of calculating missing digits or validating a block of data.\n* š Extensive in-code comments and docstrings to explain how it works behind the scenes.\n\nā Supported Formats\n---------------------\n\n* `Even/Odd binary parity <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.parity.html#module-checkdigit.parity>`_\n* `CRC <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.crc.html#module-checkdigit.crc>`_\n (credit to `@sapieninja <https://github.com/sapieninja>`_)\n* `GS1 Standards <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.gs1.html#module-checkdigit.gs1>`_ (credit to `@OtherBarry <https://github.com/OtherBarry>`_)\n * EAN-8/13\n * GDTI\n * GLN\n * SSCC\n * UPC-A/E\n * etc. *(all fixed length numeric GS1 data structures with a check digit)*\n* `ISBN-10/13 <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.isbn.html#module-checkdigit.isbn>`_\n* `Luhn <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.luhn.html#module-checkdigit.luhn>`_\n* `Verhoeff <https://checkdigit.readthedocs.io/en/latest/_autosummary/checkdigit.verhoeff.html#module-checkdigit.verhoeff>`_\n\nFor each of these formats, we provide functions to validate them and calculate missing digits.\n\nDo you have any formats that you'd like to see supported? š¤ Feel free to raise an issue,\nor even to send a pull request!\n\nšØ Contributing\n---------------\n\n- Contributing Page: `<https://checkdigit.rtfd.io/en/latest/contributing.html>`_\n- Issue Tracker: `<https://github.com/harens/checkdigit/issues>`_\n- Source Code: `<https://github.com/harens/checkdigit>`_\n\nAny change, big or small, that you think can help improve this project is more than welcome š.\n\nAs well as this, feel free to open an issue with any new suggestions or bug reports. Every contribution is appreciated.\n\nTo find out more, please read our `contributing page <https://checkdigit.readthedocs.io/en/latest/contributing.html>`_. Thank you!\n\nš License\n-----------\n\nThis project is licensed under `GPL-3.0-or-later <https://github.com/harens/checkdigit/blob/master/LICENSE>`_.\n", | ||
| 'author': 'harens', | ||
| 'author_email': 'harensdeveloper@gmail.com', | ||
| 'maintainer': 'harens', | ||
| 'maintainer_email': 'harensdeveloper@gmail.com', | ||
| 'url': 'https://checkdigit.rtfd.io', | ||
| 'packages': packages, | ||
| 'package_data': package_data, | ||
| 'python_requires': '>=3.7,<4.0', | ||
| } | ||
| setup(**setup_kwargs) |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
73629
-6.65%13
-7.14%666
-5.13%