Metadata-Version: 2.2
Name: django-swingtime
Version: 2.0.0
Summary: A Django calendaring application
Author-email: David A Krauth <dakrauth@gmail.com>
License: Copyright (c) 2015-2025 David A. Krauth
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/dakrauth/django-swingtime
Keywords: django,calendar,events
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Scheduling
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: Django<6.0,>=4.2
Requires-Dist: python-dateutil>=2.8.2
Provides-Extra: test
Requires-Dist: tox; extra == "test"
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest-django; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: flake8; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

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: 2.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 <http://www.djangoproject.com/>`_ 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:00

A 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:00

Demo
----

To view a demo, `click here <https://nerdfog.com/swingtime/>`_.

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

.. code:: bash

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

And browse to `localhost:8000 <http://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 / application

Requirements
------------

* Python 3.10+
* `Django >=4.2,<6.0 <http://www.djangoproject.com/download/>`_
* `python-dateutil <http://labix.org/python-dateutil>`_.
