Package is used for validate the canonical data.
Project description
TDEI-mobility-canonical-validator
This package is used to validate the canonical data.
System requirements
| Software | Version |
|---|---|
| Python | 3.10.x |
What this package does?
This package is used to validate the canonical data.
Starting a new project with template
- Add
gtfs-canonical-validatorpackage as dependency in yourrequirements.txt - or
pip install gtfs-canonical-validator - Start using the packages in your code.
Initialize and Configuration
from gtfs_canonical_validator import CanonicalValidator
canonical_validator = CanonicalValidator(zip_file=<CANONICAL_ZIP_FILE_PATH>)
report = canonical_validator.validate()
print(report)
Testing
The project is configured with python to figure out the coverage of the unit tests. All the tests are in tests
folder.
-
To execute the tests, please follow the commands:
pip install -r requirements.txtpython -m unittest discover -v tests/unit_tests -
To execute the code coverage, please follow the commands:
python -m coverage run --source=src/gtfs_canonical_validator -m unittest discover -s tests/unit_testscoverage html// Can be run after 1st commandcoverage report// Can be run after 1st command -
After the commands are run, you can check the coverage report in
htmlcov/index.html. Open the file in any browser, and it shows complete coverage details -
The terminal will show the output of coverage like this
> python -m unittest discover -v tests/unit_tests
test_validate_failed_upload (test_canonical_validator.TestCanonicalValidator) ... ok
test_validate_successful_upload (test_canonical_validator.TestCanonicalValidator) ... ok
test_validate_successful_upload (test_canonical_validator.TestCanonicalValidatorSuccessWithDatasets) ... ok
test_get_result_url (test_constants.TestConstants) ... ok
test_get_info_failure (test_mobility_data.TestMobilityData) ... ok
test_get_info_success (test_mobility_data.TestMobilityData) ... ok
test_get_mobility_data_failure (test_mobility_data.TestMobilityData) ... ok
test_get_mobility_data_success (test_mobility_data.TestMobilityData) ... ok
test_upload_failure (test_mobility_data.TestMobilityData) ... ok
test_upload_success (test_mobility_data.TestMobilityData) ... ok
----------------------------------------------------------------------
Ran 10 tests in 69.643s
OK
Coverage Report
> coverage report
Name Stmts Miss Cover
-----------------------------------------------------------------------
src/example.py 5 5 0%
src/gtfs_canonical_validator/__init__.py 20 0 100%
src/gtfs_canonical_validator/constants.py 5 0 100%
src/gtfs_canonical_validator/gtfs_validator.py 44 0 100%
src/gtfs_canonical_validator/version.py 1 0 100%
-----------------------------------------------------------------------
TOTAL 75 5 93%
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 gtfs_canonical_validator-0.0.8-py3-none-any.whl.
File metadata
- Download URL: gtfs_canonical_validator-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa1b413b07d9e43cf5da6e36378843b7656f25d1a144c55d3b5c0d1a325dcdfd
|
|
| MD5 |
c028930ece019d9dfdd1c72e4389083e
|
|
| BLAKE2b-256 |
535c2601a769f6b7f2a3ecac2bc83559e5dbca238bb69559e8e5976f29f5c8e0
|