Skip to main content

Slotlock for Python

A client for Slotlock's REST API: the agent tools and the application API, one method per operation. Python 3.10+, standard library only.

pip install "git+https://github.com/PILOTAAI/slotlock.git#subdirectory=clients/python"
from slotlock import Client, SlotlockError

slotlock = Client("https://calendar.example.com", api_key)  # a key with the admin scope
van = slotlock.create_resource(external_ref="vehicle-42", timezone="Europe/London")["resource"]

hold = slotlock.acquire_hold(
    resource_id=van["id"], start="2027-03-29T09:00:00Z", end="2027-03-29T10:00:00Z", ttl_seconds=600
)["hold"]
try:
    slotlock.acquire_hold(
        resource_id=van["id"], start="2027-03-29T09:30:00Z", end="2027-03-29T10:30:00Z", ttl_seconds=600
    )
except SlotlockError as error:
    assert (error.status, error.code) == (409, "overlap")

reservation = slotlock.confirm_hold(hold["id"])["reservation"]
  • Every method returns the response body as a dict; client.call("slotlock_...", {...}) runs an operation by name.
  • A refusal raises SlotlockError with status, code and retry_after.
  • update_event(..., description=None) clears the description; leaving it out keeps it.
  • Client(url, key, timeout=30.0, allow_insecure=False, user_agent=None). Plain HTTP is refused except to localhost.

The clients overview covers keys, errors and testing.

Metadata

Release files for slotlock 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 slotlock 0.3.0
File Size Uploaded Provenance Actions
slotlock-0.3.0.tar.gz 16.4 kB With provenance Details for slotlock-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 28.1 kB

Release files / slotlock-0.3.0.tar.gz

Download URL slotlock-0.3.0.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1ad6ad22d793e0701ae3efeca3205c2f54e516395d0bb11c08b3b4d88fb039c7
BLAKE2b-256 checksum
How to use checksums
a8e002a9c22592aae8f9bb6dc5c847eac6b1a6292975d0cb8f962ba854bd4e97
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 27, 2026.

Transparency log

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

Download URL slotlock-0.3.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bac30789d900c4fb525ea204855a3f52bfc1c37adc86b6ea3b618a594c73fabc
BLAKE2b-256 checksum
How to use checksums
85309f48099ddfc803f20c5f11a25285aac6b55e2b5d1c6ea1f9e21437af4d9f
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 27, 2026.

Transparency log

Security for slotlock 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for slotlock-0.3.0.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 27, 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.

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