Skip to main content

Django Swingtime

https://github.com/dakrauth/django-swingtime/workflows/Test/badge.svg https://badge.fury.io/py/django-swingtime.svg Supported Python versions Supported Django versions
Version:

3.0.0

Demo:

https://nerdfog.com/swingtime/

Download:

https://pypi.org/project/django-swingtime/

Source:

https://github.com/dakrauth/django-swingtime

Documentation:

http://dakrauth.github.io/django-swingtime/

Description

Swingtime is a Django application similar to a stripped-down version of iCal for Mac OS X or Google Calendar.

Swingtime provides a models.Event model that acts as metadata container for one or more models.Occurrence objects, which describe specific start and end times. Alternatively, there abstract, base models that can be used. See the provide demo app for examples.

Swingtime relies heavily upon both the datetime standard library package and the dateutil package, featuring direct support for the dateutil.rrule interface to create occurrences.

A fairly simple example:

>>> from datetime import *
>>> from swingtime import models as swingtime
>>> et = swingtime.EventType.objects.create(abbr="work", label="Work Related Events")
>>> evt = swingtime.Event.objects.create(
...     title="New TPS Cover Sheet",
...     description="Kiss off, Lumbergh!",
...     event_type=et
... )
>>> evt.add_occurrences(datetime(2018,3,18,16), datetime(2018,3,18,16,15), count=5)
>>> for o in evt.occurrence_set.all():
...     print(o)
...
New TPS Cover Sheet: 2018-03-18T16:00:00
New TPS Cover Sheet: 2018-03-19T16:00:00
New TPS Cover Sheet: 2018-03-20T16:00:00
New TPS Cover Sheet: 2018-03-21T16:00:00
New TPS Cover Sheet: 2018-03-22T16:00:00

A bit more elaborate example, using the the convenience function models.create_event:

>>> # pay day is the last Friday of the month at 5pm
>>> evt = swingtime.create_event(
...     "Pay day",
...     ("pay", "Payroll"), # alternate means to add EventType on the fly
...     freq=rrule.MONTHLY,
...     byweekday=rrule.FR(-1),
...     until=datetime(2013,8,1),
...     start_time=datetime(2013,4,1,17)
... )
>>> for o in evt.occurrence_set.all():
...     print(o)
...
Pay day: 2013-04-26T17:00:00
Pay day: 2013-05-31T17:00:00
Pay day: 2013-06-28T17:00:00
Pay day: 2013-07-26T17:00:00

Demo

To view a demo, click here.

To run a local demo using Docker, do the following:

$ docker build -t swingtime .
$ docker run -p 8000:80 swingtime:latest

And browse to localhost:8001.

Alternatively:

python -m venv .venv
./.venv/bin/activate
pip install -e ".[dev]"
cd demo
./manage.py migrate
./manage.py runserver

And browse to localhost:8000.

Features

  • Support for adding complex event occurrences via dateutil

  • Ready-made forms.MultipleOccurrenceForm for handling complex input

  • Daily, monthly, and annual view functions

  • Daily, monthly, and annual view classes.

  • Grid-based daily view generator, complete with alternating or sequential EventType CSS-class handling

  • Slightly better than average documentation, a few test cases, and commented code

  • Built-in demo project / application

Requirements

Metadata

Release files for django-swingtime 3.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 django-swingtime 3.1.0
File Size Uploaded Provenance Actions
django_swingtime-3.1.0.tar.gz 23.1 kB Without provenance Details for django_swingtime-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-swingtime 3.1.0
File Interpreter ABI Platform Actions
django_swingtime-3.1.0-py3-none-any.whl Python 3 none any Details for django_swingtime-3.1.0-py3-none-any.whl

Total release size: 45.7 kB

Release files / django_swingtime-3.1.0.tar.gz

Download URL django_swingtime-3.1.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
23bd4bfc1845a36461bae466a285ac99f792d107ae68e2996e03ccc3e615aa57
BLAKE2b-256 checksum
How to use checksums
8791a1c78f95893640857482d640ba57b43d0ae08966db418209fe3ac8b87fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / django_swingtime-3.1.0-py3-none-any.whl

Download URL django_swingtime-3.1.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7bf40da7b304a83a99937aaa64d070c8563c6571e45e9fc1b8d3c58fd70d0ce
BLAKE2b-256 checksum
How to use checksums
89ab5a33945f02ba4f9da2a13f66c92cb417ea9d874f7c77f3297748968fa822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for django-swingtime 3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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