Skip to main content

Snapvisor Python SDK

The official Python SDK and CLI for Snapvisor, the visual regression testing platform. Upload a directory of screenshots as a build from any Python test suite or CI pipeline — no Node.js required.

Snapvisor is a fork of Argos. This SDK speaks the same upload protocol as @snapvisor/core / @argos-ci/core, so it is a drop-in way to send builds from Python. It deliberately reads the same ARGOS_* environment variables the JavaScript SDKs use, so it works unchanged in pipelines already wired for Argos/Snapvisor.

Install

Coming to PyPI as snapvisor. Until then, install straight from GitHub:

pip install git+https://github.com/DevinoSolutions/snapvisor-python
# once published:
# pip install snapvisor

Requires Python 3.10+.

CLI usage

export ARGOS_TOKEN="<your-project-token>"
snapvisor upload ./screenshots
# Build created: https://app.snapvisor.io/<account>/<project>/builds/<n>

Options:

snapvisor upload <directory>
  --token TOKEN              Project token (default: $ARGOS_TOKEN)
  --build-name NAME          Build name for multi-build setups (default: $ARGOS_BUILD_NAME)
  --branch BRANCH            Git branch (default: $ARGOS_BRANCH, then `git branch --show-current`)
  --commit SHA               Git commit (default: $ARGOS_COMMIT, then `git rev-parse HEAD`)
  --reference-branch BRANCH  Baseline branch for comparison
  --api-base-url URL         API base URL (default: $ARGOS_API_BASE_URL, then the public API)
  --parallel-nonce NONCE     Shared nonce for parallel shards
  --parallel-total N         Total number of parallel shards (-1 = finalize manually)
  --parallel-index I         1-based index of this shard

Python API

from snapvisor import upload

result = upload(
    "screenshots",
    token="...",  # or set ARGOS_TOKEN
    build_name="my-suite",  # optional
    branch="main",  # optional; resolved from env/git otherwise
    commit="abc...def",  # optional; resolved from env/git otherwise
    reference_branch="main",  # optional baseline
)

print(result.build_url)  # https://app.snapvisor.io/.../builds/123
print(result.build_id)  # "123"
print(result.build_number)  # 123

upload() returns an UploadResult with build_url, build_id, and build_number. Every failure raises loudly: SnapvisorConfigError (bad/missing token, branch, commit, or directory), SnapvisorAPIError (non-2xx API response, carrying the status and server message), or SnapvisorUploadError (a screenshot upload was rejected).

Parallel builds

from snapvisor import upload, ParallelConfig

upload(
    "screenshots",
    parallel=ParallelConfig(nonce="ci-run-42", total=4, index=2),
)

Environment variables

The SDK reads the same variable names as the Argos/Snapvisor JavaScript SDKs, so it drops into existing pipelines. Explicit function/CLI arguments always take precedence over the environment.

Variable Purpose
ARGOS_TOKEN Project token used to authenticate (Authorization: Bearer …).
ARGOS_API_BASE_URL API base URL. Default https://api.snapvisor.io/v2/.
ARGOS_BRANCH Git branch. Falls back to git branch --show-current.
ARGOS_COMMIT Git commit SHA. Falls back to git rev-parse HEAD.
ARGOS_BUILD_NAME Build name for multi-build setups.
ARGOS_PARALLEL true to enable parallel mode (with the vars below).
ARGOS_PARALLEL_NONCE Shared nonce across parallel shards.
ARGOS_PARALLEL_TOTAL Total number of shards.
ARGOS_PARALLEL_INDEX 1-based index of the current shard.

The ARGOS_* names are intentional for drop-in compatibility with the existing Argos ecosystem. There are no SNAPVISOR_* aliases yet.

How it works

upload() implements the Snapvisor upload protocol:

  1. POST /v2/builds with the SHA-256 key and content type of every unique screenshot. The server replies with the build and signed upload targets for the screenshots it does not already have (deduplicated by content hash).
  2. Each missing screenshot is uploaded to its target — a proxied/presigned POST (with policy fields) or a presigned PUT.
  3. PUT /v2/builds/{id} finalizes the build with the full screenshot list and returns the build, including its url.

Relationship to Argos

Snapvisor is an independent visual-testing platform, forked from the open-source Argos project. This SDK is wire-compatible with the Argos upload protocol but is built and maintained for Snapvisor. It is not affiliated with or endorsed by Argos.

License

MIT © 2026 Devino Solutions Inc.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snapvisor-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snapvisor-0.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file snapvisor-0.1.0.tar.gz.

File metadata

  • Download URL: snapvisor-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for snapvisor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16020f5f17ab72a819b51c6efd2c4c2c7358e01ca4554c1a9861803a62481216
MD5 8e25affb32fc83bb191d2ac245d187fc
BLAKE2b-256 e1763b49c641133e06d57345f563cb055368cfb6175a31c2292ce65aa5a90df7

See more details on using hashes here.

Provenance

The following attestation bundles were made for snapvisor-0.1.0.tar.gz:

Publisher: publish.yml on DevinoSolutions/snapvisor-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snapvisor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: snapvisor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for snapvisor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dab3169900c0489e6c6aa217808ee17f8d6b93c45155dafecb4cb71083ee4868
MD5 568e55e8fef7597667d25bd40cedd3ad
BLAKE2b-256 162ffa61fce0ee1f0b3951c4ca108276fe97c2684df725ab1de183f28f2383e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for snapvisor-0.1.0-py3-none-any.whl:

Publisher: publish.yml on DevinoSolutions/snapvisor-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page