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.3.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72aa760e2634dd435772e7b5e85847619ebb7aef9bc1fb718eecfd6399a29a3f |
|
MD5 | 2d360d067fffe9158d0d75a61527bfeb |
|
BLAKE2b-256 | 3735885bc86d4f0d48b2345c9b8ec2a49ec279b161261e2e5d9432f9f283dd18 |
Hashes for datagov_harvesting_logic-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9018b1207f6262d3a7027e6252bc7fa9cb2c7747ff76f63e0e5c03f0d4196c3a |
|
MD5 | 6f92525274afc8a03019ca09e64b2381 |
|
BLAKE2b-256 | ddb32c6e0140a316860b542fba1445bfe1b781cedab830b8deaa54dd2c25650b |