CLI tool for synchronizing points, equipment, and entities from ACE FlightDeck to SkySpark
Project description
ACE SkySpark CLI
CLI tool for synchronizing points, equipment, and entities from ACE FlightDeck to SkySpark with idempotent operations and haystack tag management.
Features
- Idempotent Synchronization - Safe to run multiple times, creates or updates entities as needed
- Haystack Ref Tracking - Uses
haystackReftags to maintain relationships between ACE and SkySpark - Resilient Operations - Continues processing even if individual batches fail
- Batch Processing - Configurable batch sizes for optimal performance
- Historical Data Sync - Write historical timeseries data from ACE to SkySpark
- Job Configuration Files - YAML/JSON job files for reusable configurations
- Flexible Credential Management - CLI args, job files, or environment variables
- Timezone Validation - Check and report timezone inconsistencies
Installation
pip install ace-skyspark-cli
Quick Start
Initialize Configuration
ace-skyspark-cli init
Edit the generated .env file with your credentials:
FLIGHTDECK_JWT=your-jwt-token
FLIGHTDECK_API_URL=https://flightdeck.aceiot.cloud/api
SKYSPARK_URL=http://localhost:8080/api
SKYSPARK_PROJECT=myProject
SKYSPARK_USER=admin
SKYSPARK_PASSWORD=secret
Sync Points to SkySpark
# Sync configured points for a site
ace-skyspark-cli sync --site "Building A"
# Dry run to see what would be synced
ace-skyspark-cli sync --site "Building A" --dry-run
# Sync all points (including non-configured)
ace-skyspark-cli sync --site "Building A" --sync-all
# Limit sync to first 10 points
ace-skyspark-cli sync --site "Building A" --limit 10
Write Historical Data
# Write historical data for a date range
ace-skyspark-cli write-history --site "Building A" \
--start 2025-11-01 \
--end 2025-11-02
# With custom chunk size
ace-skyspark-cli write-history --site "Building A" \
--start 2025-11-01T00:00:00Z \
--end 2025-11-01T23:59:59Z \
--chunk-size 5000
Sync Refs from SkySpark
# Sync haystack refs back to ACE FlightDeck
ace-skyspark-cli sync-refs-from-skyspark
# For specific site only
ace-skyspark-cli sync-refs-from-skyspark --site "Building A"
Job Configuration Files
Generate and use job configuration files for complex workflows:
# Generate template for all commands
ace-skyspark-cli generate-job-template
# Generate template for specific command
ace-skyspark-cli generate-job-template --command sync --output sync-job.yaml
# Use job file
ace-skyspark-cli sync --job-file sync-job.yaml
# Override job file parameters
ace-skyspark-cli sync --job-file sync-job.yaml --limit 50 --dry-run
Example job file:
credentials:
flightdeck_jwt: your-jwt-token
skyspark_url: http://localhost:8080/api
skyspark_project: myProject
skyspark_user: admin
skyspark_password: secret
sync:
site: Building A
dry_run: false
limit: null
sync_all: false
batch_size: 500
See Job Configuration Guide for complete documentation.
Commands
sync
Synchronize points from FlightDeck to SkySpark for a specific site.
Options:
--site TEXT- Site name to synchronize (required)--dry-run- Perform dry run without making changes--limit INT- Limit number of points to sync--sync-all- Sync all points including non-configured--batch-size INT- Override batch size--job-file PATH- Load parameters from job file
write-history
Write historical timeseries data from ACE to SkySpark.
Options:
--site TEXT- Site name (required)--start TEXT- Start time in ISO format (required)--end TEXT- End time in ISO format (required)--limit INT- Limit number of points to process--chunk-size INT- Samples per write chunk (default: 1000)--dry-run- Show what would be written--job-file PATH- Load parameters from job file
sync-refs-from-skyspark
Sync haystack refs from SkySpark back to ACE FlightDeck.
Options:
--site TEXT- Optional site filter--dry-run- Perform dry run--job-file PATH- Load parameters from job file
check-timezones
Check for timezone inconsistencies in SkySpark points.
Options:
--site TEXT- Check specific site--dry-run- Dry run mode--job-file PATH- Load parameters from job file
generate-job-template
Generate job configuration file templates.
Options:
--command TEXT- Command to generate template for (sync, write-history, etc.)--output PATH- Output file path--format TEXT- Output format (yaml or json)--force- Overwrite existing file
init
Initialize a new .env configuration file.
version
Display version and configuration information.
Credential Management
Credentials can be provided via three methods (in order of precedence):
- CLI Arguments - Global flags like
--flightdeck-jwt,--skyspark-user - Job Files - In the
credentialssection - Environment Variables - From
.envfile
Example using CLI arguments:
ace-skyspark-cli --flightdeck-jwt "new-token" \
--skyspark-project "production" \
sync --site "Building A"
Development
Setup
# Clone repository
git clone https://github.com/ACE-IoT-Solutions/ace-skyspark-cli.git
cd ace-skyspark-cli
# Install with development dependencies
uv sync --all-extras --group dev
Run Tests
# Run unit tests
uv run pytest -m unit
# Run integration tests (requires FlightDeck and SkySpark)
uv run pytest -m integration
# Run all tests with coverage
uv run pytest --cov=ace_skyspark_cli
Linting and Type Checking
# Run linting
uv run ruff check .
uv run ruff format .
# Run type checking
uv run pyrefly check src tests
Architecture
Key Features
- Idempotent Operations - Uses
haystackReftags to track existing entities - Batch Processing - Processes points in configurable batches for efficiency
- Resilient Sync - Stores refs after each successful batch, safe to re-run
- Session Management - Proper async lifecycle management for clients
- Structured Logging - JSON-formatted logs with structured data
Data Flow
-
Sync Command
- Fetch points from ACE FlightDeck API
- Check for existing SkySpark entities using
haystackReftags - Create new entities or update existing ones
- Store SkySpark refs back to ACE as KV tags
-
Write History Command
- Read timeseries data from ACE FlightDeck
- Map point names to SkySpark IDs using
haystack_entityReftags - Write data to SkySpark history in chunks
-
Sync Refs Command
- Read points from SkySpark with
ace_topictags - Extract SkySpark refs (id, siteRef, equipRef)
- Write refs back to ACE FlightDeck as KV tags
- Read points from SkySpark with
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please open an issue or pull request.
Support
- Issues: GitHub Issues
- Documentation: Job Configuration Guide
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ace_skyspark_cli-0.11.4.tar.gz.
File metadata
- Download URL: ace_skyspark_cli-0.11.4.tar.gz
- Upload date:
- Size: 88.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e940db38608ef33ee41b04f11a47e166e771405529d7ad772bf3365c3e1ea65a
|
|
| MD5 |
d8ed0afdbb9b980e1205702f58add437
|
|
| BLAKE2b-256 |
5c452b4bd45e001ecf782416d743347069989a007990994f39dce3266336e85a
|
Provenance
The following attestation bundles were made for ace_skyspark_cli-0.11.4.tar.gz:
Publisher:
publish.yml on ACE-IoT-Solutions/ace-skyspark-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ace_skyspark_cli-0.11.4.tar.gz -
Subject digest:
e940db38608ef33ee41b04f11a47e166e771405529d7ad772bf3365c3e1ea65a - Sigstore transparency entry: 661627940
- Sigstore integration time:
-
Permalink:
ACE-IoT-Solutions/ace-skyspark-cli@3fb528f06c7964ec2eede76498c5ebd1125d930c -
Branch / Tag:
refs/tags/v0.11.4 - Owner: https://github.com/ACE-IoT-Solutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3fb528f06c7964ec2eede76498c5ebd1125d930c -
Trigger Event:
release
-
Statement type:
File details
Details for the file ace_skyspark_cli-0.11.4-py3-none-any.whl.
File metadata
- Download URL: ace_skyspark_cli-0.11.4-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec7486d8731fe6b616ed28305ebee4fec6011d6e99958483f80f3296bbd208ec
|
|
| MD5 |
c4208430488f4c990749533bee9bf058
|
|
| BLAKE2b-256 |
59500a79cb82fac23515c1e75aacf6251b35a6b270293fbe7fd737543f1c9efd
|
Provenance
The following attestation bundles were made for ace_skyspark_cli-0.11.4-py3-none-any.whl:
Publisher:
publish.yml on ACE-IoT-Solutions/ace-skyspark-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ace_skyspark_cli-0.11.4-py3-none-any.whl -
Subject digest:
ec7486d8731fe6b616ed28305ebee4fec6011d6e99958483f80f3296bbd208ec - Sigstore transparency entry: 661627945
- Sigstore integration time:
-
Permalink:
ACE-IoT-Solutions/ace-skyspark-cli@3fb528f06c7964ec2eede76498c5ebd1125d930c -
Branch / Tag:
refs/tags/v0.11.4 - Owner: https://github.com/ACE-IoT-Solutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3fb528f06c7964ec2eede76498c5ebd1125d930c -
Trigger Event:
release
-
Statement type: