Skip to main content

A Django calendaring application

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_swingtime-3.0.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_swingtime-3.0.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file django_swingtime-3.0.0.tar.gz.

File metadata

  • Download URL: django_swingtime-3.0.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for django_swingtime-3.0.0.tar.gz
Algorithm Hash digest
SHA256 0e04e6cb757ce1ecc10178dcddab120c2b8e230808beb6acdb263a9553834a3a
MD5 986b11981b6a8deb6b6bf0121934bbda
BLAKE2b-256 a1dadfc0df1f3f5d2d1e04d04527edd3e913b34fccccd813061a6ff4f5582aee

See more details on using hashes here.

File details

Details for the file django_swingtime-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_swingtime-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 555569cadf443f2df46162077762faaf1a7dd8447767222397cd71128521f522
MD5 3bed6cb8ed46436a764c530ba0a8f7ea
BLAKE2b-256 4d9b41290ad4abc78e552aea67396630aa37d71df66b1be489475ca6bf836bef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page