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 persist as JSON documents. 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.4.

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.2

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.2
File Size Uploaded Provenance Actions
opportune-0.2.2.tar.gz 821.5 kB With provenance Details for opportune-0.2.2.tar.gz

Built distributions (wheels)

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

Total release size: 11.2 MB

Release files / opportune-0.2.2.tar.gz

Download URL opportune-0.2.2.tar.gz
Size 821.5 kB
Tags Source
SHA-256 checksum
How to use checksums
57a85d033fecfb5beca78c565a6089490a97f3d603b2c44f8c62ce51d7fc550c
BLAKE2b-256 checksum
How to use checksums
879920f42361518a90e939978e8b1d3dd7f4bcf12f6ac119c9668ccede213300
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-cp312-abi3-win_arm64.whl
Size 1.2 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
50a7427c5f109abf04391215ae1588f6dd9a92e19d7b2f9517ea3a588515f291
BLAKE2b-256 checksum
How to use checksums
fef6c76519eb638ed7b43585d0e7869a4f19828db49546f4b78a4ccc65f671b5
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-cp312-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
160b7ad8ebdbd1267b8005f7cb97dced389ed776003c07cf06844bc684d66692
BLAKE2b-256 checksum
How to use checksums
9fd576c13d2588bbf955ce2b84a1cd4f01041803198497c16b642c0d97f17c1b
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-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
040cf6a389b59092a85d2e0dce24b09e0d40ca1da4af7fd156dcdd51d909158a
BLAKE2b-256 checksum
How to use checksums
c0471c4dbbe2a996955f632a999ce511c1962402413c2f244bb45dcb132ac99e
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-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
fdb595b5e64b2e8ff84aa9fa8b6308f50cdce26e0a4d080b9a42472513a4939f
BLAKE2b-256 checksum
How to use checksums
7d4844d1abb3086683ee561473a09f9632f45652f1c37ffb93f2bf949deefe93
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-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
77ed2f2f130b0f9ca2a47ac00a3de7de3de1daf2c8d54661619e974585bce94a
BLAKE2b-256 checksum
How to use checksums
03e2f7cb06e2b5547c3b645fdd115ac04c43868e21ec592bb52536908bd91906
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-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
3aeff203fdfdb24d35fe6b9d70e4fce380c488b5c54f4f596dbcf0261e3b4d51
BLAKE2b-256 checksum
How to use checksums
7ebf45b09c9ac2bfd45d21fdbd1ee04114180c2be82914d278efc8e8a17ea967
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-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
299ff39f4bad0cda6b0a37962a1164b805410c5a448200f28bd9fa5c8164f83a
BLAKE2b-256 checksum
How to use checksums
73548ee42a8fa4a022b0eac5500db70593391edc8915022a7e69cbe02fdbbde8
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 25, 2026.

Transparency log

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

Download URL opportune-0.2.2-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
3d7124dcd8018e88d907392a0e2560ed5e3eb93fb6d057f1c94d724acce18166
BLAKE2b-256 checksum
How to use checksums
ea3543c1b376d316899d922cd7ee675666bbb7126782e143aa61dba201ded8a0
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 25, 2026.

Transparency log

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

Full provenance

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

Select from 9 files

Attestation for opportune-0.2.2.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 25, 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