Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details →
Socket
Book a DemoInstallSign in
Socket

checkdigit

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkdigit - npm Package Compare versions

Comparing version
0.3.1
to
0.4.0
+7
-6
checkdigit/_data.py

@@ -74,2 +74,3 @@ # /usr/bin/env python

# Pytest coverage not applicable since these are just types.

@@ -82,4 +83,7 @@ class ModuleInterface: # pragma: no cover

# A body of the function isn't required, since we're just mimicking the types.
# Hence get mypy to ignore the warning
@staticmethod
def validate(data: str) -> bool:
def validate(data: str) -> bool: # type: ignore[empty-body]
"""Validates check digits in a full block of data.

@@ -93,6 +97,5 @@

"""
...
@staticmethod
def calculate(data: str) -> str:
def calculate(data: str) -> str: # type: ignore[empty-body]
"""Calculates check digits for a block of data.

@@ -106,7 +109,6 @@

"""
...
def import_module_with_interface(module: str) -> ModuleInterface:
"""Imports the module,, and sets its type to ModuleInterface to play nice with mypy.
"""Imports the module, and sets its type to ModuleInterface to play nice with mypy.

@@ -144,3 +146,2 @@ Args:

data_type = import_module_with_interface(module)
# data_type = __import__(f"checkdigit.{module}", fromlist=["validate, calculate"])

@@ -147,0 +148,0 @@ # We already have an efficient method for the check digit

@@ -107,3 +107,3 @@ # /usr/bin/env python

return "Invalid" # if there are no ? to replace the algorithm will not work
permutations = 2 ** number # number of different permutations that are possible
permutations = 2**number # number of different permutations that are possible
for permutation in range(permutations):

@@ -110,0 +110,0 @@ tocheck = data

+10
-10
Metadata-Version: 2.1
Name: checkdigit
Version: 0.3.1
Version: 0.4.0
Summary: A check digit library for data validation

@@ -12,3 +12,3 @@ Home-page: https://checkdigit.rtfd.io

Maintainer-email: harensdeveloper@gmail.com
Requires-Python: >=3.6.1,<4.0
Requires-Python: >=3.7,<4.0
Classifier: Intended Audience :: Developers

@@ -22,2 +22,4 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)

Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed

@@ -36,3 +38,3 @@ Project-URL: Bug Tracker, https://github.com/harens/checkdigit/issues

.. image:: https://img.shields.io/github/workflow/status/harens/checkdigit/Tests?logo=github&style=flat-square
.. image:: https://img.shields.io/github/actions/workflow/status/harens/checkdigit/test.yml?logo=github&style=flat-square
:alt: GitHub Tests status

@@ -53,6 +55,2 @@ :target: https://github.com/harens/checkdigit/actions

.. image:: https://img.shields.io/lgtm/grade/python/github/harens/checkdigit?logo=lgtm&style=flat-square
:alt: LGTM Grade
:target: https://lgtm.com/projects/g/harens/checkdigit/
=========

@@ -91,5 +89,7 @@

* `PEP 561 compatible <https://www.python.org/dev/peps/pep-0561>`_, with built in support for type checking.
* Capable of calculating missing digits or validating a block of data.
* Extensive in-code comments and docstrings to explain how it works behind the scenes. šŸŖ„
* šŸ“¦ Works out of the box with all `supported Python versions <https://endoflife.date/python>`_ (3.7-3.11).
* āŒØļø `PEP 561 compatible <https://www.python.org/dev/peps/pep-0561>`_, with built in support for type checking.
* šŸƒ Zero runtime dependencies. What you see is what you get.
* 🧮 Capable of calculating missing digits or validating a block of data.
* šŸ“ Extensive in-code comments and docstrings to explain how it works behind the scenes.

@@ -96,0 +96,0 @@ āœ… Supported Formats

@@ -8,3 +8,3 @@ .. image:: https://raw.githubusercontent.com/harens/checkdigit/master/art/logo.png

.. image:: https://img.shields.io/github/workflow/status/harens/checkdigit/Tests?logo=github&style=flat-square
.. image:: https://img.shields.io/github/actions/workflow/status/harens/checkdigit/test.yml?logo=github&style=flat-square
:alt: GitHub Tests status

@@ -25,6 +25,2 @@ :target: https://github.com/harens/checkdigit/actions

.. image:: https://img.shields.io/lgtm/grade/python/github/harens/checkdigit?logo=lgtm&style=flat-square
:alt: LGTM Grade
:target: https://lgtm.com/projects/g/harens/checkdigit/
=========

@@ -63,5 +59,7 @@

* `PEP 561 compatible <https://www.python.org/dev/peps/pep-0561>`_, with built in support for type checking.
* Capable of calculating missing digits or validating a block of data.
* Extensive in-code comments and docstrings to explain how it works behind the scenes. šŸŖ„
* šŸ“¦ Works out of the box with all `supported Python versions <https://endoflife.date/python>`_ (3.7-3.11).
* āŒØļø `PEP 561 compatible <https://www.python.org/dev/peps/pep-0561>`_, with built in support for type checking.
* šŸƒ Zero runtime dependencies. What you see is what you get.
* 🧮 Capable of calculating missing digits or validating a block of data.
* šŸ“ Extensive in-code comments and docstrings to explain how it works behind the scenes.

@@ -68,0 +66,0 @@ āœ… Supported Formats

[tool.poetry]
name = "checkdigit"
version = "0.3.1"
version = "0.4.0"
description = "A check digit library for data validation"

@@ -26,19 +26,18 @@ authors = ["harens <harensdeveloper@gmail.com>"]

[tool.poetry.dependencies]
python = ">=3.6.1,<4.0"
python = ">=3.7,<4.0"
[tool.poetry.dev-dependencies]
error404 = "^1.1.8a0"
pylint = "^2.9.5"
mypy = "^0.910"
black = "^20.8b1"
isort = "^5.9.2"
pydocstyle = "^6.1.1"
coverage = "^5.5"
pre-commit = "^2.13.0"
pyupgrade = "^2.23.0"
Sphinx = "^4.1.1"
pylint = "2.13.9"
mypy = "^0.991"
black = "^23.1a1"
isort = "^5.11.4"
pydocstyle = "^6.2.3"
coverage = "^7.0.5"
pre-commit = "^2.21.0"
pyupgrade = "^3.3.1"
Sphinx = "5.3.0"
sphinx-autobuild = "^2021.3.14"
pytest = "^6.2.4"
pytest-cov = "^2.12.1"
readme-renderer = "^29.0"
pytest = "^7.2.1"
pytest-cov = "^4.0.0"
pytest-sugar = "^0.9.6"

@@ -45,0 +44,0 @@ [tool.coverage.run]

@@ -12,5 +12,5 @@ # -*- coding: utf-8 -*-

'name': 'checkdigit',
'version': '0.3.1',
'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/workflow/status/harens/checkdigit/Tests?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.. image:: https://img.shields.io/lgtm/grade/python/github/harens/checkdigit?logo=lgtm&style=flat-square\n :alt: LGTM Grade\n :target: https://lgtm.com/projects/g/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* `PEP 561 compatible <https://www.python.org/dev/peps/pep-0561>`_, with built in support for type checking.\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. \U0001fa84\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",
'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',

@@ -23,3 +23,3 @@ 'author_email': 'harensdeveloper@gmail.com',

'package_data': package_data,
'python_requires': '>=3.6.1,<4.0',
'python_requires': '>=3.7,<4.0',
}

@@ -26,0 +26,0 @@