Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dakrauth/django-swingtime
📆 Event and occurrence scheduling application for Django
https://github.com/dakrauth/django-swingtime
calendar-events django python
Last synced: 3 days ago
JSON representation
📆 Event and occurrence scheduling application for Django
- Host: GitHub
- URL: https://github.com/dakrauth/django-swingtime
- Owner: dakrauth
- License: mit
- Created: 2008-12-23T16:49:14.000Z (almost 16 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T11:51:05.000Z (11 months ago)
- Last Synced: 2024-08-31T22:49:00.838Z (2 months ago)
- Topics: calendar-events, django, python
- Language: Python
- Homepage: https://dakrauth.github.io/django-swingtime/
- Size: 5.2 MB
- Stars: 317
- Watchers: 19
- Forks: 100
- Open Issues: 14
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
- starred-awesome - django-swingtime - Event and occurrence scheduling application for Django (Python)
README
Django Swingtime
================.. image:: https://github.com/dakrauth/django-swingtime/workflows/Test/badge.svg
:target: https://github.com/dakrauth/django-swingtime/actions.. image:: https://badge.fury.io/py/django-swingtime.svg
:target: http://badge.fury.io/py/django-swingtime:Version: 1.5.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.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:
.. code:: python
>>> 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:00A bit more elaborate example, using the the convenience function ``models.create_event``:
.. code:: python
>>> # 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:00Demo
----To view a demo, `click here `_.
To run a local demo using Docker, do the following:
.. code:: bash
$ docker build -t swingtime .
$ docker run -p 8000:80 -d swingtime:latestAnd 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
* 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 / applicationRequirements
------------* Python 3.10+
* `Django >=4.2,<5.2 `_
* `python-dateutil `_.