This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A client for Timetric (http://timetric.com).

Requirements (easy-installable, listed as prereqs in setup.py):

  • httplib2
  • python-dateutil
  • simplejson

Optionally, if you want to use OAuth authentication:

  • oauth

This is not listed as a prereq, so it won’t be installed by default.

Authentication setup

You’ll provide authentication information to the TimetricClient in a config dict. Timetric supports two types of authentication: OAuth and API tokens. You can choose a method using the 'authtype' key to the config dict. The value of this key can be 'oauth' or 'apitoken'; if not given it defaults to 'oauth'.

If an API token is being used, there must be keys for:

  • ‘apitoken_key’
  • ‘apitoken_secret’

If OAuth is being used, there must also be keys for:

  • ‘consumer_key’
  • ‘consumer_secret’

and if you have already done the necessary key exchange, then this can also contain:

  • ‘access_key’
  • ‘access_token’

OAuth setup

The first time you use the OAuth protocol, you’ll need to do some key exchange with Timetric to set up your tokens.

>>> import timetric

# You need a config dict with at minimum your secret and key from Timetric # (see the “Applications” pane of the settings page). In a real app you’ll # want to make this config persistant (the shelve module is a lightweight # place to start) because the library will store OAuth authentication # information back to this config. >>> conf = {‘authtype’:’oauth’, … ‘consumer_key: ‘XXX’, … ‘consumer_secret’: ‘XXX’} >>> client = timetric.TimetricClient(conf)

# The first time through you’ll need to authorize your key with Timetric # by sending the user to an authorization request page. >> token = client.get_request_token() >>> import webbrowser >>> webbrowser.open(client.get_authorize_url(token))

# Once the user has authorized at that page, you can continue. >>> access_token = client.get_access_token(token)

# You can now re-authorize to use this token: >>> conf.update({‘oauth_key’:access_token.key, … ‘oauth_secret’:access_token.secret}) >>> client = timetric.TimetricClient(conf)

API token setup

>>> import timetric

# Having got your config dict from somewhere: >>> conf = {‘authtype’:’apitoken’, … ‘apitoken_key’: ‘XXX’, .. ‘apitoken-secret’: ‘XXX’}

# you initialize the timetric client: >>> client = timetric.TimetricClient(conf)

Usage

# There's no API method to get a list of a particular
# user's series, so you need to somehow "know" the series ID.
>>> series = client.series('p-DpewL0TO-iBE4nMBCTsQ')

# Get the latest value
>>> series.latest()
(1236707269.0, 2.0)

# Iterate over the whole dataset
>>> for (timestamp, value) in series:
...     print timestamp, value
1236463646.39 3.0
1236486562.94 5.0
1236493503.37 6.0

# Update given a single value
>>> series.update(14)

# Update given an iterable of (time, value) pairs
>>> import time
>>> data = [(time.time() - 100, 11), (time.time() + 100, 15)]
>>> series.update(data)

# Update given a file of CSV data
>>> series.update(open('/tmp/data.csv'))

# Clear all the data out of the series
>>> series.delete()
Release History

Release History

1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
timetric-1.3.tar.gz (7.8 kB) Copy SHA256 Checksum SHA256 Source Jun 11, 2009

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting