Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 48 additions & 3 deletions creditcard/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,56 @@
"softnex": r"^610800",
"diners": r"^3(?:0[0-5]|[68][0-9])[0-9]{11}$",
"discover": r"^6(?:011|5[0-9]{2}|4[4-9][0-9]{1}|(22(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[01][0-9]|92[0-5]$)[0-9]{10}$))[0-9]{12}$", # noqa: E501
"hipercard": r"^(38[0-9]{17}|60[0-9]{14})$",
"hipercard": r"^(606282|637095|3841[046]0)[0-9]{10}$",
"amex": r"^3[47][0-9]{13}$",
"aura": r"^50[0-9]{14,17}$",
"aura": r"^5078[0-9]{12,15}$",
"codensa": r"^(870055|590712|529448)[0-9]{10}$",
"master": r"^(5[1-5][0-9]{14}|2221[0-9]{12}|222[2-9][0-9]{12}|22[3-9][0-9]{13}|2[3-6][0-9]{14}|27[01][0-9]{13}|2720[0-9]{12})$", # noqa: E501
"master": (
r"^"
r"(5[1-5][0-9]{14}"
r"|2221[0-9]{12}"
r"|222[2-9][0-9]{12}"
r"|22[3-9][0-9]{13}"
r"|2[3-6][0-9]{14}"
r"|27[01][0-9]{13}"
r"|2720[0-9]{12}"
# Suporte aos antigos cartões Maestro que agora são MasterCard
r"|5[06789][0-9]{14}"
r"|600[689][0-9]{12}"
r"|602[468][0-9]{12}"
r"|603[0-9]{13}"
r"|604[69][0-9]{12}"
r"|605[045][0-9]{12}"
r"|606[234][0-9]{12}"
r"|6095[0-9]{12}"
r"|6220[0-9]{12}"
r"|627[389][0-9]{12}"
r"|628[01][0-9]{12}"
r"|6305[0-9]{12}"
r"|631[06][0-9]{12}"
r"|636[13678][0-9]{12}"
r"|637[1256][0-9]{12}"
r"|6381[0-9]{12}"
r"|639[2-7][0-9]{12}"
r"|6602[0-9]{12}"
r"|662[269][0-9]{12}"
r"|6640[0-9]{12}"
r"|665[49][0-9]{12}"
r"|666[2478][0-9]{12}"
r"|667[79][0-9]{12}"
r"|668[03569][0-9]{12}"
r"|6690[0-9]{12}"
r"|671[45][0-9]{12}"
r"|6748[0-9]{12}"
r"|6777[0-9]{12}"
r"|678[37][0-9]{12}"
r"|679[29][0-9]{12}"
r"|681[056][0-9]{12}"
r"|684[37][0-9]{12}"
r"|6874[0-9]{12}"
r"|68[589]0[0-9]{12}"
r")$"
),
"visa": r"^4[0-9]{12}(?:[0-9]{3})?$",
}

Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip-tools==5.2.1
pip-tools
ipython
black
pre-commit
127 changes: 86 additions & 41 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,86 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements/dev.in
#
appdirs==1.4.4 # via black, virtualenv
attrs==19.3.0 # via black
backcall==0.2.0 # via ipython
black==19.10b0 # via -r requirements/dev.in
cfgv==3.1.0 # via pre-commit
click==7.1.2 # via black, pip-tools
decorator==4.4.2 # via ipython, traitlets
distlib==0.3.1 # via virtualenv
filelock==3.0.12 # via virtualenv
identify==1.4.23 # via pre-commit
ipython-genutils==0.2.0 # via traitlets
ipython==7.16.1 # via -r requirements/dev.in
jedi==0.17.1 # via ipython
nodeenv==1.4.0 # via pre-commit
parso==0.7.0 # via jedi
pathspec==0.8.0 # via black
pexpect==4.8.0 # via ipython
pickleshare==0.7.5 # via ipython
pip-tools==5.2.1 # via -r requirements/dev.in
pre-commit==2.6.0 # via -r requirements/dev.in
prompt-toolkit==3.0.5 # via ipython
ptyprocess==0.6.0 # via pexpect
pygments==2.6.1 # via ipython
pyyaml==5.3.1 # via pre-commit
regex==2020.6.8 # via black
six==1.15.0 # via pip-tools, traitlets, virtualenv
toml==0.10.1 # via black, pre-commit
traitlets==4.3.3 # via ipython
typed-ast==1.4.1 # via black
virtualenv==20.0.26 # via pre-commit
wcwidth==0.2.5 # via prompt-toolkit

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
# This file was autogenerated by uv via the following command:
# uv pip compile dev.in
asttokens==3.0.0
# via stack-data
black==25.1.0
# via -r dev.in
build==1.3.0
# via pip-tools
cfgv==3.4.0
# via pre-commit
click==8.2.1
# via
# black
# pip-tools
decorator==5.2.1
# via ipython
distlib==0.4.0
# via virtualenv
executing==2.2.0
# via stack-data
filelock==3.18.0
# via virtualenv
identify==2.6.12
# via pre-commit
ipython==9.4.0
# via -r dev.in
ipython-pygments-lexers==1.1.1
# via ipython
jedi==0.19.2
# via ipython
matplotlib-inline==0.1.7
# via ipython
mypy-extensions==1.1.0
# via black
nodeenv==1.9.1
# via pre-commit
packaging==25.0
# via
# black
# build
parso==0.8.4
# via jedi
pathspec==0.12.1
# via black
pexpect==4.9.0
# via ipython
pip==25.2
# via pip-tools
pip-tools==7.5.0
# via -r dev.in
platformdirs==4.3.8
# via
# black
# virtualenv
pre-commit==4.2.0
# via -r dev.in
prompt-toolkit==3.0.51
# via ipython
ptyprocess==0.7.0
# via pexpect
pure-eval==0.2.3
# via stack-data
pygments==2.19.2
# via
# ipython
# ipython-pygments-lexers
pyproject-hooks==1.2.0
# via
# build
# pip-tools
pyyaml==6.0.2
# via pre-commit
setuptools==80.9.0
# via pip-tools
stack-data==0.6.3
# via ipython
traitlets==5.14.3
# via
# ipython
# matplotlib-inline
virtualenv==20.33.1
# via pre-commit
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.45.1
# via pip-tools
6 changes: 3 additions & 3 deletions requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flake8==3.8.3
flake8
pytest-cov
pytest-flake8
pytest==5.4.3
safety==1.9.0
pytest
safety
181 changes: 141 additions & 40 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,141 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements/test.in
#
attrs==19.3.0 # via pytest
certifi==2020.6.20 # via requests
chardet==3.0.4 # via requests
click==7.1.2 # via safety
coverage==5.2 # via pytest-cov
dparse==0.5.1 # via safety
flake8==3.8.3 # via -r requirements/test.in, pytest-flake8
idna==2.10 # via requests, yarl
mccabe==0.6.1 # via flake8
more-itertools==8.4.0 # via pytest
multidict==4.7.6 # via yarl
packaging==20.4 # via dparse, pytest, safety
pluggy==0.13.1 # via pytest
py==1.9.0 # via pytest
pycodestyle==2.6.0 # via flake8
pyflakes==2.2.0 # via flake8
pyparsing==2.4.7 # via packaging
pytest-cov==2.10.0 # via -r requirements/test.in
pytest-flake8==1.0.6 # via -r requirements/test.in
pytest-vcr==1.0.2 # via -r requirements/test.in
pytest==5.4.3 # via -r requirements/test.in, pytest-cov, pytest-flake8, pytest-vcr
pyyaml==5.3.1 # via dparse, vcrpy
requests==2.24.0 # via safety
safety==1.9.0 # via -r requirements/test.in
six==1.15.0 # via packaging, vcrpy
toml==0.10.1 # via dparse
urllib3==1.25.9 # via requests
vcrpy==4.0.2 # via pytest-vcr
wcwidth==0.2.5 # via pytest
wrapt==1.12.1 # via vcrpy
yarl==1.4.2 # via vcrpy

# The following packages are considered to be unsafe in a requirements file:
# setuptools
# This file was autogenerated by uv via the following command:
# uv pip compile test.in
annotated-types==0.7.0
# via pydantic
anyio==4.10.0
# via httpx
authlib==1.6.1
# via safety
certifi==2025.8.3
# via
# httpcore
# httpx
# requests
cffi==1.17.1
# via cryptography
charset-normalizer==3.4.2
# via requests
click==8.2.1
# via
# nltk
# safety
# typer
coverage==7.10.2
# via pytest-cov
cryptography==45.0.6
# via authlib
dparse==0.6.4
# via
# safety
# safety-schemas
filelock==3.16.1
# via safety
flake8==7.3.0
# via
# -r test.in
# pytest-flake8
h11==0.16.0
# via httpcore
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via safety
idna==3.10
# via
# anyio
# httpx
# requests
iniconfig==2.1.0
# via pytest
jinja2==3.1.6
# via safety
joblib==1.5.1
# via nltk
markdown-it-py==3.0.0
# via rich
markupsafe==3.0.2
# via jinja2
marshmallow==4.0.0
# via safety
mccabe==0.7.0
# via flake8
mdurl==0.1.2
# via markdown-it-py
nltk==3.9.1
# via safety
packaging==25.0
# via
# dparse
# pytest
# safety
# safety-schemas
pluggy==1.6.0
# via
# pytest
# pytest-cov
psutil==6.1.1
# via safety
pycodestyle==2.14.0
# via flake8
pycparser==2.22
# via cffi
pydantic==2.9.2
# via
# safety
# safety-schemas
pydantic-core==2.23.4
# via pydantic
pyflakes==3.4.0
# via flake8
pygments==2.19.2
# via
# pytest
# rich
pytest==8.4.1
# via
# -r test.in
# pytest-cov
# pytest-flake8
pytest-cov==6.2.1
# via -r test.in
pytest-flake8==1.3.0
# via -r test.in
regex==2025.7.34
# via nltk
requests==2.32.4
# via safety
rich==14.1.0
# via typer
ruamel-yaml==0.18.14
# via
# safety
# safety-schemas
ruamel-yaml-clib==0.2.12
# via ruamel-yaml
safety==3.6.0
# via -r test.in
safety-schemas==0.0.14
# via safety
setuptools==80.9.0
# via safety
shellingham==1.5.4
# via typer
sniffio==1.3.1
# via anyio
tenacity==9.1.2
# via safety
tomlkit==0.13.3
# via safety
tqdm==4.67.1
# via nltk
typer==0.16.0
# via safety
typing-extensions==4.14.1
# via
# pydantic
# pydantic-core
# safety
# safety-schemas
# typer
urllib3==2.5.0
# via requests
Loading
Loading