Skip to main content

digistudio-qc-utils

CLI utilities for QFieldCloud: upload photos to Google Cloud Storage, clean old files, and more.

Features

  • Upload photos to GCP: Copy photos from QFieldCloud to a Google Cloud Storage bucket
  • Clean old photos: Remove photos older than a specified number of days from QFieldCloud
  • Flexible filtering: Use glob patterns to filter which files to process (default: *.jpg)
  • Dry-run mode: Test cleanup operations without actually deleting files
  • Progress reporting: See detailed progress and summary of operations

Installation

Requirements

  • Python 3.10 or higher
  • uv package manager

Install dependencies

uv sync

This will install the package in development mode with all dependencies.

Configuration

Environment Variables

Create a .env file or export these environment variables:

# QFieldCloud authentication (required for both commands)
export QFIELDCLOUD_USERNAME="your_username"
export QFIELDCLOUD_PASSWORD="your_password"

# Optional: QFieldCloud API URL (default: https://app.qfield.cloud/api/v1/)
export QFIELDCLOUD_URL="https://app.qfield.cloud/api/v1/"

# Alternative: use token authentication
export QFIELDCLOUD_TOKEN="your_token"

GCP Service Account

For the upload command, you need a GCP service account JSON file with permissions to write to Cloud Storage.

See .env.example for a complete list of environment variables.

Usage

Upload photos to GCP

Upload photos from QFieldCloud to a Google Cloud Storage bucket:

qc-to-gcp upload \
  --qc-project-id "your-qfield-project-id" \
  --gcp-bucket "your-gcs-bucket" \
  --gcp-bucket-directory "photos/2024" \
  --gcp-auth-file "path/to/service-account.json" \
  --qc-filter "*.jpg"

Options:

  • --qc-project-id: QFieldCloud project ID (required)
  • --gcp-bucket: GCP bucket name (required)
  • --gcp-bucket-directory: Directory path in bucket (required)
  • --gcp-auth-file: Path to GCP service account JSON file (required)
  • --qc-filter: File pattern to match (default: *.jpg)
  • --verbose, -v: Enable verbose logging

Features:

  • Intelligently compares file lists to skip existing files (only 2 API calls instead of N+1)
  • Handles subdirectories properly (DCIM/, files/, etc.)
  • Shows progress for each file
  • Provides detailed analysis summary before upload
  • Uses temporary storage for downloads

Clean old photos from QFieldCloud

Remove photos older than a specified number of days:

qc-clean \
  --qc-project-id "your-qfield-project-id" \
  --keep-days 15 \
  --qc-filter "*.jpg"

Options:

  • --qc-project-id: QFieldCloud project ID (required)
  • --keep-days: Keep files newer than this many days (default: 15)
  • --qc-filter: File pattern to match (default: *.jpg)
  • --dry-run: Show what would be deleted without actually deleting
  • --verbose, -v: Enable verbose logging and show detailed file list

Example with dry-run:

qc-clean \
  --qc-project-id "693d753d-2b71-44e1-892f-dd2e77852c4a" \
  --keep-days 30 \
  --qc-filter "*.jpg" \
  --dry-run

Development

Project structure

qc-utils/
├── src/qc_utils/
│   ├── __init__.py
│   ├── cli.py              # CLI entry points
│   ├── commands/
│   │   ├── clean.py        # Clean command implementation
│   │   └── upload.py       # Upload command implementation
│   └── core/
│       ├── filters.py      # File filtering utilities
│       ├── gcp_client.py   # GCP Storage client wrapper
│       └── qfield_client.py # QFieldCloud client wrapper
├── pyproject.toml
└── README.md

Run linting

uv run ruff check .
uv run ruff format .

Run type checking

uv run basedpyright

License

[Add your license here]

Credits

This tool replaces the historical bash/Python scripts with a modern CLI architecture.

Metadata

Release files for digistudio-qc-utils 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for digistudio-qc-utils 0.3.0
File Size Uploaded Provenance Actions
digistudio_qc_utils-0.3.0.tar.gz 9.7 kB Without provenance Details for digistudio_qc_utils-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for digistudio-qc-utils 0.3.0
File Interpreter ABI Platform Actions
digistudio_qc_utils-0.3.0-py3-none-any.whl Python 3 none any Details for digistudio_qc_utils-0.3.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / digistudio_qc_utils-0.3.0.tar.gz

Download URL digistudio_qc_utils-0.3.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
74f3f68b39841ec5f048f342a69f5706af0a4e50e0c8f58ac83d67fb402f252b
BLAKE2b-256 checksum
How to use checksums
84967cecf2d25e16dccc215d2f90642345da8ef4dcac4460e60e25575b876900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release files / digistudio_qc_utils-0.3.0-py3-none-any.whl

Download URL digistudio_qc_utils-0.3.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bedd9200125dfc1d0b6595288adffc921aea1c46e4b9ef9c7b0ecf992a8c94b6
BLAKE2b-256 checksum
How to use checksums
e39f84eb1f1ca8ee878b595020a9a78683e3a289548ba2d525922216cf76b586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Security for digistudio-qc-utils 0.3.0

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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page