Tools to work with Amsterdam schema.
Project description
amsterdam-schema-tools
Set of libraries and tools to work with Amsterdam schema.
Install the package with: pip install amsterdam-schema-tools
Currently, the following cli commands are available:
- schema fetch tablenames
- schema create schema <dataset-id> <list-of-tablenames>
The tools expect either a DATABASE_URL environment variable or a command-line option --db-url
with a DSN.
The output is a json-schema output according to the Amsterdam schemas definition for the tables that are being processed.
The --prefix argument controls whether table prefixes are removed in the schema, because that is required for Django models.
As example we can generate a BAG schema. Point DATABASE_URL to bag_v11 database and then run :
schema fetch tablenames | sort | awk '/^bag_/{print}' | xargs schema create schema bag --prefix bag_ | jq
The jq formats it nicely and it can be redirected to the correct directory in the schemas repository directly.
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 Distributions
Built Distribution
File details
Details for the file amsterdam_schema_tools-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: amsterdam_schema_tools-0.0.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e45c5bcd46c98a721d68b051f64dd0e9997c1b39d69eae1c77da35afd64005 |
|
MD5 | 45a91a0d07c9a250f362acaec54823da |
|
BLAKE2b-256 | ab2e6919f2058a213b37805780f57d7329a95e7c98c350ff97762188d6fea2b3 |