Skip to main content

voplica-api

The Voplica API for Python: every message, enum and service of the published protobuf definitions, generated with grpcio-tools, with a type stub (.pyi) for every module. The import root is voplica, as in the definitions' own paths: voplica/api/payment/payment.proto is the module voplica.api.payment.payment_pb2, and its gRPC stubs are voplica.api.payment.payment_pb2_grpc.

The documentation: https://docs.voplica.com/clients/

Install

pip install voplica-api

Python 3.10 or later. The package depends on protobuf and grpcio.

A first call

The native gRPC endpoint opens soon; today the JSON API is served, and these modules give you type-safe requests and responses for it: build the request message, send it as JSON (protojson, the Connect protocol's JSON mode), and parse the answer into its response message. Every RPC is a POST of its request, as JSON, to https://api.voplica.com/<package>.<Service>/<Method>, with your API key in the Authorization header:

import os
import urllib.request

from google.protobuf import json_format
from voplica.api.payment import payment_pb2

API = "https://api.voplica.com"


def call(method, request, response):
    http_request = urllib.request.Request(
        f"{API}/{method}",
        data=json_format.MessageToJson(request).encode(),
        method="POST",
        headers={
            "Content-Type": "application/json",
            "Authorization": f"Bearer {os.environ['VOPLICA_API_KEY']}",
        },
    )
    with urllib.request.urlopen(http_request) as answer:
        return json_format.Parse(answer.read(), response, ignore_unknown_fields=True)


info = call(
    "voplica.api.payment.PaymentService/GetBillingInfo",
    payment_pb2.GetBillingInfoRequest(),
    payment_pb2.GetBillingInfoResponse(),
)
print(info.billing_info.permanent_credits_milli)

ignore_unknown_fields=True keeps a call working when a later version of the API adds a field to its response. A failed call raises urllib.error.HTTPError; its body is the JSON error, with its code and message. Use your key on a server only: a key in an app that other people install can be read by anyone.

gRPC

Each *_pb2_grpc module holds its services' client stubs (PaymentServiceStub), servicers and registration functions, generated for the native gRPC endpoint. Until that endpoint opens, call the API as JSON, as above.

Types

Every module has its .pyi stub and the package carries py.typed, so type checkers such as mypy and Pyright see every message's fields. For mypy, also install types-protobuf.

Versions

The package's version is the API's version (VERSION at the root of voplica/api), and each version is tagged v<VERSION> there. To stay on one version, pin it exactly: voplica-api==<VERSION>.

Generate it yourself

scripts/generate.py writes the package from the definitions in the repository's proto/ with the pinned generator, and the build makes the source distribution and the wheel:

git clone https://github.com/voplica/api.git
cd api/clients/python
python -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python scripts/generate.py
.venv/bin/python -m build --no-isolation

Licence

Licensed under the Apache License 2.0.

Metadata

Release files for voplica-api 1.0.1

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

Source distribution (sdist)

Source distribution for voplica-api 1.0.1
File Size Uploaded Provenance
voplica_api-1.0.1.tar.gz 303.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for voplica-api 1.0.1
File Interpreter ABI Platform
voplica_api-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 816.9 kB

Release files / voplica_api-1.0.1.tar.gz

Download URL voplica_api-1.0.1.tar.gz
Size 303.5 kB
Tags Source
SHA-256 checksum
How to use checksums
86bf90c6e3134452eb7e9268c31abc354d1593481299159af42d5cd81940fc01
BLAKE2b-256 checksum
How to use checksums
0bb4ddcff80e68dfe5b7c204f9e0a10e8974b9df4235b61ade08058013980245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / voplica_api-1.0.1-py3-none-any.whl

Download URL voplica_api-1.0.1-py3-none-any.whl
Size 513.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da26ea162560c3b302b33f9f30f2ae12c0a61661ebbcf60f8d3f01713f3cc688
BLAKE2b-256 checksum
How to use checksums
a8ff2b1d0fc9caa993e019ef21e89c964eee90981f05510b5e4c4ea513fd63ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for voplica-api 1.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for voplica_api-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

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

1.0.1 This release

2 release files Full 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