Giter VIP home page Giter VIP logo

django-ical's Introduction

django-ical

PyPI Documentation Status GitHub Actions Coverage Jazzband

django-ical is a simple library/framework for creating iCal feeds based in Django's syndication feed framework.

This documentation is modeled after the documentation for the syndication feed framework so you can think of it as a simple extension.

If you are familiar with the Django syndication feed framework you should be able to be able to use django-ical fairly quickly. It works the same way as the Django syndication framework but adds a few extension properties to support iCalendar feeds.

django-ical uses the icalendar library under the hood to generate iCalendar feeds.

Documentation

Documentation is hosted on Read the Docs:

https://django-ical.readthedocs.io/en/latest/

django-ical's People

Contributors

aleksihakli avatar artemdemidovarammeem avatar bennylope avatar boxed avatar browniebroke avatar cleder avatar glogiotatidis avatar gregsadetsky avatar ianlewis avatar jappeace avatar jazzband-bot avatar jezdez avatar lchanouha avatar magicbrothers avatar malteger avatar mbaechtold avatar mir06 avatar mjfinney avatar nitinnain avatar pablodiazgutierrez avatar pcatalin-cisco avatar pinkerton avatar smithdc1 avatar webaholik avatar wetneb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-ical's Issues

export ical file depending on url params

Hi there! First of all: awesome library. I was wondering how to create ical files based on url params

like e.g. path("event_ical/<slug:slug>/", EventFeed(), name="event-feed",), in urls.py

how do you pass the slug param to the EventFeed()?

Django 1.8 support

Hi,

Just wondered whether django-ical is known to work with Django 1.8? Thanks!

Attendee Responses

I'm not seeing it in the documentation - what would be required to include attendees and rsvp responses for each event? Before diving too deep, can anyone on the team provide any direction or recommendations?

Python 3.8

Hi,

a one-liner can get rid of this warning with Python 3.8 :

django_ical/tests/test_feed.py:142: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if key is not "email":

Apart from this warning, the tests run, so I guess things are ok.

Examples?

Are there examples about how to use this code? I have a CalendarEvent model (not the built in Django events model, but a custom one I created). It consists of events that have a date, start, and end time, and show up on a custom calendar. Now, I'd like to export the data in this custom database of events to, say, a Google calendar, with an icalendar .ics feed. I cannot find examples of how to use your django-ical code online. Could you direct me to code examples? I'm not finding much help in the documentation.

Content Type should contain `;`instead of `,`

In pull request responding to the #33, you added:
response = HttpResponse(content_type='text/calendar, text/x-vcalendar, application/hbs-vcs')

The correct syntax should be:
response = HttpResponse(content_type='text/calendar; text/x-vcalendar; application/hbs-vcs')

In the current situation, it does not work everywhere...

KeyError: TZID

Until recently 1.9.2 was compiling perfectly in Debian ; but now there is a failing test:

ERROR: test_timezone (django_ical.tests.test_feed.ICal20FeedTest.test_timezone)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/django_ical/tests/test_feed.py", line 490, in test_timezone
    self.assertEqual(calendar.subcomponents[1]["DTSTART"].params["TZID"], "EDT")
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3/dist-packages/icalendar/caselessdict.py", line 40, in __getitem__
    return super().__getitem__(key.upper())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'TZID'

I suspect some test file changed and this test was using something that disappeared, but I haven't been able to track down precisely what happened where.

Add Mime-Type on response

Hi,

I miss the mime-type on the response header to allow desktop and mobile apps to use the calendar feed on the calendar application.

Header:

application/hbs-vcs, text/calendar, text/x-vcalendar

Add support for alarm

Is this module still under development?

Or is it wiser to start from python icalendar?

[TypeError: main() missing required positional argument request ]

I am getting this error while following a youtube Django tutorial and I know that this is not the plate for Django issues so I went to Django git-hub but there I can't open an issue so I came here for help. The error says that I am missing an argument for the main function that returns the HttpResponse in that I have included request but it says that I haven't. This error occurred while I was making the migrations for my project. Al I want is to get the link to view the server or web and fix this. Kindly help me, it will benefit me.. I am following Tech with Tim's youtube course for Django and React Js I also asked him thrice but there was no reply.

Wrong parsing for empty categories iterable

If I create a ICalFeed without defining item_categories, the default value for this is not None but an empty tuple. See https://github.com/django/django/blob/master/django/utils/feedgenerator.py#L76.

But django_ical feedgenerator does not care about this, see https://github.com/jazzband/django-ical/blob/master/django_ical/feedgenerator.py#L109.

Result: I get CATEGORIES:() in my output which is seen as an event with one category named () by the client (at least thunderbird tries to show a category flag).

So we may check not only for None but also for empty tuple.

VTODO (tasks) support

The icalendar library, that django-ical relies on, supports not just events but also other types of calendar contents, such as "VTODO" elements (as the Todo class, sadly not very extensively documented). Those correspond to tasks to be completed by a certain deadline, as defined by the Tasks extension of the iCalendar specification.

It seems to me that django-ical does not currently support exposing such tasks in the ical feeds it generates.
Would this functionality be in scope of this library?

For instance, I could imagine using a new method on the feed class to determine whether an entry should be translated as an Event or as a Todo:

class EventFeed(ICalFeed):

    def item_type(self, item):
        return "todo"

Or simply using a class attribute (if calendars should not be able to contain mixes of events and tasks). Other methods would be added to support the fields that are specific to tasks.

Python 3 support?

What is needed to make this code compatible with Python 3?

I haven't looked at the source too closely but caniusepython3 reports no blocking dependencies.

Move to Jazzband?

Hi @pinkerton, I see you've modified django-ical to look like it's part of Jazzband but you haven't actually made the transfer of the repo to the Jazzband organization.

Could you please let me know what the status about that is?

Example of private calendar

How do I go about creating a private calendar? (in terms of security best practises)

Can I somehow add a token/bearer?
Is that intended to be a query parameter in the url?
I did not find it in the documentation.
Is there an example code/snippet floating around somewhere?

I would appreciate a little guidance. :)

Ability to set X-PUBLISHED-TTL

We're working in a Microsoft environment and it appears that we cannot set a refresh on a feed for Outlook clients without setting the X-PUBLISHED-TTL property.

Are we correct in this conclusion? If so, has support for setting this property been considered (or would it be considered as PR)?

Thanks.

Example is not working.

  • Django 3.2.4
  • Python 3.9

How to reproduce:

Run the example:

from django_ical import feedgenerator
feed = feedgenerator.ICal20Feed(
    title="My Events",
    link="http://www.example.com/events.ical",
    description="A iCalendar feed of my events.",
    language="en",
)
feed.add_item(
    title="Hello",
    link="http://www.example.com/test/",
    description="Testing.",
    start_datetime=datetime(2012, 5, 6, 10, 00),
    end_datetime=datetime(2012, 5, 6, 12, 00),
)
fp = open('test.ical', 'w')
feed.write(fp, 'utf-8')
fp.close()

Output:

>>> feed.write(fp, 'utf-8')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "some-path/venv/lib/python3.9/site-packages/django_ical/feedgenerator.py", line 100, in write
    outfile.write(to_ical())
TypeError: write() argument must be str, not bytes

Add VALARM option

Hello all!

For my project, I need to specify alarms/notifications for an .ical file I'm building. But there are no hooks or method I can return the Alarm object like I can return Items/Events. Am I missing something, how can I get around this. Are you planning to add a VALARM option in the future?

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.