domplus


Namedomplus JSON
Version 1.0.3 PyPI version JSON
download
home_page
Summarydomplus is a python package with common functions for commercial applications.
upload_time2023-09-05 19:48:46
maintainer
docs_urlNone
authorEduardo Basílio
requires_python>=3.8,<4.0
licenseMIT
keywords validation cpf cnpj creditcard uhn-algorithm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Domplus

[![Build Status](https://app.travis-ci.com/edubasilio/domplus.svg?branch=master)](https://app.travis-ci.com/edubasilio/domplus)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/domplus.svg)](https://pypi.python.org/pypi/domplus/)
[![PyPI version shields.io](https://img.shields.io/pypi/v/domplus.svg)](https://pypi.python.org/pypi/domplus/)
[![PyPI download month](https://img.shields.io/pypi/dm/domplus.svg)](https://pypi.python.org/pypi/domplus/)

_domplus_ is a python package with common functions for commercial applications.

## Features

* Check if a _string_ is a valid **Brazilian CPF**
* Check if a _string_ is a valid **Brazilian CNPJ**
* Check if a _string_ is a valid **Brazilian CPF** or a valid **Brazilian CNPJ**
* Check if a _string_ is a valid **Brazilian CNH**
* Check if a _string_ is a valid **Brazilian RENAVAM**
* Check if a _string_ is a valid **credit card number**

## Install

```sh
pip install domplus
```

## Usage

### Brazilian CPF and CNPJ

Check if a _string_ is a valid **Brazilian CPF**:

```python
from domplus.gov.br import is_cpf

is_cpf("03167158590")  # return True or False
```

Check if a _string_ is a valid **Brazilian CNPJ**:

```python
from domplus.gov.br import is_cnpj

is_cnpj("75317134000130")  # return True or False
```

Check if a _string_ is a valid **Brazilian CPF** or a valid **Brazilian CNPJ**:

```python
from domplus.gov.br import is_cpf_or_cnpj

is_cpf_or_cnpj("03167158590")  # return 'cpf', 'cnpj' or False
# OR
is_cpf_or_cnpj("75317134000130")  # return 'cpf', 'cnpj' or False
```

> **Note about Brazilian CPF/CNPJ validate algorithm:** _In this software, **valid** means that the analyzed string conforms to the Brazilian CPF/CNPJ generation algorithm. This software does not make any verification in the records of the Brazilian Government. Therefore, it is possible that a valid string has not been issued by the Brazilian Government._

### Brazilian CNH and RENAVAM

Check if a _string_ is a valid **Brazilian CNH**:

```python
from domplus.gov.br import is_cnh

is_cnh("67377435789")  # return True or False
```

Check if a _string_ is a valid **Brazilian RENAVAM**:

```python
from domplus.gov.br import is_renavam

is_renavam("54949744211")  # return True or False
```

> **Note about Brazilian CNH/RENAVAM validate algorithm:** _In this software, **valid** means that the analyzed string conforms to the Brazilian CNH/RENAVAM generation algorithm. This software does not make any verification in the records of the Brazilian Government. Therefore, it is possible that a valid string has not been issued by the Brazilian Government._

### **Creditcard**

Check if a string is a valid **credit card number**:

```python
from domplus.finance import is_creditcard

is_creditcard("374356783424314")  # return True or False
```

> **Note about credit card validate algorithm:** _In this software, **valid** means that the analyzed string conforms to the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm "Luhn algorithm") used by the credit card administrators. This software does not make any checks on the records of the credit card administrators. Therefore, it is possible that a valid string has not been issued by the credit card administrator._

## For development

### Requirements

* Python 3.8
* Poetry 1.6.1

### Install requirements

```sh
poetry install
```

### Run tests

```sh
poetry run pytest
```

### Commit

Before commit, in `domplus` directory, run:

```sh
poetry export -f requirements.txt --output requirements.txt --with test
```

And add `requirements.txt` in git staged

## History

### 1.0.3 (2023-09-05)

* Change `domplus.govplus.is_validbr_cpf` to `domplus.gov.br.is_cpf`
* Change `domplus.govplus.is_validbr_cnpj` to `domplus.gov.br.is_cnpj`
* Change `domplus.govplus.is_br_cpf_or_cnpj` to `domplus.gov.br.is_cpf_or_cnpj`
* Change `domplus.financeplus.is_validcreditcard` to `domplus.finance.is_creditcard`
* Add brazilian CNH validate
* Add brazilian RENAVAM validate

### 0.1.9 (2019-05-01)

* Update to Python 3.6
* Added invalid CPF / CNPJ list used by Brazilian Government - Serpro at [irpf-livre-src](http://www.fsfla.org/~lxoliva/fsfla/irpf-livre/2009/r6675/irpf-livre-src.tar.bz2)

### 0.1.3 (2015-04-19)

* First release on PyPI.

## License

The MIT License (MIT)

Copyright (c) 2019, Eduardo Basílio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[![PyPI license](https://img.shields.io/pypi/l/domplus.svg)](https://pypi.python.org/pypi/domplus/)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "domplus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "validation,cpf,cnpj,creditcard,uhn-algorithm",
    "author": "Eduardo Bas\u00edlio",
    "author_email": "eduardoafonsobasilio@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ad/9a/9e9d5605470f4e1b7db3e08f384d17a78c94498701c863294ff37bda4532/domplus-1.0.3.tar.gz",
    "platform": null,
    "description": "# Domplus\n\n[![Build Status](https://app.travis-ci.com/edubasilio/domplus.svg?branch=master)](https://app.travis-ci.com/edubasilio/domplus)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/domplus.svg)](https://pypi.python.org/pypi/domplus/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/domplus.svg)](https://pypi.python.org/pypi/domplus/)\n[![PyPI download month](https://img.shields.io/pypi/dm/domplus.svg)](https://pypi.python.org/pypi/domplus/)\n\n_domplus_ is a python package with common functions for commercial applications.\n\n## Features\n\n* Check if a _string_ is a valid **Brazilian CPF**\n* Check if a _string_ is a valid **Brazilian CNPJ**\n* Check if a _string_ is a valid **Brazilian CPF** or a valid **Brazilian CNPJ**\n* Check if a _string_ is a valid **Brazilian CNH**\n* Check if a _string_ is a valid **Brazilian RENAVAM**\n* Check if a _string_ is a valid **credit card number**\n\n## Install\n\n```sh\npip install domplus\n```\n\n## Usage\n\n### Brazilian CPF and CNPJ\n\nCheck if a _string_ is a valid **Brazilian CPF**:\n\n```python\nfrom domplus.gov.br import is_cpf\n\nis_cpf(\"03167158590\")  # return True or False\n```\n\nCheck if a _string_ is a valid **Brazilian CNPJ**:\n\n```python\nfrom domplus.gov.br import is_cnpj\n\nis_cnpj(\"75317134000130\")  # return True or False\n```\n\nCheck if a _string_ is a valid **Brazilian CPF** or a valid **Brazilian CNPJ**:\n\n```python\nfrom domplus.gov.br import is_cpf_or_cnpj\n\nis_cpf_or_cnpj(\"03167158590\")  # return 'cpf', 'cnpj' or False\n# OR\nis_cpf_or_cnpj(\"75317134000130\")  # return 'cpf', 'cnpj' or False\n```\n\n> **Note about Brazilian CPF/CNPJ validate algorithm:** _In this software, **valid** means that the analyzed string conforms to the Brazilian CPF/CNPJ generation algorithm. This software does not make any verification in the records of the Brazilian Government. Therefore, it is possible that a valid string has not been issued by the Brazilian Government._\n\n### Brazilian CNH and RENAVAM\n\nCheck if a _string_ is a valid **Brazilian CNH**:\n\n```python\nfrom domplus.gov.br import is_cnh\n\nis_cnh(\"67377435789\")  # return True or False\n```\n\nCheck if a _string_ is a valid **Brazilian RENAVAM**:\n\n```python\nfrom domplus.gov.br import is_renavam\n\nis_renavam(\"54949744211\")  # return True or False\n```\n\n> **Note about Brazilian CNH/RENAVAM validate algorithm:** _In this software, **valid** means that the analyzed string conforms to the Brazilian CNH/RENAVAM generation algorithm. This software does not make any verification in the records of the Brazilian Government. Therefore, it is possible that a valid string has not been issued by the Brazilian Government._\n\n### **Creditcard**\n\nCheck if a string is a valid **credit card number**:\n\n```python\nfrom domplus.finance import is_creditcard\n\nis_creditcard(\"374356783424314\")  # return True or False\n```\n\n> **Note about credit card validate algorithm:** _In this software, **valid** means that the analyzed string conforms to the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm \"Luhn algorithm\") used by the credit card administrators. This software does not make any checks on the records of the credit card administrators. Therefore, it is possible that a valid string has not been issued by the credit card administrator._\n\n## For development\n\n### Requirements\n\n* Python 3.8\n* Poetry 1.6.1\n\n### Install requirements\n\n```sh\npoetry install\n```\n\n### Run tests\n\n```sh\npoetry run pytest\n```\n\n### Commit\n\nBefore commit, in `domplus` directory, run:\n\n```sh\npoetry export -f requirements.txt --output requirements.txt --with test\n```\n\nAnd add `requirements.txt` in git staged\n\n## History\n\n### 1.0.3 (2023-09-05)\n\n* Change `domplus.govplus.is_validbr_cpf` to `domplus.gov.br.is_cpf`\n* Change `domplus.govplus.is_validbr_cnpj` to `domplus.gov.br.is_cnpj`\n* Change `domplus.govplus.is_br_cpf_or_cnpj` to `domplus.gov.br.is_cpf_or_cnpj`\n* Change `domplus.financeplus.is_validcreditcard` to `domplus.finance.is_creditcard`\n* Add brazilian CNH validate\n* Add brazilian RENAVAM validate\n\n### 0.1.9 (2019-05-01)\n\n* Update to Python 3.6\n* Added invalid CPF / CNPJ list used by Brazilian Government - Serpro at [irpf-livre-src](http://www.fsfla.org/~lxoliva/fsfla/irpf-livre/2009/r6675/irpf-livre-src.tar.bz2)\n\n### 0.1.3 (2015-04-19)\n\n* First release on PyPI.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2019, Eduardo Bas\u00edlio\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[![PyPI license](https://img.shields.io/pypi/l/domplus.svg)](https://pypi.python.org/pypi/domplus/)\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "domplus is a python package with common functions for commercial applications.",
    "version": "1.0.3",
    "project_urls": null,
    "split_keywords": [
        "validation",
        "cpf",
        "cnpj",
        "creditcard",
        "uhn-algorithm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c992be8d4356ffaefd0b1050729a83f75fae959f5a058c2d5e52bc686219464",
                "md5": "bcb219463fb4d28a13e3bbf6a468fdc5",
                "sha256": "3c0a4cdc529121be771446033852566a50a672cb2d8ce12913af4b2886a600f8"
            },
            "downloads": -1,
            "filename": "domplus-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bcb219463fb4d28a13e3bbf6a468fdc5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 6153,
            "upload_time": "2023-09-05T19:48:43",
            "upload_time_iso_8601": "2023-09-05T19:48:43.652347Z",
            "url": "https://files.pythonhosted.org/packages/3c/99/2be8d4356ffaefd0b1050729a83f75fae959f5a058c2d5e52bc686219464/domplus-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad9a9e9d5605470f4e1b7db3e08f384d17a78c94498701c863294ff37bda4532",
                "md5": "88f613a694310d2c7b313951450d7b15",
                "sha256": "39aeb89e1dd1091d97352e6c406610b1c9bf83f617bbd12e1e47c8d5f0a939e8"
            },
            "downloads": -1,
            "filename": "domplus-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "88f613a694310d2c7b313951450d7b15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 4598,
            "upload_time": "2023-09-05T19:48:46",
            "upload_time_iso_8601": "2023-09-05T19:48:46.799802Z",
            "url": "https://files.pythonhosted.org/packages/ad/9a/9e9d5605470f4e1b7db3e08f384d17a78c94498701c863294ff37bda4532/domplus-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-05 19:48:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "domplus"
}
        
Elapsed time: 0.11556s