Sheets data validation
Project description
EXPYVALIDATIONS
Description
ExpyValitations python library is used to validate data in excel files. It is possible to validate the type of data, if it is required, if it is unique, perform custom validations and more!
Installation
pip install expyvalidations
Usage
# Import the ExpyValidations class
from expyvalidations import ExpyValidations
# Create a new instance of ExpyValidations
ev = ExpyValidations(path_file='path/to/file.xlsx'
# add columns to validate
ev.add_column(key="descricao", name="nome", required=True)
ev.add_column(key="value", name="valor", type="float")
# perform all validations in the file
ev.check_all()
# check if there are errors
if ev.has_errors():
# get the errors
print(ev.get_errors())
"""
[
{
"type": "Error",
"column": "descricao",
"row": 2,
"message": "Campo obrigatório"
},
{
"type": "Error",
"column": "value",
"row": 3,
"message": "Value is not a valid number"
}
]
"""
else:
# get the result
ev.get_result()
"""
[
{
"descricao": "Produto 1",
"value": 10.0
},
{
"descricao": "Produto 2",
"value": 20.0
}
]
"""
License
Documentation
Click here to see the documentation.
Author
Ezequiel Abreu (Exebixel)
- LinkedIn: Ezequiel Abreu
- GitHub: Exebixel
- Telegram: @Exebixel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
expyvalidations-0.0.4.tar.gz
(11.6 kB
view hashes)
Built Distribution
Close
Hashes for expyvalidations-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40054de2160df760b52876b0662c379d0b4f86526e3f6b454e9d3027865e2b44 |
|
MD5 | 9ee43b3cb8bba8fc54606c1cd00c2199 |
|
BLAKE2b-256 | 57f13ab610a66f2dfef6cc76bbfc8de1196afd36312a19692108f99412bc76b8 |