This release is a pre-release and may not be stable for production use.
Dataform CLI
🎯 Objective & Motivation
dataform_cli is a lightweight Python-based command-line interface (CLI) designed to simplify file synchronization between local directories and Google Cloud Dataform workspaces. The primary goal is to accelerate development workflows by allowing easy push and pull operations of .sqlx, .js, and other source files while respecting .gitignore rules.
It helps developers:
- Avoid repetitive UI interactions.
- Manage versioning consistently with
.gitignore. - Automate CI/CD tasks for Dataform repositories.
🚀 Features
- ✅ Push local files to a specified Dataform workspace.
- ✅ Pull files from a Dataform workspace to a local directory.
- ✅ Support for
.gitignorefiltering. - ✅ Optional automatic
commitandgit pushon file upload. - ✅ Fixed-width logging with timestamps and log levels.
- ✅ Easy integration with Python projects or automation scripts.
💻 Usage Examples
Push files to Dataform
python -m surquest.GCP.dataform_cli push \
--project-id=my-gcp-project \
--region=europe-west1 \
--repository-id=my-repo \
--workspace-id=dev \
--source-dir=./src
Optional flags:
--no-delete-remote-files: Do not remove remote files not present locally.--no-autocommit: Skip auto-committing workspace changes.--no-autopush: Skip pushing git commits.
Pull files from Dataform
python -m surquest.GCP.dataform_cli pull \
--project-id=my-gcp-project \
--region=europe-west1 \
--repository-id=my-repo \
--workspace-id=dev \
--target-dir=./local_workspace
🐳 Using the CLI via Docker
You can run the CLI inside a Docker container, mounting your local source or target directory as a volume, and passing your Google credentials via an environment variable.
docker run --rm -it \
-v /path/to/local/source:/app/source \
-e GOOGLE_APPLICATION_CREDENTIALS=/app/creds.json \
-v /path/to/your/creds.json:/app/creds.json:ro \
your-docker-image-name \
python -m surquest.GCP.dataform_cli push \
--project-id=my-gcp-project \
--region=europe-west1 \
--repository-id=my-repo \
--workspace-id=dev \
--source-dir=/app/source
Similarly, for pulling files:
docker run --rm -it \
-v /path/to/local/target:/app/target \
-e GOOGLE_APPLICATION_CREDENTIALS=/app/creds.json \
-v /path/to/your/creds.json:/app/creds.json:ro \
your-docker-image-name \
python -m surquest.GCP.dataform_cli pull \
--project-id=my-gcp-project \
--region=europe-west1 \
--repository-id=my-repo \
--workspace-id=dev \
--target-dir=/app/target
Notes:
- Replace
/path/to/local/sourceand/path/to/local/targetwith your actual local paths. - The service account key JSON file is mounted inside the container at
/app/creds.json. - The
GOOGLE_APPLICATION_CREDENTIALSenvironment variable points to this file for authentication. your-docker-image-nameshould be replaced with your built Docker image tag.
🛠 Requirements
- Python 3.8+
google-cloud-dataform- Service account or user credentials with access to the Dataform API.
📬 Contact & Support
For issues, improvements, or collaboration, please contact:
Michal Švarc ✉️ [michal.svarc@surquest.com] 📞 +420 724 031 631
Metadata
Release files for surquest-GCP-dataform-cli 0.0.1rc2
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 |
|---|---|---|---|---|
| surquest_gcp_dataform_cli-0.0.1rc2.tar.gz | 13.5 kB | Without provenance | Details for surquest_gcp_dataform_cli-0.0.1rc2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| surquest_gcp_dataform_cli-0.0.1rc2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for surquest_gcp_dataform_cli-0.0.1rc2-py2.py3-none-any.whl |
Total release size: 27.7 kB
Release files / surquest_gcp_dataform_cli-0.0.1rc2.tar.gz
| Download URL | surquest_gcp_dataform_cli-0.0.1rc2.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd5faadeee48054398e995ec4f446e613c49d8ed57307ae43cc05bdc1f388cd6
|
|
BLAKE2b-256 checksum How to use checksums |
d03ff8ef7002f7490030eab4a7163158cd7d8ea8a684d23b8dd4addf52b71efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / surquest_gcp_dataform_cli-0.0.1rc2-py2.py3-none-any.whl
| Download URL | surquest_gcp_dataform_cli-0.0.1rc2-py2.py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d1e31b84361cf9bf5dca4c4dd652e36aa3eda51c3c91e9cc91e213358ecfc078
|
|
BLAKE2b-256 checksum How to use checksums |
429112488f6ea13641a47af24119a5cd5c5cf86b5520d164bda3c7731691e2ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for surquest-GCP-dataform-cli 0.0.1rc2
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.