pymite is a python library module that wraps the rest calls to the time tracking service mite.

Contents:

Installation

Install pymite with pip

pip install pymite

The development version can be downloaded from its page at GitHub.

git clone https://github.com/damnit/pymite.git
cd pymite
python setup.py develop

pymite has no dependencies apart of the stdlib. Compatible Python versions: 3.3, 3.4 or 3.5.

pymite adapter factory

Usage:

m = Mite("foo", "barapikey")
tracker = m.tracker_adapter

adapter factory

class pymite.Mite(realm, apikey)

API Factory that setups and returns the adapters

customers_adapter
daily_adapter
projects_adapter
services_adapter
time_entries_adapter
tracker_adapter
users_adapter

adapters module

api adapters module.

class pymite.adapters.Customers(realm, apikey)

Bases: pymite.adapters.DefaultReadAdapter

the customers class.

all(archived=False, limit=None, page=None)
by_id(id)
by_name(name, archived=False, limit=None, page=None)
class pymite.adapters.Daily(realm, apikey)

Bases: pymite.mite.MiteAPI

show daily time entries.

at(year, month, day)

time entries by year, month and day.

today()

get today’s entries.

class pymite.adapters.DefaultReadAdapter(realm, apikey)

Bases: pymite.mite.MiteAPI

all(archived=False, limit=None, page=None)

get all adapter data.

by_id(id)

get adapter data by its id.

by_name(name, archived=False, limit=None, page=None)

get adapter data by name.

class pymite.adapters.Projects(realm, apikey)

Bases: pymite.adapters.DefaultReadAdapter

the projects class.

all(archived=False, limit=None, page=None)
by_id(id)

return a project by it’s id.

by_name(name, archived=False, limit=None, page=None)

return a project by it’s name. this only works with the exact name of the project.

class pymite.adapters.Services(realm, apikey)

Bases: pymite.adapters.DefaultReadAdapter

the services class.

all(archived=False, limit=None, page=None)
by_id(id)
by_name(name, archived=False, limit=None, page=None)
class pymite.adapters.TimeEntries(realm, apikey)

Bases: pymite.mite.MiteAPI

time entries can be filtered by a lot of params: ids : customer_id, project_id, service_id, user_id billable: true or false note : note of the time entry locked : true or false

by_id(id)

lookup time entries by ID. returns an entry.

create(date_at=None, minutes=0, note='', user_id=None, project_id=None, service_id=None)

date_at - date of time entry. Format YYYY-MM-DD. default: today minutes - default: 0 note - default: ‘’ (empty string) user_id - default: actual user id (only admin users can edit this) project_id - default: None service_id - default: None

delete(id)

delete a time entry.

query(**kwargs)

a free query - you are responsible for the kwargs. Object categories ‘time_entry’ and ‘time_entry_group’ are declassed. See http://mite.yo.lk/en/api/time-entries.html for more information.

class pymite.adapters.Tracker(realm, apikey)

Bases: pymite.mite.MiteAPI

show daily time entries.

show()

show the state of the tracker.

start(id)

start a specific tracker.

stop(id)

stop the tracker.

class pymite.adapters.Users(realm, apikey)

Bases: pymite.mite.MiteAPI

the users class.

all(archived=False, limit=None, page=None)

get all time entry data.

by_id(id)

lookup users by ID. returns a user.

by_mail(mail, archived=False, limit=None, page=None)

lookup users by mail address. you may do in two ways:

  • specify one address: foo@bar.com
  • specify a domain : @bar.com

both will return a list.

the role ‘Zeiterfasser’ may not lookup users.

utils module

utils module.

pymite.utils.clean_dict(d)

remove the keys with None values.

pymite.utils.declassify(to_remove, *args, **kwargs)

flatten the return values of the mite api.

Indices and tables