Skip to main content

opportune

Typed Python bindings for the opportune Rust scheduling engine: compute calendar availability across working hours, buffers, notice windows, rest rules, travel holds, and workload caps, and verify proposed bookings at confirmation time.

  • Native Rust engine: packaged as cp312-abi3 wheels (Python 3.12+) with the IANA time zone database bundled. Every engine call releases the GIL.
  • Pydantic v2 models: generated from the wire JSON Schema, ready to declare directly on FastAPI routes and store in Postgres jsonb. Every int32/uint32/uint64 field publishes its exact bounds and enforces them at validation.
  • Provider adapters included: opportune.adapters.graph and opportune.adapters.google convert Microsoft Graph and Google Calendar payloads into domain blocks and rules.
  • Async & public-route helpers: *_async methods offload CPU work with asyncio.to_thread (every one accepts a keyword-only executor= for a bounded ThreadPoolExecutor), module-level *_json and *_json_async forms return the engine's own text, and public_response / public_slot_check strip operator-only diagnostics for public booking endpoints.
  • Safe host scoping: presets.and_who(rule, {"kind": "person"}) narrows who without dropping the default {"role": "host"} clause, so working hours, rest and caps never start judging attendees, while presets.except_who(rule, {"ids": ["ceo"]}) exempts named participants. Both are also exported as opportune.and_who / opportune.except_who.
  • Partial limits: opportune.Limits(max_participants=50) overrides one cap; every omitted field reads as the engine default.

Install

pip install opportune

or with uv:

uv add opportune

Requires Python 3.12+ and pydantic>=2.14.

Quickstart

import opportune

request = opportune.Request(
    now="2027-06-14T07:00Z",
    goal=opportune.single_goal(
        "30m",
        opportune.Requirement(all=[opportune.person("rich")]),
        zone="Europe/London",
        search_window=("2027-06-13T23:00Z", "2027-06-18T23:00Z"),
    ),
    participants=[opportune.Participant(id="rich", zone="Europe/London", calendar=[])],
    rules=[
        opportune.presets.business_hours(),
        opportune.presets.buffers(),
        opportune.presets.min_notice(),
    ],
)

response = opportune.find_availability(request)
print(opportune.offer_start(response.offers[0]), opportune.offer_end(response.offers[0]))

For web services, build one opportune.Engine() at startup (for example, in a FastAPI lifespan handler) and call await engine.find_availability_async(request). Every *_async entry point takes an optional keyword-only executor=; pass a dedicated bounded concurrent.futures.ThreadPoolExecutor to keep CPU-bound searches off the event loop's shared default pool. engine.find_availability_json_async(request) returns the engine's own document text; the module-level opportune.find_availability, check_slot, validate, required_ranges and their *_json, *_async and *_json_async forms answer from one shared engine.

Documentation

License

Dual-licensed under MIT or Apache-2.0, at your option.

Metadata

Release files for opportune 0.2.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 opportune 0.2.0
File Size Uploaded Provenance Actions
opportune-0.2.0.tar.gz 801.2 kB With provenance Details for opportune-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for opportune 0.2.0
File Actions
opportune-0.2.0-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details for opportune-0.2.0-cp312-abi3-win_arm64.whl
opportune-0.2.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for opportune-0.2.0-cp312-abi3-win_amd64.whl
opportune-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for opportune-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl
opportune-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details for opportune-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl
opportune-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for opportune-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
opportune-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for opportune-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
opportune-0.2.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for opportune-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
opportune-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for opportune-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 11.1 MB

Release files / opportune-0.2.0.tar.gz

Download URL opportune-0.2.0.tar.gz
Size 801.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4399931108c1a784eb9374def0a91bc42df224bff062982caa5378ba74e9c055
BLAKE2b-256 checksum
How to use checksums
550a4b01c1b1bc2fc0ea231110f18ffb6955f4d269b2c234938fb41a608a039e
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-win_arm64.whl

Download URL opportune-0.2.0-cp312-abi3-win_arm64.whl
Size 1.2 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
1a480687289aa7d228e8ad721bfa576e9e310afb34926a65460fd16721369e08
BLAKE2b-256 checksum
How to use checksums
ee9f9a669a8d71777f36ed6b3668f1b6d79b9b22c196bd73324affe5b31c5d29
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-win_amd64.whl

Download URL opportune-0.2.0-cp312-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
209a80e239ee9ca2d4e2caf7cfd24dec48eb4fb7176ead06f1f7ac1b8fac0cb4
BLAKE2b-256 checksum
How to use checksums
e9b70b4f0f44a5733738c266a850f05d0b80fa9f714bec83a76a0f7b5f1b0603
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL opportune-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
fdfe0759d7393dfc9e5a22caeaeaa1292f4e8054d99280ca949330ba63724e55
BLAKE2b-256 checksum
How to use checksums
7b0c8c2c42bb0879e82df1c0371dafc41bab53f7199ebab3d88c3288ac23da12
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl

Download URL opportune-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl
Size 1.4 MB
Tags CPython 3.12 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
918c69265ab33950ffd3f3099ee7c791660e6b89f3cb01e5590205da2ab2293b
BLAKE2b-256 checksum
How to use checksums
3f5ab79d320612d1a0b370c307b1c2654c57c3095d2aab756364a09a190fc5a7
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL opportune-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c3a42b5f818729b655298384de3d23fa60328b554f9f8bf474b53fafd198db21
BLAKE2b-256 checksum
How to use checksums
39c4554490d0e7686cb36c49bec2f981925217d6285bb77869c8fc04940842b5
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL opportune-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
37e2e38c2032abd714c1bc780fb5e533e8907d160d3ea2aba51267145fdac221
BLAKE2b-256 checksum
How to use checksums
1dd9bb66d037116d107ae00041dad1b292bb127471d2f36761b68753da8131c1
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL opportune-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
57ef86c97574036f70d084b5d630fbf8d99d7f26d577d826961a23f3abdae9de
BLAKE2b-256 checksum
How to use checksums
4b2a7fe8b190025a4fcf9418bd50d2b2268bba57152871fb83c9d79f610fb887
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 Nov 24, 2026.

Transparency log

Release files / opportune-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL opportune-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8a3a6b511fa81c2a9e6bb6fdabfa4bfbb4d3e14b4b994bb748b7e3382a42c2a9
BLAKE2b-256 checksum
How to use checksums
f142cab24589328ab7d8e6eebf95d633c082ea1eda1fe16426fbdf83237fe5f3
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 Nov 24, 2026.

Transparency log

Security for opportune 0.2.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

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

Select from 9 files

Attestation for opportune-0.2.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 Nov 24, 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