Overview¶
The official Todoist Python API library.
Modules¶
todoist¶
todoist.api¶
-
class
todoist.api.
TodoistAPI
(token='', api_endpoint='https://todoist.com', session=None, cache='~/.todoist-sync/')[source]¶ Bases:
object
Implements the API that makes it possible to interact with a Todoist user account and its data.
-
sync
(commands=None)[source]¶ Sends to the server the changes that were made locally, and also fetches the latest updated data from the server.
-
commit
(raise_on_error=True)[source]¶ Commits all requests that are queued. Note that, without calling this method none of the changes that are made to the objects are actually synchronized to the server, unless one of the aforementioned Sync API calls are called directly.
-
-
todoist.api.
json_dumps
(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, encoding='utf-8', sort_keys=False, **kw)¶ Serialize
obj
to a JSON formattedstr
.If
skipkeys
is true thendict
keys that are not basic types (str
,unicode
,int
,long
,float
,bool
,None
) will be skipped instead of raising aTypeError
.If
ensure_ascii
is false, all non-ASCII characters are not escaped, and the return value may be aunicode
instance. Seedump
for details.If
check_circular
is false, then the circular reference check for container types will be skipped and a circular reference will result in anOverflowError
(or worse).If
allow_nan
is false, then it will be aValueError
to serialize out of rangefloat
values (nan
,inf
,-inf
) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN
,Infinity
,-Infinity
).If
indent
is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines.None
is the most compact representation. Since the default item separator is', '
, the output might include trailing whitespace whenindent
is specified. You can useseparators=(',', ': ')
to avoid this.If
separators
is an(item_separator, dict_separator)
tuple then it will be used instead of the default(', ', ': ')
separators.(',', ':')
is the most compact JSON representation.encoding
is the character encoding for str instances, default is UTF-8.default(obj)
is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.If sort_keys is true (default:
False
), then the output of dictionaries will be sorted by key.To use a custom
JSONEncoder
subclass (e.g. one that overrides the.default()
method to serialize additional types), specify it with thecls
kwarg; otherwiseJSONEncoder
is used.
todoist.models¶
-
class
todoist.models.
Collaborator
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a collaborator.
-
class
todoist.models.
CollaboratorState
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a collaborator state.
-
class
todoist.models.
Filter
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a filter.
-
class
todoist.models.
Item
(data, api)[source]¶ Bases:
todoist.models.Model
Implements an item.
-
class
todoist.models.
Label
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a label.
-
class
todoist.models.
LiveNotification
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a live notification.
-
class
todoist.models.
GenericNote
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a note.
-
local_manager
= None¶ has to be defined in subclasses
-
-
class
todoist.models.
Note
(data, api)[source]¶ Bases:
todoist.models.GenericNote
Implement an item note.
-
class
todoist.models.
ProjectNote
(data, api)[source]¶ Bases:
todoist.models.GenericNote
Implement a project note.
-
class
todoist.models.
Project
(data, api)[source]¶ Bases:
todoist.models.Model
Implements a project.
Shares projects with a user.
todoist.managers¶
-
class
todoist.managers.projects.
ProjectsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'projects'¶
-
object_type
= 'project'¶
Shares a project with a user.
-
-
class
todoist.managers.items.
ItemsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'items'¶
-
object_type
= 'item'¶
-
complete
(item_id, date_completed=None, force_history=None)[source]¶ Marks item as completed remotely.
-
-
class
todoist.managers.labels.
LabelsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'labels'¶
-
object_type
= 'label'¶
-
-
class
todoist.managers.notes.
GenericNotesManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
object_type
= 'note'¶
-
-
class
todoist.managers.notes.
NotesManager
(api)[source]¶ Bases:
todoist.managers.notes.GenericNotesManager
-
state_name
= 'notes'¶
-
-
class
todoist.managers.notes.
ProjectNotesManager
(api)[source]¶ Bases:
todoist.managers.notes.GenericNotesManager
-
state_name
= 'project_notes'¶
-
-
class
todoist.managers.filters.
FiltersManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'filters'¶
-
object_type
= 'filter'¶
-
-
class
todoist.managers.reminders.
RemindersManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'reminders'¶
-
object_type
= 'reminder'¶
-
-
class
todoist.managers.locations.
LocationsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.AllMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'locations'¶
-
object_type
= None¶
-
-
class
todoist.managers.user.
UserManager
(api)[source]¶
-
class
todoist.managers.invitations.
InvitationsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.SyncMixin
-
state_name
= None¶
-
object_type
= 'share_invitation'¶
-
-
class
todoist.managers.collaborators.
CollaboratorsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'collaborators'¶
-
object_type
= None¶
-
-
class
todoist.managers.collaborator_states.
CollaboratorStatesManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.SyncMixin
-
state_name
= 'collaborator_states'¶
-
object_type
= None¶
-
-
class
todoist.managers.biz_invitations.
BizInvitationsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
-
state_name
= None¶
-
object_type
= None¶
-
-
class
todoist.managers.live_notifications.
LiveNotificationsManager
(api)[source]¶ Bases:
todoist.managers.generic.Manager
,todoist.managers.generic.GetByIdMixin
,todoist.managers.generic.AllMixin
,todoist.managers.generic.SyncMixin
-
state_name
= 'live_notifications'¶
-
object_type
= None¶
-
-
class
todoist.managers.generic.
Manager
(api)[source]¶ Bases:
object
-
state_name
= None¶
-
object_type
= None¶
-
state
¶
-
queue
¶
-
token
¶
-