GithubHelp home page GithubHelp logo

py-ical-to-org's Introduction

Python download google ical and write to org file.

A replacement for the nice ical-to-org-via-awk script, https://github.com/msherry/ical2org/blob/master/ical2org.awk

ical2org.awk is nice, but it wasn't working for me for a few important things:

  • Wasn't correctly interpreting scheduled events with special rules (e.g., "repeat every 2 weeks on M, W, F")
  • Wouldn't let me mark past events as DONE (at least, not easily!)
  • Tricky/sometimes flaky processing of repeated events
  • ... it's written in awk. Which is great, but Python is easier to grok. :-P

This script doesn't print all of the details that ical2org.awk does (such as various properties), it prints out the bare minimum that I needed for my calendar; namely, the calendar entry title, and the start and end dates.

Sample schedule.org output:

* training
SCHEDULED: <2022-05-23 Mon 13:00-14:00>

* do that thing
SCHEDULED: <2022-05-24 Mon 17:30-18:00>

* Flight to Victoria
SCHEDULED: <2022-05-31 Tue 09:15-14:20>

Install and Usage

This assumes you have python, venv, and pip (or something like venv and pip).

Get the code

git clone etc.

Initial install

python3 -m venv .venv
source .venv/bin/activate
.venv/bin/pip3 install -r requirements.txt
deactivate

Config

Copy config.ini.example to config.ini, and fill in your values.

Usage

python3 -m venv .venv
source .venv/bin/activate
python main.py
deactivate

or ...

./update-schedule.sh

Cron job

Cron job

For example, sync things every hour.

* */1 * * * pushd /path/to/this/dir && ./update-schedule.sh && popd >> /tmp/cron.out 2>&1

Dev notes

There are just a few tests:

python3 -m venv .venv
source .venv/bin/activate
python -m unittest discover -s test
deactivate

py-ical-to-org's People

Contributors

jzohrab avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.