Skip to content

jebuss/pyindicoapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyindicoapi

A Python API wrapper for the CERN Indico API.


Installation

cd pyindicoapi
pip install .

Usage

in order to use the Indico API you need an excess token and the url of your Indico instance

from pyindicoapi import IndicoAPI

API_TOKEN= "my Token"
BASE_URL = "https://my.indico.server"

api = IndicoAPI( BASE_URL, API_TOKEN)

Categories

categories = api.list_categories()
print(categories)

# get subcategories of category with id 1
subcategories = api.list_categories(1)

# get a category (category id = 1)
category = api.get_category(1)

Events

List events

api.list_events()

Get an event

# get event with id = 1
event = get_event(1)

Custom resource

You may also call a custom resource from the Indico API according to the API resources

resource = api.get_custom_resource(resource_name, resource_id, location=None, output_type='json')

where:

  • resource_name is the specific resource you try to call (e.g. categ, event, room)
  • resource_id is the id of the resource
  • location location of the resource, e.g. the location of a room.
  • output_type desired output format (e.g. json, jsonp, xml, html, ics, atom, bin) [default is json]

About

A Python client for the CERN Indico API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages