Skip to main content

PyPI Stability Concurrency License

timeblocks

A reusable Django library for creating and managing time blocks using safe, deterministic recurrence rules.

Designed for scheduling systems where correctness, idempotency, and data safety matter more than flexibility.


Feedback & Community

If you are using timeblocks (or evaluating it), I’d love to hear from you.

  • ⭐ Star the repo if it saves you time
  • 🐛 Open an issue for bugs or edge cases
  • 💡 Start a discussion for design questions or suggestions

Even small feedback helps shape the roadmap.

➡️ GitHub Issues & Discussions are always welcome.


Quick Start Example

Create a recurring availability every Monday, Wednesday, and Friday from 10:00–11:00 UTC for the next 5 occurrences:

from datetime import date, time
from timeblocks.services.series_service import SeriesService
from timeblocks.constants import RecurrenceType, EndType

series = SeriesService.create_series(
    owner=user,
    data={
        "start_date": date(2025, 1, 1),
        "start_time": time(10, 0),
        "end_time": time(11, 0),
        "timezone": "UTC",
        "recurrence_type": RecurrenceType.WEEKDAYS.value,
        "by_weekdays": ["MON", "WED", "FRI"],
        "end_type": EndType.AFTER_OCCURRENCES.value,
        "occurrence_count": 5,
    },
)

Examples

Real-world usage examples are available in the examples/ directory:

  • daily and weekly availability
  • safe regeneration flows
  • cancellation semantics
  • monthly and yearly recurrence patterns

The README intentionally shows only the happy path.


Stability & API Guarantees (v1.0+)

Starting from version 1.0.0, timeblocks provides explicit stability guarantees.

Stable Public API

The following interfaces will not change in backward-incompatible ways without a MAJOR version bump:

  • Slot and SlotSeries models
  • RecurrenceType and EndType enums
  • SeriesService public methods

Internal APIs

Internal helpers, generators, and validation utilities are not part of the public API and may change between minor releases.

Versioning

timeblocks follows semantic versioning:

  • MAJOR — breaking changes
  • MINOR — new capabilities
  • PATCH — bug fixes and correctness improvements

Mental Model (Read This First)

timeblocks separates intent from reality.

  • SlotSeries represents intent

    “This resource should be available every Mon/Wed/Fri from 10–11”

  • Slot represents reality

    A concrete time interval that exists, may be booked, or cancelled

SlotSeries is the source of truth.
Slots are generated artifacts.

Slots must never be treated as configuration.


Supported Recurrence Types

  • NONE — single occurrence
  • DAILY — every N days
  • WEEKLY — specific weekdays
  • WEEKDAY_MON_FRI — every weekday (preset)
  • WEEKDAYS — custom weekdays
  • MONTH_NTH — Nth weekday of the month
  • MONTH_LAST — last weekday of the month
  • YEARLY — Nth weekday of a specific month

All declared recurrence types are fully implemented and tested.


What timeblocks Does NOT Do

  • booking logic
  • payments
  • permissions
  • notifications
  • UI or API views

These belong in your application layer.


For questions or design discussions, please use GitHub Discussions instead of Issues.

Release files for timeblocks 1.0.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 timeblocks 1.0.2
File Size Uploaded
timeblocks-1.0.2.tar.gz 15.2 kB Details

Built distribution (wheel)

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

Total release size:31.5 kB

Release files / timeblocks-1.0.2.tar.gz

Download URL timeblocks-1.0.2.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5b2aeb91d1690df658f85342e9cbb79d5a9cd4c1472e6391cd04b8fb3016720a
BLAKE2b-256 checksum
How to use checksums
bf59df168fb84db10ad5461dfc50be1d6dd332a60ef5f83fa2c05a523df1394f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / timeblocks-1.0.2-py3-none-any.whl

Download URL timeblocks-1.0.2-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
998a1574737360d93518f88384b42e7646c67f92e7e550aef71922a882e0877c
BLAKE2b-256 checksum
How to use checksums
bd685ee7411384ae60290ff2d7dc884c0588ceb29dd02ebbf4ea57e60c508322
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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