vestapol
vestapol is a Python package that loads data from the web and deploys a corresponding external table definition, so that the data can be queried using standard SQL.
"Vestapol" is an open D Major tuning for the guitar. It is named after a 19th-century composition distributed in some of the earliest instructional guides for guitar.
Usage
from vestapol.web_resources.csv_resource import CSVResource
from vestapol.destinations.gcp_destination import GoogleCloudPlatform
nyt_covid_data_2022 = CSVResource(
name="nyt_covid19_us_counties_2022",
base_url="https://raw.githubusercontent.com/",
endpoint="nytimes/covid-19-data/master/rolling-averages/us-counties-2022.csv",
version="v0",
skip_leading_rows=1,
)
destination = GoogleCloudPlatform()
nyt_covid_data_2022.load(destination)
tablename = destination.create_table(nyt_covid_data_2022)
from google.cloud import bigquery
client = bigquery.Client()
query = f"""
select date, state, county, cases_avg_per_100k
from `{tablename}`
where requested_at = '{nyt_covid_data_2022.requested_at}'
limit 5
"""
query_job = client.query(query)
for row in query_job.result():
print(row)
Prerequisites
Installation of this project requires Poetry 1.2+ and Python version 3.9+.
Older version of poetry can be updated by running:
poetry self update
poetry --version
Installation
Install vestapol and its dependencies by running:
poetry install
Testing
Run tests with the following command:
poetry run pytest
Environment Variables
GCS_BUCKET_NAME: the Google Cloud Storage bucket where data is loaded (e.g.inq-warehouse-waligob)GCS_ROOT_PREFIX: the GCS prefix where data is loaded (e.g.data_catalog)GBQ_PROJECT_ID: the BigQuery project identifier (e.g.inq-warehouse)GBQ_DATASET_ID: the BigQuery dataset where external tables will be created (e.g.data_catalog_waligob)GBQ_DATASET_LOCATION: the BigQuery dataset location (e.g.US)GOOGLE_APPLICATION_CREDENTIALS=: location of the GCS service account keyfile (e.g.~/inq-warehouse-f0962a57089e-inf.json)
Publishing to PyPI
Instructions for pushing new versions of vestapol to PyPI:
-
Update
CHANGELOG.md. Include Additions, Fixes, and Changes. -
Update project version using either a valid PEP 440 string or a valid bump rule following Semantic Versioning.
poetry version <version string or bump rule>
Metadata
Release files for vestapol 0.0.29
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vestapol-0.0.29.tar.gz | 12.0 kB | Without provenance | Details for vestapol-0.0.29.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vestapol-0.0.29-py3-none-any.whl | Python 3 | none | any | Details for vestapol-0.0.29-py3-none-any.whl |
Total release size: 28.3 kB
Release files / vestapol-0.0.29.tar.gz
| Download URL | vestapol-0.0.29.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0db27abdd8d225c97fd673ec040cd7153fb9caae86842a8b95068db301ceff6e
|
|
BLAKE2b-256 checksum How to use checksums |
436b07ab7b7674d1bf216906d2350cf60c09ec8f344224b1e66e0a996a2e55ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.9.21 Linux/6.17.0-1022-azure
|
Release files / vestapol-0.0.29-py3-none-any.whl
| Download URL | vestapol-0.0.29-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff09f9f974af0f4476e668e7a5d274d4c78bfbaf293d57f8c65262f995d9ebb5
|
|
BLAKE2b-256 checksum How to use checksums |
6f041aaa13d616120691cd34d4c4ccc704088547ded305c9e56069654c2e9bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.9.21 Linux/6.17.0-1022-azure
|
Security for vestapol 0.0.29
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.