Giter VIP home page Giter VIP logo

jcalapi's Introduction

๐Ÿ“… jcalapi

jcalapi is a local calendar cache and JSON API that interacts with Exchange and Confluence calendars. It fetches events and returns them in a JSON format, making it easy to integrate calendar data into other systems.

๐Ÿš€ Getting Started

๐Ÿ“‹ Prerequisites

๐Ÿ”‘ Setting Up Credentials

To use jcalapi, you'll need to provide credentials for accessing your Exchange or Confluence calendars. These credentials should be stored in a secure location, and you should ensure that they are not exposed in your code or version control system.

For Exchange, you'll need your username and password. For Confluence, you'll need your API token.

See .envrc-sample for an example.

๐Ÿ’พ Installation

# pip
pip install --user jcalapi

# pipx
pipx install jcalapi

๐Ÿƒ Usage

You can run the application directly using Python:

python -m jcalapi

๐Ÿณ Blablabla, Docker?

docker run -it --rm -p 127.0.0.1:7042:7042 \
  -e ONFLUENCE_URL=https://confluence.example.com \
  -e CONFLUENCE_USERNAME=john.doe \
  -e CONFLUENCE_PASSWORD=XXX \
  -e [email protected] \
  -e EXCHANGE_PASSWORD=XXX \
  -e GOOGLE_CREDENTIALS=/config/xxx.apps.googleusercontent.com.json \
  -e GOOGLE_CALENDAR_REGEX='^Work '
  ghcr.io/pschmitt/jcalapi

๐Ÿ“š API Usage

The API provides endpoints for fetching calendar events. Here's an example of how to use it:

curl http://localhost:7042/today

This will return a JSON response with the events data:

[
  {
    "uid": "event1",
    "backend": "exchange",
    "calendar": "calendar1",
    "organizer": "organizer1",
    "attendees": {
      "name": "hisname",
      "email": "[email protected]",
      "optional": false,
      "response": "Accept"
    },
    "summary": "event1 summary",
    "description": "event1 description",
    "body": "event1 body",
    "location": "event1 location",
    "start": "2023-06-06T00:00:00",
    "end": "2023-06-06T01:00:00",
    "whole_day": false,
    "is_recurring": false,
    "categories": [
      "Cat1",
      "Cat2"
    ],
    "status": "confirmed",
    "extra": {
      "conference_type": "Teams",
      "meeting_workspace_url": "https://teams.microsoft.com/l/meetup-join/...",
      "net_show_url": "https://teams.microsoft.com/l/meetup-join/..."
    },
    "conference_url": "https://teams.microsoft.com/l/meetup-join/..."
  },
  ...
]

To fetch events for tomorrow, you can use the /tomorrow endpoint:

curl http://localhost:7042/tomorrow

This will return a JSON response with the events data for tomorrow.

The /meta endpoint provides metadata about the backends (Confluence/Exchange):

curl http://localhost:7042/meta

The /reload endpoint allows you to reload the calendar data:

curl -X POST http://localhost:7042/reload

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a pull request.

๐Ÿง‘โ€๐Ÿ’ป Development setup

  1. Clone the repository
git clone https://github.com/pschmitt/jcalapi.git
  1. Navigate into the cloned repository
cd jcalapi
  1. Setup the environment
poetry install

Alternatives:

  • Use devenv
  • Try the provided devcontainer (untested, generated by devenv)

๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0.

jcalapi's People

Contributors

dependabot[bot] avatar pschmitt avatar mguyard 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.