last price revision validation rules
Project description
Price Validation Engine
Overview
Price Validation Engine is framework to create skeleton to validate last price revision
requirements
- python 3.6+
- Linux, MacOS, windows
install
pip install price-val-engine
Start Project
python -m price_val_engine startproject project_name
Project template structure
- base_dir
- project_name
- __init__.py
- settings.py
- validtion_rules.py
- run.py
Run project
python run.py --input=input.csv --output=output.csv
input as s3 csv file
python run.py --input=s3://bucket_name/path/input.csv --output=s3://bucket_name/path/input.csv
settings.py
-
default validation pipeline
VALIDATION_PIPELINES = [ 'price_val_engine.core.validations.general_rules.NullNegativeZeroValidationRule', 'price_val_engine.core.validations.general_rules.OutOfRangeValidationRule', 'price_val_engine.core.validations.revision_rules.DeltaPercentageFromLastDayRule', ]
Add new custom validation rule
- step 1 you can define your custom validtion rules in the file `project_name/validation_rules.py`
class MyValidationRule(BaseRule)
name = "validation_rules.myvalidation_rule"
message = "price could not be gte {max_price}"
severity = ''
def is_valid(self, item):
max_price = 50
if item['price'] >= max_price:
self.message.format(max_price)
self.severity = 'HIGH' # you can define severity LOW, MEDIUM and HIGH
- step 2 add your newly defined rule in `setting.py`
VALIDATION_PIPELINES = [
...,
'project_name.validation_rules.MyValidationRule
]
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file price-val-engine-0.1.6.dev1.tar.gz.
File metadata
- Download URL: price-val-engine-0.1.6.dev1.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bcbc5cd1bc8bb60702098229c84d0d4ec7f74d03949a41f82ed0db6c98cc082
|
|
| MD5 |
67598bb3f7d9f18a4b8375a1b48e877e
|
|
| BLAKE2b-256 |
1b8a82fa31c797eeec087ac2156ce82ba1b416892681bcef0085521698c26433
|
File details
Details for the file price_val_engine-0.1.6.dev1-py3-none-any.whl.
File metadata
- Download URL: price_val_engine-0.1.6.dev1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a0ef0944cdc160ca1a16a6c42be4cfe4f0b75a51f90017b1e1f519bbed9d9ab
|
|
| MD5 |
7fa14b2e5aade87fc973dc3d5ab317e5
|
|
| BLAKE2b-256 |
ee25834ee2cd6d980da643af62c10eac567d5fb9165fb5e2dc5b95c80179071d
|