statsbiblioteket.harvest package

Submodules

statsbiblioteket.harvest.clients module

class statsbiblioteket.harvest.clients.Clients(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

clients(updated_since=None) → typing.List[statsbiblioteket.harvest.harvest_types.Client][source]

Get clients (optionally update since a date) http://help.getharvest.com/api/clients-api/clients/using-the-clients-api/#get-all-clients

create_client(**kwargs)[source]

Create a new client client.create_client(client={“name”:”jo”}) http://help.getharvest.com/api/clients-api/clients/using-the-clients-api/#create-a-new-client

delete_client(client_id)[source]

Delete a client http://help.getharvest.com/api/clients-api/clients/using-the-clients-api/#delete-a-client

get_client(client_id) → statsbiblioteket.harvest.harvest_types.Client[source]

Get a single client by client_id http://help.getharvest.com/api/clients-api/clients/using-the-clients-api/#get-a-single-client

toggle_client_active(client_id)[source]

Toggle the active flag of a client http://help.getharvest.com/api/clients-api/clients/using-the-clients-api/#activate-or-deactivate-an-existing-client

update_client(client_id, **kwargs)[source]

Update a client http://help.getharvest.com/api/clients-api/clients/using-the-clients-api/#update-a-client

statsbiblioteket.harvest.contacts module

class statsbiblioteket.harvest.contacts.Contacts(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

client_contacts(client_id, updated_since=None)[source]

Get all contacts for a client by client_id (optionally specifing anupdated_since data) http://help.getharvest.com/api/clients-api/clients/using-the-client-contacts-api/#get-all-contacts-for-a-client

contacts(updated_since=None) → typing.List[statsbiblioteket.harvest.harvest_types.Contact][source]

Get list of all contacts (optionally since a given date) http://help.getharvest.com/api/clients-api/clients/using-the-client-contacts-api/

create_contact(new_contact_id, fname, lname, **kwargs)[source]

Create a new contact http://help.getharvest.com/api/clients-api/clients/using-the-client-contacts-api/#create-a-new-client-contact

delete_contact(contact_id)[source]

Delete a contact http://help.getharvest.com/api/clients-api/clients/using-the-client-contacts-api/#delete-a-client-contact

get_contact(contact_id) → statsbiblioteket.harvest.harvest_types.Contact[source]

Get a single contact by contact_id http://help.getharvest.com/api/clients-api/clients/using-the-client-contacts-api/#get-a-client-contact

update_contact(contact_id, **kwargs)[source]

Update a contact http://help.getharvest.com/api/clients-api/clients/using-the-client-contacts-api/#update-a-client-contact

statsbiblioteket.harvest.encoding module

class statsbiblioteket.harvest.encoding.HarvestEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

default(o)[source]
statsbiblioteket.harvest.encoding.getOurName(d)[source]
statsbiblioteket.harvest.encoding.json_type_hook(d)[source]
statsbiblioteket.harvest.encoding.wrap(className, values)[source]

statsbiblioteket.harvest.expense_categories module

class statsbiblioteket.harvest.expense_categories.ExpenseCategories(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

create_expense_category(new_expense_category_id, **kwargs)[source]

Create an expense category

delete_expense_category(expense_category_id)[source]

Delete an expense category

expense_categories

expense categories property

get_expense_category(expense_category_id) → statsbiblioteket.harvest.harvest_types.ExpenseCategory[source]

Get an expense category by expense_category_id

toggle_expense_category_active(expense_category_id)[source]

Toggle the active flag of an expense category

update_expense_category(expense_category_id, **kwargs)[source]

Update an existing expense category

statsbiblioteket.harvest.expenses module

class statsbiblioteket.harvest.expenses.Expenses(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

create_expense(new_expense_id, **kwargs)[source]

Create an expense

delete_expense_(expense_id)[source]

Delete an expense

expenses

expense categories property

get_expense(expense_id) → statsbiblioteket.harvest.harvest_types.Expense[source]

Get an expense by expense__id

toggle_expense__active(expense_id)[source]

Toggle the active flag of an expense

update_expense(expense_id, **kwargs)[source]

Update an existing expense

statsbiblioteket.harvest.harvest module

class statsbiblioteket.harvest.harvest.Harvest(uri, email=None, password=None, client_id=None, token=None, put_auth_in_header=True)[source]

Bases: statsbiblioteket.harvest.clients.Clients, statsbiblioteket.harvest.contacts.Contacts, statsbiblioteket.harvest.expense_categories.ExpenseCategories, statsbiblioteket.harvest.invoices.Invoices, statsbiblioteket.harvest.users.Users, statsbiblioteket.harvest.projects.Projects, statsbiblioteket.harvest.tasks.Tasks, statsbiblioteket.harvest.timetracking.Timetracking, statsbiblioteket.harvest.task_assignments.TaskAssignments, statsbiblioteket.harvest.expenses.Expenses

Harvest class to implement Harvest API

classmethod basic(uri, email, password, put_auth_in_header=True)[source]
classmethod oath(uri, client_id, token)[source]
who_am_i

who_am_i property http://help.getharvest.com/api/introduction/overview/who-am-i/

{
  'company': {
    'active': True,
    'base_uri': 'https://statsbiblioteket.harvestapp.com',
    'clock': '24h',
    'color_scheme': 'red',
    'decimal_symbol': ',',
    'full_domain': 'statsbiblioteket.harvestapp.com',
    'modules': {
      'approval': False,
      'estimates': False,
      'expenses': False,
      'invoices': False
    },
    'name': 'State and University Library',
    'plan_type': 'business-v3',
    'thousands_separator': '.',
    'time_format': 'hours_minutes',
    'week_start_day': 'Monday'
  },
  'user': {
    'admin': True,
    'avatar_url': '/assets/profile_images/abraj_albait_towers.png?1456217395',
    'email': 'abr@statsbiblioteket.dk',
    'first_name': 'Asger',
    'id': 1221014,
    'last_name': 'Askov-Blekinge',
    'project_manager': {
      'can_create_invoices': True,
      'can_create_projects': True,
      'can_see_rates': True,
      'is_project_manager': False
    },
    'timestamp_timers': False,
    'timezone': 'Berlin',
    'timezone_identifier': 'Europe/Berlin',
    'timezone_utc_offset': 7200
  }
}

statsbiblioteket.harvest.harvest_types module

class statsbiblioteket.harvest.harvest_types.Client(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Data class for Harvest Users.

Maps to and from this example JSON

"client": {
    "id": 3398386,
    "name": "Your Account",
    "active": true,
    "currency": "United States Dollar - USD",
    "highrise_id": null,
    "cache_version": 821859237,
    "updated_at": "2015-04-15T16:25:50Z",
    "created_at": "2015-04-15T16:25:50Z",
    "currency_symbol": "$",
    "details": "123 Main St\r\nAnytown, NY 12345",
    "default_invoice_timeframe": null,
    "last_invoice_kind": null
}
active

Determines if the client is active, or archived. Options: true, false.

address
cache_version
created_at
currency

The currency you’d like to use for the client.

currency_symbol

The symbol that correlates to the selected currency.

default_invoice_kind
default_invoice_timeframe
details

Additional details, normally used for address information.

highrise_id

Optional Highrise ID for our legacy integration

id
last_invoice_kind
linked_contacts
linked_invoices
linked_projects
name

Client name

statement_key
updated_at
class statsbiblioteket.harvest.harvest_types.Contact(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Data class for Harvest Contacts.

Maps to and from this example JSON

"contact": {
    "id": 2937808,
    "client_id": 1661738,
    "first_name": "Client",
    "last_name": "Contact",
    "email": "customer@example.com",
    "phone_office": "800-123-4567",
    "phone_mobile": "800-123-4567",
    "fax": "800-123-4567",
    "title": "Mrs",
    "created_at": "2013-08-12T15:30:14Z",
    "updated_at": "2015-04-16T18:07:28Z"
}
client_id
created_at
email
fax
first_name
id
last_name
linked_client
phone_mobile
phone_office
title
updated_at
class statsbiblioteket.harvest.harvest_types.Day(day_entries: typing.List[statsbiblioteket.harvest.harvest_types.DayEntry] = None, for_day: str = None)[source]

Bases: statsbiblioteket.harvest.harvest_types.HarvestType

{
    'day_entries': [],
    'for_day': '2016-06-28',
}
class statsbiblioteket.harvest.harvest_types.DayEntry(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"day_entry": {
        "id": 367231666,
        "notes": "Some notes.",
        "spent_at": "2015-07-01",
        "hours": 0.16,
        "user_id": 508343,
        "project_id": 3554414,
        "task_id": 2086200,
        "created_at": "2015-08-25T14:31:52Z",
        "updated_at": "2015-08-25T14:47:02Z",
        "adjustment_record": false,
        "timer_started_at": "2015-08-25T14:47:02Z",
        "is_closed": false,
        "is_billed": false,
        "hours_with_timer": 0.16
    }

    {
      "task": "Opgave",
      "task_id": "5402830",

      "client": "Statsbiblioteket",

      "project": "Andet",
      "project_id": "9817858",

      "user_id": 1221014,

      "created_at": "2016-07-07T08:18:33Z",
      "id": 484786391,
      "hours_without_timer": 0.37,
      "spent_at": "2016-07-07",
      "notes": "Mails",
      "updated_at": "2016-07-07T08:30:48Z",
      "hours": 0.37
    }
adjustment_record
created_at

Time (UTC) and date that entry was created

hours

Number of (decimal time) hours tracked in this time entry

hours_with_timer

Running timers will return the currently tracked value in decimal time

hours_without_timer

Started-At Start timestamp of timer (if timestamps are enabled) Ended-At End timestamp of timer (if timestamps are enabled)

id

Time Entry ID

is_billed

true if the time entry has been marked as invoiced, false if uninvoiced

is_closed

true if the time entry has been approved via Timesheet Approval (no API support), false if un-approved

linked_project
linked_task
linked_user
notes

Time entry notes

project_id

Project ID that the time entry is associated with

spent_at

Date of the time entry

task_id
timer_started_at

Time (UTC) and date that timer was started (if tracking by duration)

updated_at

Time (UTC) and date that entry was last updated

user_id

User ID that tracked this time entry

class statsbiblioteket.harvest.harvest_types.Expense(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"expense": {
    "id": 7631396,
    "total_cost": 14,
    "units": 14,
    "created_at": "2015-04-21T14:20:34Z",
    "updated_at": "2015-04-21T14:34:27Z",
    "project_id": 3554414,
    "expense_category_id": 1338061,
    "user_id": 508343,
    "spent_at": "2015-04-17",
    "is_closed": false,
    "notes": "Your Updated Expense",
    "invoice_id": 0,
    "billable": false,
    "company_id": 210377,
    "has_receipt": false,
    "receipt_url": "",
    "is_locked": false,
    "locked_reason": null
}
billable

Options: true, false. Note: Only expenses that are billable can be invoiced.

company_id
created_at
expense_category_id

Valid and existing expense category ID

has_receipt
id
invoice_id
is_closed
is_locked
linked_expense_category
linked_invoice
linked_project
linked_user
locked_reason
notes

Expense entry notes

project_id

Valid and existing project ID

receipt_url
spent_at

Date for expense entry

total_cost

integer value for the expense entry

units

integer value for use with an expense calculated by unit price (Example: Mileage)

updated_at
user_id
class statsbiblioteket.harvest.harvest_types.ExpenseCategory(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

expense_category": {
        "id": 1338056,
        "name": "Entertainment",
        "unit_name": null,
        "unit_price": null,
        "created_at": "2015-04-17T20:28:12Z",
        "updated_at": "2015-04-17T20:28:12Z",
        "deactivated": false
}
created_at
deactivated
id
linked_expenses
name
unit_name
unit_price
updated_at
class statsbiblioteket.harvest.harvest_types.HarvestType[source]

Bases: object

class statsbiblioteket.harvest.harvest_types.Invoice(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"invoice": {
    "id": 6763297,
    "client_id": 1929151,
    "period_start": null,
    "period_end": null,
    "number": "1",
    "issued_at": "2015-04-22",
    "due_at": "2015-04-22",
    "amount": 100,
    "currency": "United States Dollar - USD",
    "state": "open",
    "notes": "",
    "purchase_order": "",
    "due_amount": 100,
    "due_at_human_format": "upon receipt",
    "created_at": "2015-04-21T18:41:58Z",
    "updated_at": "2015-04-21T18:42:02Z",
    "tax": null,
    "tax_amount": 0,
    "subject": "",
    "recurring_invoice_id": null,
    "tax2": null,
    "tax2_amount": 0,
    "client_key": "43d9342a017e262c33a395ef3b9dca294f736792",
    "estimate_id": null,
    "discount": null,
    "discount_amount": 0,
    "retainer_id": null,
    "created_by_id": 508343,
    "csv_line_items": "kind,description,quantity,unit_price,amount,taxed,taxed2,project_id\nProduct,A description,1.00,100.00,100.0,false,false,\n"
}



Invoice Types
    Type            Description
    free-form   Creates free form invoice. Line items added with csv-line-items
    project     Gathers hours & expenses from Harvest grouped by projects.
    task        Gathers hours & expenses from Harvest grouped by task.
    people      Gathers hours & expenses from Harvest grouped by person.
    detailed    Uses a line item for each hour & expense entry, including detailed notes.
amount
client_id

A valid client-id

client_key

Value to generate URL to client dashboard. (Example: https://YOURACCOUNT.harvestapp.com/clients/invoices/{CLIENTKEY})

created_at

Date invoice was created. (Example: 2015-04-09T12:07:56Z)

created_by_id

User ID of the invoice creator.

csv_line_items

Used to create line items in free-form invoices. Entries should have their entries enclosed in quotes when they contain extra commas. This is especially important if you are using a number format which uses commas as the decimal separator.

currency

A valid currency format (Example: United States Dollar - USD). Optional, and will default to the client currency if no value is passed. Click here for a list of supported currencies

discount

Optional value to discount invoice total.

discount_amount
due_amount
due_at
due_at_human_format

Invoice due date. Acceptable formats are NET N where N is the number of days until the invoice is due.

estimate_id

This value will exist if an estimate was converted into an invoice.

expense_period_end

End date for included project expenses. (Example: 2015-05-22)

expense_period_start

Date for included project expenses. (Example: 2015-04-22)

expense_summary_kind

Summary type for expenses in an invoice. Options: project, people, category, detailed.

id
import_expense

Expenses to import into invoices. Options: all(import all expenses), yes (import expenses using expense-period-start, expense-period-end), no (do not import expenses).

import_hours

Hours to import into invoices. Options: all(import all hours), yes (import hours using period-start, period-end), no (do not import hours).

issued_at

Invoice creation date. (Example: 2015-04-22)

kind

Invoice type. Options: free-form, project, task, people, detailed. (See Invoice Types)

linked_client
linked_creator
linked_expense
notes

Optional invoice notes.

number

Optional invoice number. If no value is set, the number will be automatically generated.

period_end

End date for included project hours. (Example: 2015-05-22)

period_start

Date for included project hours. (Example: 2015-04-22)

projects_to_invoice

Comma separated project IDs to gather data from, unused for free-form invoices.

purchase_order

Optional purchase order number.

recurring_invoice_id

This value will exist if the invoice is recurring, and automatically generated.

retainer_id

This value will exist if the invoice was created from a retainer.

state

Updated when invoice is created, sent, paid, late, or written off. Options: draft, paid, late, sent, written-off.

subject

Optional invoice subject.

tax

First tax rate for created invoice. Optional. Account default used otherwise.

tax2

Second tax rate for created invoice. Optional. Account default used otherwise.

tax2_amount
tax_amount
updated_at

Date invoice was last updated. (Example: 2015-04-09T12:07:56Z)

class statsbiblioteket.harvest.harvest_types.Project(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"project": {
    "id": 3554414,
    "client_id": 3398386,
    "name": "Internal",
    "code": "Testing",
    "active": true,
    "billable": true,
    "bill_by": "People",
    "hourly_rate": 100,
    "budget": 100,
    "budget_by": "project",
    "notify_when_over_budget": true,
    "over_budget_notification_percentage": 80,
    "over_budget_notified_at": null,
    "show_budget_to_all": true,
    "created_at": "2013-04-30T20:28:12Z",
    "updated_at": "2015-04-15T15:44:17Z",
    "starts_on": "2013-04-30",
    "ends_on": "2015-06-01",
    "estimate": 100,
    "estimate_by": "project",
    "hint_earliest_record_at": "2013-04-30",
    "hint_latest_record_at": "2014-12-09",
    "notes": "Some project notes go here!",
    "cost_budget": null,
    "cost_budget_include_expenses": false
}
active

Whether the project is active or archived. Options: true, false.

bill_by

The method by which the project is invoiced. Options: “project”, “tasks”, “people”, or “none”.

billable

Whether the project is billable or not billable. Options: true, false.

budget

Budget value for the project.

budget_by

The method by which the project is budgeted. Options: “project” (Hours Per Project), “project_cost” (Total Project Fees), “task” (Hours Per Task), “person” (Hours Per Person), “none” (No Budget).

client_id

Client ID for project

code

Project code

cost_budget

Budget value for Total Project Fees projects.

cost_budget_include_expenses

Option for budget of Total Project Fees projects to include tracked expenses.

created_at

Date of earliest record for this project. Updated every 24 hours.

ends_on
estimate
estimate_by
hint_earliest_record_at
hint_latest_record_at
hourly_rate

Rate for projects billed by Project Hourly Rate

id

Project ID

linked_client
linked_day_entries
linked_expenses
linked_task_assignments
name

Project name

notes
notify_when_over_budget

Option to send notification emails when a project reaches the budget threshold set in Over-Budget-Notification-Percentage Options: true, false.

over_budget_notification_percentage

Percentage value to trigger over budget email alerts.

over_budget_notified_at

Date of last over budget notification. If none have been sent, this will be nil.

show_budget_to_all

Option to show project budget to all employees. Does not apply to Total Project Fee projects. Options: true, false.

starts_on
updated_at

Date of most recent record for this project. Updated every 24 hours.

class statsbiblioteket.harvest.harvest_types.Task(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"task": {
    "id": 2086199,
    "name": "Admin",
    "billable_by_default": false,
    "created_at": "2013-04-30T20:28:12Z",
    "updated_at": "2013-08-14T22:25:42Z",
    "is_default": true,
    "default_hourly_rate": 0,
    "deactivated": true
}
billable_by_default
created_at
deactivated
default_hourly_rate
id
is_default
linked_day_entries
linked_task_assignments
name
updated_at
class statsbiblioteket.harvest.harvest_types.TaskAssignment(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"task_assignment": {
    "project_id": 3554414,
    "task_id": 2086199,
    "billable": true,
    "deactivated": true,
    "hourly_rate": 100,
    "budget": null,
    "id": 37453419,
    "created_at": "2013-04-30T20:28:12Z",
    "updated_at": "2013-08-01T22:11:11Z",
    "estimate": null
  }
billable
budget
created_at
deactivated
estimate
hourly_rate
id
linked_project
linked_task
project_id
task_id
updated_at
class statsbiblioteket.harvest.harvest_types.User(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

"user": {
    "id": 508343,
    "email": "user@example.com",
    "created_at": "2013-04-30T20:28:12Z",
    "is_admin": true,
    "first_name": "Harvest",
    "last_name": "User",
    "timezone": "Eastern Time (US & Canada)",
    "is_contractor": false,
    "telephone": "",
    "is_active": true,
    "has_access_to_all_future_projects": true,
    "default_hourly_rate": 0,
    "department": "",
    "wants_newsletter": true,
    "updated_at": "2015-04-29T14:54:19Z",
    "cost_rate": null,
    "identity_account_id": 302900,
    "identity_user_id": 20725
}
cost_rate

Optional: Cost (internal) rate for user.

created_at
default_hourly_rate

Optional: Default rate for the user in new projects, if no rate is specified.

department

Optional: Department for user.

email
first_name
has_access_to_all_future_projects

Optional: If true this user will automatically be assigned to all new projects.

id
identity_account_id
identity_user_id
is_active

Optional: If the user is active, or archived (true, false)

is_admin

Optional: To create a new admin user

is_contractor

Optional: To create a new contractor user.

last_name
linked_day_entries
linked_expenses
linked_invoices
telephone

Optional: Telephone number for user.

timezone

Optional: To set a timezone other than the account default.

updated_at
wants_newsletter
statsbiblioteket.harvest.harvest_types.clean(fields)[source]
statsbiblioteket.harvest.harvest_types.cleanNones(fields)[source]
statsbiblioteket.harvest.harvest_types.cleanPrivates(fields)[source]
statsbiblioteket.harvest.harvest_types.cleanSQL(fields)[source]

statsbiblioteket.harvest.invoices module

class statsbiblioteket.harvest.invoices.Invoices(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

add_invoice(invoice: statsbiblioteket.harvest.harvest_types.Invoice)[source]

Create a new invoice http://help.getharvest.com/api/invoices-api/invoices/create-an-invoice/

delete_invoice(invoice_id)[source]

Delete an existing invoice by invoice_id http://help.getharvest.com/api/invoices-api/invoices/show-invoices/#delete-existing-invoice

get_invoice(invoice_id) → statsbiblioteket.harvest.harvest_types.Invoice[source]

Get an invoice by invoice_id http://help.getharvest.com/api/invoices-api/invoices/show-invoices/#show-a-single-invoice

invoices(start_date=None, end_date=None, updated_since=None, client_id=None, status_enum=None) → typing.List[statsbiblioteket.harvest.harvest_types.Invoice][source]

Get all the invoices, optionally filtered by: - start and end dates - client_id - status - updated since date http://help.getharvest.com/api/invoices-api/invoices/show-invoices/#show-recently-created-invoices

update_invoice(invoice_id, invoice: statsbiblioteket.harvest.harvest_types.Invoice)[source]

Update an existing invoice by invoice_id http://help.getharvest.com/api/invoices-api/invoices/show-invoices/#update-existing-invoice

statsbiblioteket.harvest.projects module

class statsbiblioteket.harvest.projects.Projects(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

assign_user_to_project(project_id, user_id)[source]

ASSIGN A USER TO A PROJECT POST /projects/#{project_id}/user_assignments

create_project(project) → str[source]

Create a project and return the project id

delete_project(project_id)[source]

Delete a project

If the project does not have any timesheet data tracked to it, it is deleted with HTTP Response: 200 OK. If the project does have timesheet entries associated, the project is not deleted and HTTP Response: 400 Bad Request is returned.

expenses_for_project(project_id) → typing.List[statsbiblioteket.harvest.harvest_types.Expense][source]

Get the expenses for a project

get_project(project_id) → statsbiblioteket.harvest.harvest_types.Project[source]

Get a particular project

projects(client_id: str = None) → typing.List[statsbiblioteket.harvest.harvest_types.Project][source]

Get all the projects (optinally restricted to a particular client)

projects_for_client(client_id: str) → typing.List[statsbiblioteket.harvest.harvest_types.Project][source]

Get the projects for a particular client

timesheets_for_project(project_id, start_date, end_date) → typing.List[statsbiblioteket.harvest.harvest_types.DayEntry][source]

Get the timesheets for a project

toggle_project_active(project_id)[source]

Toggle the active flag of a project

update_project(project_id, project: statsbiblioteket.harvest.harvest_types.Project)[source]

Update a project Post similar XML or JSON as with create a new project, but include project-id as part of the project.

statsbiblioteket.harvest.rest module

exception statsbiblioteket.harvest.rest.HarvestError[source]

Bases: Exception

Custom class for Harvest exceptions

class statsbiblioteket.harvest.rest.Rest(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: object

classmethod status()[source]

Global scope status function

statsbiblioteket.harvest.task_assignments module

class statsbiblioteket.harvest.task_assignments.TaskAssignments(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

assign_task_to_project(project_id, **kwargs)[source]

ASSIGN A TASK TO A PROJECT POST /projects/#{project_id}/task_assignments

change_task_from_project(project_id, task_id, data, **kwargs)[source]

CHANGING A TASK FOR A PROJECT PUT /projects/#{project_id}/task_assignments/#{task_assignment_id}

create_task_to_project(project_id, **kwargs)[source]

CREATE A NEW TASK AND ASSIGN IT TO A PROJECT POST /projects/#{project_id}/task_assignments/add_with_create_new_task

get_all_tasks_from_project(project_id) → typing.List[statsbiblioteket.harvest.harvest_types.Task][source]

GET ALL TASKS ASSIGNED TO A GIVEN PROJECT /projects/#{project_id}/task_assignments

get_one_task_assigment(project_id, task_id)[source]

GET ONE TASK ASSIGNMENT GET /projects/#{project_id}/task_assignments/#{task_assignment_id}

remove_task_from_project(project_id, task_id)[source]

REMOVING A TASK FROM A PROJECT DELETE /projects/#{project_id}/task_assignments/#{task_assignment_id}

statsbiblioteket.harvest.tasks module

class statsbiblioteket.harvest.tasks.Tasks(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

activate_task(task_id)[source]

ACTIVATE EXISTING ARCHIVED TASK

create_task(task: statsbiblioteket.harvest.harvest_types.Task)[source]

CREATE NEW TASK Example: client.create_task(task={“name”:”jo”})

delete_task(task_id)[source]

ARCHIVE OR DELETE EXISTING TASK Returned if task does not have any hours associated - task will be deleted. Returned if task is not removable - task will be archived.

get_task(task_id) → statsbiblioteket.harvest.harvest_types.Task[source]

Get a particular task by task_id

tasks(updated_since=None) → typing.List[statsbiblioteket.harvest.harvest_types.Task][source]

Get all teh tasks (optionally updated since a particular date) /tasks?updated_since=2010-09-25+18%3A30

update_task(task_id, task: statsbiblioteket.harvest.harvest_types.Task)[source]

UPDATE AN EXISTING TASK Example: client.update_task(task_id, task={“name”: “jo”})

statsbiblioteket.harvest.timetracking module

class statsbiblioteket.harvest.timetracking.Timetracking(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

add_day_entry(day_entry: statsbiblioteket.harvest.harvest_types.DayEntry)[source]

Create a new time entry?

add_day_entry_for_user(user_id, day_entry: statsbiblioteket.harvest.harvest_types.DayEntry)[source]

Add data for a user

delete_day_entry(entry_id)[source]

Delete an entry

get_day(day_of_the_year=1, year=2012) → statsbiblioteket.harvest.harvest_types.Day[source]

Get time tracking for a day of a particular year

get_day_entry(entry_id) → statsbiblioteket.harvest.harvest_types.DayEntry[source]

Get a time entry by entry_id

today() → statsbiblioteket.harvest.harvest_types.Day[source]

today property

toggle_timer(entry_id)[source]

Toggle the timer for an entry

update_day_entry(entry_id, day_entry: statsbiblioteket.harvest.harvest_types.DayEntry)[source]

Update an entry

statsbiblioteket.harvest.users module

class statsbiblioteket.harvest.users.Users(uri, email=None, password=None, client_id=None, token=None)[source]

Bases: statsbiblioteket.harvest.rest.Rest

delete_user(user_id)[source]

Delete a person http://help.getharvest.com/api/users-api/users/managing-users/#delete-a-user

get_user(user_id) → statsbiblioteket.harvest.harvest_types.User[source]

Get a particular person by person_id

toggle_user_active(user_id)[source]

Toggle the active flag of a person http://help.getharvest.com/api/users-api/users/managing-users/#toggle-an-existing-user

users() → typing.List[statsbiblioteket.harvest.harvest_types.User][source]

Get all the people http://help.getharvest.com/api/users-api/users/managing-users/

Module contents

Harvest Time Tracking API Client