enciva
Official Python SDK and CLI for the Enciva geospatial processing platform and API.
enciva is an HTTPS client for an existing Enciva installation. Processing
stays on the server. It does not require Docker, GDAL, DuckDB, QGIS, Go, or
a local Enciva server.
Fuller product documentation: Enciva Guides, including the command-line client.
Install
This package is published as enciva:
pip install enciva
or
pipx install enciva
From a source checkout, Python 3.10 or newer:
cd clients/python
python -m pip install -e .
That provides the enciva executable and the enciva Python package.
Authenticate
Create a Personal Access Token in Enciva → Account → API Tokens, then:
enciva auth login
Enter the Enciva URL (your installation origin, for example
https://enciva.example.com — not an /api/v1 path) and the token.
Token input is hidden. On success: Authenticated successfully.
Use
enciva jobs list
enciva sources list
enciva destinations list
enciva recipes list
enciva jobs run <id>
enciva workspace upload roads.gpkg
enciva transformations list
--json writes machine-readable JSON to stdout:
enciva jobs list --json
ID=$(enciva workspace upload roads.gpkg --json | jq -r '.id')
Automation
export ENCIVA_URL=https://enciva.example.com
export ENCIVA_TOKEN=gjp_...
enciva jobs list --json
Hosted Enciva is https://app.enciva.com. A self-hosted installation uses
its own origin. Pass that origin to the client.
Credential precedence, highest wins:
--url/--tokenENCIVA_URL/ENCIVA_TOKEN- Saved configuration
Configuration
enciva config set-url and enciva config set-token write a user-level
file, never the current working directory:
| OS | Path |
|---|---|
| Linux | ~/.config/enciva/config.toml ($XDG_CONFIG_HOME if set) |
| macOS | ~/Library/Application Support/enciva/config.toml |
| Windows | %APPDATA%\enciva\config.toml |
That file may contain a Personal Access Token. Permissions are set to 0600
on Unix. enciva config show prints a masked token only.
Logout removes the local token. It does not revoke the PAT. Revoke tokens in Account → API Tokens.
enciva auth status
enciva auth logout
Commands
enciva --help
enciva --version
enciva auth …
enciva config …
enciva sources list|get|create|delete
enciva destinations list|get|create|delete
enciva jobs list|get|run|enable|disable|delete|create|update|runs|retry
enciva recipes list|get|create|delete
enciva workspace upload|info|preview|convert|download
enciva workspace transform get|set|clear|preview
enciva transformations list|show
Workspace processing is remote. Discover operations with
enciva transformations list and enciva transformations show <id>.
enciva workspace transform set <id> --file pipeline.json
{
"layers": ["apiary"],
"operations": [
{"type": "buffer", "distance": 10, "units": "source"}
]
}
--debug prints HTTP method, URL, and status to stderr (never the token).
--insecure disables TLS verification for development certificates only and is
not saved. TLS verification is on by default.
enciva jobs create --file job.json sends the public API body
(POST /api/v1/jobs). Existing Job JSON without pipeline is unchanged
and keeps legacy/inferred stage presence.
Optional Canvas stage flags:
{
"name": "Neighborhoods",
"source_id": "…",
"transform_mode": "sql",
"sql": "SELECT * FROM source WHERE population > 1000",
"output_format": "GeoJSON",
"destination_id": "…",
"destination_target": {"schema": "public", "table": "neighborhoods", "write_mode": "replace"},
"schedule": {"kind": "daily", "timezone": "UTC", "hour": 2, "minute": 0},
"pipeline": {
"transform": false,
"convert": false,
"python": false
}
}
pipeline |
Meaning |
|---|---|
| omitted | Legacy/inferred behavior (stages stay present) |
{} |
Legacy/inferred behavior (stages stay present) |
explicit false |
That stage is absent |
explicit true |
That stage is present |
Create and update preserve explicit false flags. enciva jobs get
shows recorded stages when the Job includes pipeline.
Python
Package version 0.1.2 speaks the Enciva 0.9.10 public API. The SDK keeps its own version number.
Create a Personal Access Token in Enciva → Account → API Tokens. The examples below use placeholders. Do not commit a real token.
Hosted Enciva:
import os
from enciva import Enciva
client = Enciva(
url="https://app.enciva.com",
token=os.environ["ENCIVA_TOKEN"],
)
print(client.me())
Self-hosted Enciva uses the same client and a different origin:
client = Enciva(
url="https://enciva.example.com",
token=os.environ["ENCIVA_TOKEN"],
)
url and token may also come from ENCIVA_URL and ENCIVA_TOKEN when
omitted. Explicit constructor arguments always win. The token is sent as
Authorization: Bearer and is never logged, stored, or included in
exceptions.
List saved Sources and Destinations:
sources = client.sources.list()
destinations = client.destinations.list()
Create a manual Job, run it, and read the result. run calls
POST /api/v1/jobs/{id}/run. wait=True polls when the first response is
still queued or running. Run Now delivers to the Destination in the Job.
job = client.jobs.create({
"name": "Neighborhoods",
"source_id": sources[0]["id"],
"output_format": "GeoJSON",
"destination_id": destinations[0]["id"],
"destination_target": {
"schema": "public",
"table": "neighborhoods",
"write_mode": "replace",
},
"schedule": {"kind": "manual"},
"enabled": False,
})
run = client.jobs.run(job["id"], wait=True)
print(run["id"], run["status"])
latest = client.jobs.get_run(job["id"], run["id"])
history = client.jobs.list_runs(job["id"])
Preview a schedule without saving it, and search timezone names:
client.jobs.preview_schedule(
{"kind": "daily", "timezone": "UTC", "hour": 2, "minute": 0},
enabled=False,
)
client.jobs.timezones("utc")
schedule.kind may be manual, interval, hourly, daily, weekly,
monthly, or cron. A saved Job may also include a prepare plan. The
field is sent unchanged.
The AI Assistant PAT routes build an unsaved draft. They require
pipelines:compose. Provider keys stay on the server. Creating and editing
providers stays in the browser session.
client.assistant.list_providers()
draft = client.assistant.generate({
"instructions": "Convert neighborhoods to GeoJSON.",
"timezone": "UTC",
})
Upload
ws = client.workspaces.upload("roads.gpkg")
print(ws.id, ws.status, ws.layers)
A Workspace preparation plan uses that Workspace id on
POST /api/v1/jobs/{id}/prepare. None clears it:
ws.prepare({
"version": 1,
"input_kind": "text",
"output_kind": "geojson",
"operations": [{"op": "extract_json"}],
})
ws.prepare(None)
Preview
rows = ws.preview_data("roads", limit=50)
geojson = ws.preview_map("roads")["geojson"]
preview_data and preview_map return the server JSON, including fields,
counts, truncation, and CRS. preview_map()["geojson"] is a GeoJSON
FeatureCollection. Visualization is up to the caller.
Transform
Discover operations from the server (do not hard-code a catalog):
ops = client.transformations.list()
ws.set_transformations(
layers=["roads"],
operations=[{"type": "buffer", "distance": 10, "units": "source"}],
)
SQL and Python are sibling fields, not operation types:
ws.set_transformations(layers=["roads"], sql="SELECT * FROM source")
ws.set_transformations(python={"script": script, "filename": "script.py"})
ws.clear_transformations()
Transformed preview
Uses the stored pipeline. The SDK does not resend or execute it locally.
ws.preview_transformed_data("roads", limit=50)
ws.preview_transformed_map("roads")
Convert and download
ws.convert(output_format="GeoJSON", layers=["roads"])
output = ws.download("roads.geojson")
Download streams to disk. An existing file is not overwritten unless you pass
overwrite=True. Convert is currently synchronous (status=completed).
Saved Sources, Destinations, Recipes, and Jobs keep their existing methods.
Job create/update accept the same public body, including optional pipeline
flags. Helpers inspect recorded stages without inventing missing keys:
from enciva import (
Enciva,
PipelineStages,
job_pipeline,
job_write_body,
pipeline_stages,
stage_included,
)
jobs = client.jobs.list()
client.jobs.run(jobs[0]["id"])
created = client.jobs.create({
"name": "Neighborhoods",
"source_id": "...",
"output_format": "GeoJSON",
"pipeline": pipeline_stages(transform=True, convert=True, python=False),
})
job_pipeline(created)
stage_included(created, "python")
Omitting pipeline, or sending pipeline: {}, keeps /api/v1 legacy/inferred
behavior. Explicit false removes that stage; leftover operations, format, or
Python on the body do not restore it.
Errors
try:
ws.preview_transformed_map("other_layer")
except ValidationError as exc:
print(exc.status_code, exc.code, exc.message, exc.details)
timeout (default 30s) is the ordinary HTTP timeout. run_timeout (default
600s) is used for upload, preview, convert, and download.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure (including a finished Run with status failed) |
| 2 | Usage / local config |
| 3 | Authentication (401 / missing credentials) |
| 4 | Authorization (403 / missing PAT scope) |
| 5 | Not found (404) |
| 6 | Validation (400 / 409 / 422) |
| 7 | Network (DNS, connection refused, TLS, timeout) |
| 8 | Enciva server error (5xx) |
Security
- PAT is sent as
Authorization: Bearer, never as a query parameter - Full PAT is not printed by
config show,auth status, or default errors - Source and Destination secrets from the API are not displayed
Metadata
Release files for enciva 0.1.2
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 |
|---|---|---|---|---|
| enciva-0.1.2.tar.gz | 47.9 kB | Without provenance | Details for enciva-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| enciva-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for enciva-0.1.2-py3-none-any.whl |
Total release size: 85.9 kB
Release files / enciva-0.1.2.tar.gz
| Download URL | enciva-0.1.2.tar.gz |
|---|---|
| Size | 47.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49c6c98e86d50a002a654f4efae711bd8a60a02fc683fa285fe483958975bbb4
|
|
BLAKE2b-256 checksum How to use checksums |
1d2288b09813d8718156c08329bbf0f8b001850285a51bc51cf84f49ce6a5b9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Release files / enciva-0.1.2-py3-none-any.whl
| Download URL | enciva-0.1.2-py3-none-any.whl |
|---|---|
| Size | 38.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e71b2f6c05bfae72a239bd0f17fda9c73f6d276fcf69b9ab2c2c2b3e4b1be2ba
|
|
BLAKE2b-256 checksum How to use checksums |
b83ce4fedc5c5335bcc4362a03e037f18858b1b6463c6f924708146fcbf1ede0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.3
|
Security for enciva 0.1.2
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.