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.1.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.1.0
File Size Uploaded Provenance Actions
opportune-0.1.0.tar.gz 801.2 kB With provenance Details for opportune-0.1.0.tar.gz

Built distributions (wheels)

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

Total release size: 11.1 MB

Release files / opportune-0.1.0.tar.gz

Download URL opportune-0.1.0.tar.gz
Size 801.2 kB
Tags Source
SHA-256 checksum
How to use checksums
264ab74310b3d95936fb50cb8e79c1ea416da0222842e0457d59ee03565fc60c
BLAKE2b-256 checksum
How to use checksums
381b5e7d4afb7d4372334901d99dff3a4e462006d65c2bb08b03004b276a9532
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.0-cp312-abi3-win_arm64.whl
Size 1.2 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c49e2e79aa0691f596d0cc928d2efe5edd8589f6f6960b319f93e5bc55a1afeb
BLAKE2b-256 checksum
How to use checksums
d20c5d075a06c09f84214941e1823b22514a5018b4b5ec2f44cb8b5baf417506
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
80a3e00a6f274713296040d206e9ff281d54817601028ed757d40a1914a81c1b
BLAKE2b-256 checksum
How to use checksums
c76376c90cbfecf95122d689b8bc4a2566da5744c7bcac77dac8ef92506aa147
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
7297254b903d17c74a4827bf2b6f06eebfba03a6b12e4c2dc919575fa577c290
BLAKE2b-256 checksum
How to use checksums
a847ab4273c3c2d2f52adadb682d80b254bdebdaaab664b2f5fe0b4842bcaf17
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
95ce630340282beebd5b46a4efe93919b7450ae9a084ecdd6a8b26db2bf15e99
BLAKE2b-256 checksum
How to use checksums
a7329520687e663cbc88b1e79ebb4ad5a7e74e24c16111fefe9a5d3918141cbe
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
71e443be6388de03dbcb02b933dd24d8ea7171fe75e9c6bf16e310866b87e645
BLAKE2b-256 checksum
How to use checksums
28f6dde4c4c0a3076a4d80dee22f43460729e24faec269327df8f0047687096c
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
0c47dc32925a147bcd3a3b75ab96d7ed2fa2fa52c6fd55ccf095a58bf1d9271f
BLAKE2b-256 checksum
How to use checksums
1b2df40272273832d2a1786639c621def4c4c65322a4912fa8b08a219462a338
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
bd27f603a03d403ae5d9cc02093db71904b59f16e66fd548c7f0930ad282fe86
BLAKE2b-256 checksum
How to use checksums
c69930aca434ed13c136a6bebebd4d96f473fdf879dd8068e44702788b337ed7
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 23, 2026.

Transparency log

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

Download URL opportune-0.1.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
d71d5850bd2a2abcf9edd9a035b79e17b96c8a5c4b4ab9943565e1f64c699b74
BLAKE2b-256 checksum
How to use checksums
e6eb25ab6c6cf847552be94f4b6164926b4212488b8d916ccca3442a909a2f9a
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 23, 2026.

Transparency log

Security for opportune 0.1.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.1.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 23, 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