Giter Site home page Giter Site logo

csv-ical's Introduction

CSV/iCal Converter

PyPI PyPI - Python Version PyPI - License

Build Status Code Climate Test Coverage

A simple script to convert data in CSV format to iCal format and vice versa.

Installation

pip install csv-ical

Usage

See the example files.

Development

pip install -e .[test]
ruff check .
mypy . --strict --ignore-missing-imports
coverage run -m unittest
coverage report -m

csv-ical's People

Contributors

albertomarnetto avatar albertyw avatar lapidarioz avatar spitfiremk 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

Watchers

 avatar  avatar  avatar

csv-ical's Issues

Cannot get this to work.

Hi,

I've been looking all over the place for a script like this an its promising based on the examples you have, but I've tried numerous combinations of 'csv_configs' and just cannot get anything to output correctly to ics. The only thing I get in an output are the first two lines below:

BEGIN:VCALENDAR
END:VCALENDAR

I've even gone so far as to use the same data and configuration from your csv file and arrive.py file, within my csv and script, and even that doesn't work. Any thoughts on what I could be doing wrong?

ical-to-csv

Could you provide a script to convert from Ical to csv?

While making a CSV: KeyError: 'LOCATION'

I have an ical file I've exported from Apple's Calendar. I've followed the process in examples/to_csv.py but when doing convert.make_csv() I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/phil/.pyenv/versions/csv-ical/lib/python3.6/site-packages/csv_ical/convert.py", line 81, in make_csv
    event['LOCATION'],
  File "/Users/phil/.pyenv/versions/csv-ical/lib/python3.6/site-packages/icalendar/caselessdict.py", line 42, in __getitem__
    return super(CaselessDict, self).__getitem__(key.upper())
KeyError: 'LOCATION'

Here's a truncated version of my ics file, with a single event (with SUMMARY and DESCRIPTION replaced):

BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
X-WR-CALNAME:Health
PRODID:-//Apple Inc.//Mac OS X 10.13.4//EN
X-APPLE-CALENDAR-COLOR:#A2845E
X-WR-TIMEZONE:Europe/London
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
TZOFFSETFROM:+0000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T010000
TZNAME:BST
TZOFFSETTO:+0100
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T020000
TZNAME:GMT
TZOFFSETTO:+0000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20150401T105219Z
UID:623DE640-F0FF-4362-BC51-1890C2732BB2
DTEND;VALUE=DATE:20080620
TRANSP:OPAQUE
X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
SUMMARY:Event title
DTSTART;VALUE=DATE:20080619
DTSTAMP:20111014T103701Z
SEQUENCE:0
DESCRIPTION:My description.
END:VEVENT
END:VCALENDAR

make_csv fails with ghost events.

For this kind of event a copy of a recurred event, a undocumented tag is created : X-MOZ-FAKED-MASTER:1
this behaviour has been identified :
https://bugzilla.mozilla.org/show_bug.cgi?id=536796
Some how it's not corrected in Thunderbird.

BEGIN:VEVENT
CREATED:20210118T075836Z
LAST-MODIFIED:20210118T075906Z
DTSTAMP:20210118T075906Z
UID:3BE58C04-1B6C-4C1E-8AA9-60A0F3A25864
ATTENDEE;[email protected];RSVP=TRUE;PARTSTAT=ACCEPTED;CN=Me
 hdi Guiraud;CUTYPE=INDIVIDUAL:mailto:[email protected]
RDATE;VALUE=DATE-TIME:20210120T090000Z
DTSTART;TZID=Europe/Paris:20210120T100000
X-MOZ-FAKED-MASTER:1
X-MOZ-GENERATION:1
DURATION:PT1H
CLASS:PUBLIC
END:VEVENT

I've created a patch that works for me. Im ' testing DTEND which is not there because of the nature of the copying.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Need to add encoding to file open

One of the CSV files that I was parsing had an address from Hong Kong in it.

When it was being opened it was throwing an error.

I had to modify read_csv and save_ical and save_csv and read_ical to be with open(csv_location, encoding="utf8") as csv_file:

UTF-8 encoding

Hello! Are there any plans to support decoding into readable encodings such as UTF8? Now I'm getting a file like this.
Нагаев отпуск 2 часть,2024-07-15,2024-07-29,,None
Резванцев А.М. pt.2,2024-08-11,2024-09-01,,None
Резванцев А.М. pt.1,2024-04-21,2024-04-28,,None

License

Hi,
could you clarify the license?
Thank you.

exception if there is no DTEND

I have a ics files with some recurring elements which have no DTEND, so it throws a exception:
Traceback (most recent call last): File "./convert", line 8, in <module> convert.make_csv() File "/usr/local/lib/python3.7/dist-packages/csv_ical/convert.py", line 78, in make_csv event.get('DTEND').dt, AttributeError: 'NoneType' object has no attribute 'dt'

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.