Skip to main content

Library for efficiently adding analytics to your project.

Project description

py-analytics
============

Py-Analytics is a library designed to make it easy to provide analytics as part of any project.

The project's goal is to make it easy to store and retrieve analytics data. It does not provide
any means to visualize this data.

Currently, only ``Redis`` is supported for storing data.

Requirements
------------

Required
~~~~~~~~

Requirements **should** be handled by setuptools, but if they are not, you will need the following Python packages:

* nydus
* redis
* dateutil

Optional
~~~~~~~~
* hiredis

analytics.create_analytic_backend
----------------------------------

Creates an analytics object that allows to to store and retrieve metrics::

>>> from analytics import create_analytic
>>>
>>> analytics = create_analytic({
>>> 'backend': 'analytics.backends.redis.Redis',
>>> 'settings': {
>>> 'defaults': {
>>> 'host': 'localhost',
>>> 'port': 6379,
>>> 'db': 0,
>>> },
>>> 'hosts': [{'db': 0}, {'db': 1}, {'host': 'redis.example.org'}]
>>> },
>>> })

Internally, the ``Redis`` analytics backend uses ``nydus`` to distribute your metrics data over your cluster of redis instances.

There are two required arguements:

* ``backend``: full path to the backend class, which should extend analytics.backends.base.BaseAnalyticsBackend

* ``settings``: settings required to initialize the backend. For the ``Redis`` backend, this is a list of hosts
in your redis cluster.

TODO
----

* Add more backends (MySQL, Postgres, ...)
* Add an API so it can be deployed as a stand alone service

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

analytics-0.2.0.tar.gz (7.5 kB view details)

Uploaded Source

File details

Details for the file analytics-0.2.0.tar.gz.

File metadata

  • Download URL: analytics-0.2.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for analytics-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4a67fceef5cc13f3640e050c818f6d7eacdaca366a954ab6209962113a7b32b6
MD5 9daf6cf0bbf4d5031ce7eea1d8f18140
BLAKE2b-256 dc0b77371d251896eca8b0b5d34faefa4973626833ebc408a1eea63e35553c72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page