No project description provided
Project description
datagov-harvesting-logic
This is a library that will be utilized for metadata extraction, validation, transformation, and loading into the data.gov catalog.
Features
- Extract
- General purpose fetching and downloading of web resources.
- Catered extraction to the following data formats:
- DCAT-US
- Validation
- DCAT-US
jsonschema
validation using draft 2020-12.
- DCAT-US
- Load
- DCAT-US
- Conversion of dcat-us catalog into ckan dataset schema
- Create, delete, update, and patch of ckan package/dataset
- DCAT-US
Requirements
This project is using poetry
to manage this project. Install here.
Once installed, poetry install
installs dependencies into a local virtual environment.
Testing
CKAN load testing
- CKAN load testing doesn't require the services provided in the
docker-compose.yml
. - catalog-dev is used for ckan load testing.
- Create an api-key by signing into catalog-dev.
- Create a
credentials.py
file at the root of the project containing the variableckan_catalog_dev_api_key
assigned to the api-key. - Run tests with the command
poetry run pytest ./tests/load/ckan
Harvester testing
- These tests are found in
extract
, andvalidate
. Some of them rely on services in thedocker-compose.yml
. Run using dockerdocker compose up -d
and with the commandpoetry run pytest --ignore=./tests/load/ckan
.
If you followed the instructions for CKAN load testing
and Harvester testing
you can simply run poetry run pytest
to run all tests.
Comparison
-
./tests/harvest_sources/ckan_datasets_resp.json
- Represents what ckan would respond with after querying for the harvest source name
-
./tests/harvest_sources/dcatus_compare.json
-
Represents a changed harvest source
-
Created:
-
datasets[0]
+ "identifier" = "cftc-dc10"
-
-
Deleted:
-
datasets[0]
- "identifier" = "cftc-dc1"
-
-
Updated:
-
datasets[1]
- "modified": "R/P1M" + "modified": "R/P1M Update"
-
datasets[2]
- "keyword": ["cotton on call", "cotton on-call"] + "keyword": ["cotton on call", "cotton on-call", "update keyword"]
-
datasets[3]
"publisher": { "name": "U.S. Commodity Futures Trading Commission", "subOrganizationOf": { - "name": "U.S. Government" + "name": "Changed Value" } }
-
-
-
./test/harvest_sources/dcatus.json
- Represents an original harvest source prior to change occuring.
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
Hashes for datagov_harvesting_logic-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b1bdcc28aece8bde1c5fc312513dcd6a4356a8e986e630b2230569cb852104 |
|
MD5 | ec2c2895f457b70acc22f31c86342a01 |
|
BLAKE2b-256 | 87f857f7277ff9ab6d98bd1ef32b9ea8c6bd8f19894287bd2e06dbac0fd2edc1 |
Hashes for datagov_harvesting_logic-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d16f8813b466901a1497f982e362a974c2409c76a7a57ec00a286f0135146aa |
|
MD5 | 3f5aa1a60643b4e6cc0ad239f07c97b0 |
|
BLAKE2b-256 | 5f19be8215f899a2e6695cd0237ce838213fdb8d800619be70669d6c4b5fa52c |