pycronofy
raw JSON → 2.0.7 verified Mon Apr 27 auth: no python
Python library for the Cronofy calendar API, providing methods to manage calendars, events, availabilities, and account linking. Current version 2.0.7, actively maintained with monthly releases.
pip install pycronofy Common errors
error ImportError: cannot import name 'Cronofy' from 'pycronofy' ↓
cause Package was renamed in v2, the correct import is from 'cronofy'.
fix
Install the 'cronofy' package and change imports to 'from cronofy import Cronofy'.
error AttributeError: 'Cronofy' object has no attribute 'list_calendars' ↓
cause The method was renamed to 'calendars' in v2.
fix
Use client.calendars() instead of client.list_calendars().
error HTTPError: 400 Client Error: Bad Request for url: https://api.cronofy.com/v1/oauth/authorize ↓
cause Invalid redirect_uri or mismatched client credentials.
fix
Double-check that the redirect_uri matches exactly (including trailing slash) what is registered in the Cronofy Developer Console.
error cronofy.exceptions.CronofyAuthenticationError: Access token expired ↓
cause The OAuth access token has expired and needs to be refreshed.
fix
Use client.refresh_access_token(refresh_token) to obtain a new access token.
Warnings
breaking Package name changed from 'pycronofy' to 'cronofy' in v2.0.0. Import path changed from 'from pycronofy import Cronofy' to 'from cronofy import Cronofy'. ↓
fix Update import statements and pip install to 'cronofy'.
deprecated The method 'list_calendars' is deprecated; use 'calendars' instead. ↓
fix Replace client.list_calendars() with client.calendars().
gotcha OAuth redirect URI must exactly match the one registered in your Cronofy app, including trailing slashes. Mismatch returns a 400 error. ↓
fix Ensure the redirect_uri parameter matches the registered URI character-for-character.
gotcha Event creation requires a specific timezone format (e.g., 'America/New_York'). Using an invalid timezone may result in a 422 Unprocessable Entity error. ↓
fix Use IANA timezone identifiers like 'UTC' or 'America/Los_Angeles'.
Imports
- Cronofy wrong
from pycronofy import Cronofycorrectfrom cronofy import Cronofy - CronofyOAuth
from cronofy import CronofyOAuth
Quickstart
from cronofy import Cronofy
client = Cronofy(client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')
auth_url = client.get_authorize_url(redirect_uri='https://yourapp.com/callback')
print(auth_url)