Main package of the python bindings for oDesk API.
For convenience some most commonly used functionalities are imported here, so you can use:
from odesk import Client
from odesk import raise_http_error
Bases: object
Main API client with oAuth v1 authorization.
| public_key: | Public API key |
|---|---|
| secret_key: | API key secret |
| oauth_access_token: | |
| oAuth access token public key | |
| oauth_access_token_secret: | |
| oAuth access token secret key | |
| fmt: | (optional, default json) API response format. Currently only 'json' is supported |
| finreport: | (optional, default True) Whether to attach odesk.routers.finreport router |
| hr: | (optional, default True) Whether to attach odesk.routers.hr router |
| mc: | (optional, default True) Whether to attach odesk.routers.mc router |
| offers: | (optional, default True) Whether to attach odesk.routers.offers router |
| provider: | (optional, default True) Whether to attach odesk.routers.provider router |
| task: | (optional, default True) Whether to attach odesk.routers.task router |
| team: | (optional, default True) Whether to attach odesk.routers.team router |
| timereport: | (optional, default True) Whether to attach odesk.routers.timereport router |
| job: | (optional, default True) Whether to attach odesk.routers.job router |
Returns parsed Python object or raises an error.
| url: | Target url |
|---|---|
| data: | Dictionary with parameters |
| method: | (optional, default GET) HTTP method, possible values:
|
| fmt: | (optional, default json) API response format. Currently only 'json' is supported |
Perform oAuth v1 signed HTTP request.
| url: | Target url |
|---|---|
| data: | Dictionary with parameters |
| method: | (optional, default GET) HTTP method, possible values:
|
| headers: | (optional, default {}) Dictionary with header values |
Raise custom urllib2.HTTPError exception.
| url: | Url that caused an error |
|---|---|
| response: | urllib3 response object |
Bases: object
Main API client with oAuth v1 authorization.
| public_key: | Public API key |
|---|---|
| secret_key: | API key secret |
| oauth_access_token: | |
| oAuth access token public key | |
| oauth_access_token_secret: | |
| oAuth access token secret key | |
| fmt: | (optional, default json) API response format. Currently only 'json' is supported |
| finreport: | (optional, default True) Whether to attach odesk.routers.finreport router |
| hr: | (optional, default True) Whether to attach odesk.routers.hr router |
| mc: | (optional, default True) Whether to attach odesk.routers.mc router |
| offers: | (optional, default True) Whether to attach odesk.routers.offers router |
| provider: | (optional, default True) Whether to attach odesk.routers.provider router |
| task: | (optional, default True) Whether to attach odesk.routers.task router |
| team: | (optional, default True) Whether to attach odesk.routers.team router |
| timereport: | (optional, default True) Whether to attach odesk.routers.timereport router |
| job: | (optional, default True) Whether to attach odesk.routers.job router |
Returns parsed Python object or raises an error.
| url: | Target url |
|---|---|
| data: | Dictionary with parameters |
| method: | (optional, default GET) HTTP method, possible values:
|
| fmt: | (optional, default json) API response format. Currently only 'json' is supported |
Perform oAuth v1 signed HTTP request.
| url: | Target url |
|---|---|
| data: | Dictionary with parameters |
| method: | (optional, default GET) HTTP method, possible values:
|
| headers: | (optional, default {}) Dictionary with header values |
Here we watch the PYTHON_ODESK_BASE_URL variable and if it is defined, use it as BASE_URL.
Bases: exceptions.Exception
Base exception class.
Performs logging.
Bases: urllib2.HTTPError, odesk.exceptions.BaseException
Raise custom urllib2.HTTPError exception.
| url: | Url that caused an error |
|---|---|
| response: | urllib3 response object |
Bases: object
A special ‘proxy’ class to keep API methods organized.
Use this class for defining new routers.
Gets relative URL of API method and returns a full URL
Bases: odesk.namespaces.Namespace
Authorization router.
Has methods for retrieving access tokens and get_info() method for checking you’re authorized successfully and ready to work with API.
Returns access token and access token secret.
Returns authentication URL to be used in a browser.
Get a detailed info about current authnticated user and some data from his profile.
Returns OAuth consumer object.
Converts a mapping object to signed url query.
| url: | Target url |
|---|---|
| key: | Public API key |
| secret: | Public API key secret |
| data: | Dictionary with data parameters |
| method: | Mehtod to be called, default is GET |
| to_header: | If True, data will be encoded as auth headers |
Returns request token and request token secret.
Bases: object
Simple GDS query constructor.
Used to costruct odesk.utils.Query.
Bases: object
Simple GDS query.
Example::
client.timereport.get_provider_report('user1',
odesk.utils.Query(select=odesk.utils.Query.DEFAULT_TIMEREPORT_FIELDS,
where=(odesk.utils.Q('worked_on') <= date.today()) &
(odesk.utils.Q('worked_on') > '2010-05-01')))
Bases: object
A helper class to access cryptic GDS response as a list of dictionaries.
Raise an exception if parameter’s value not in options list.
JSON serialization of Decimal.
Converts decimal to string.