{ "info": { "author": "Jonas Obrist, Henry Barnor", "author_email": "ojiidotch@gmail.com, henry@leftronic.com", "bugtrack_url": null, "classifiers": [], "description": "##########\r\nLeftronicd\r\n##########\r\n\r\nA script to periodically post information to leftronic.com\r\n\r\n\r\n************\r\nInstallation\r\n************\r\n\r\n* Make a virtualenv\r\n* ``pip install leftronicd``\r\n\r\n\r\n*************\r\nConfiguration\r\n*************\r\n\r\nConfiguration is done in yaml.\r\n\r\naccesskey\r\n=========\r\n\r\nYour leftronic API access key.\r\n\r\nstreams\r\n=======\r\n\r\nA list of stream configurations.\r\n\r\nEach stream requires following values:\r\n\r\n* ``method``: The method that generates the value\r\n* ``type``: The type of value (eg ``number`` or ``leaderboard``)\r\n* ``name``: Name of the stream\r\n* ``verbosename``: Verbose name of the stream\r\n* ``interval``: Interval in seconds when the method should be called.\r\n\r\nAny other key-value pairs will be passed into the method.\r\n\r\nExample:: \r\n\r\n accesskey: SECRET\r\n streams:\r\n - method: leftronicd.contrib.github.repo_metric\r\n verbosename: django CMS Watchers\r\n name: django-cms-watchers\r\n type: number\r\n interval: 86400\r\n repo: divio/django-cms\r\n metric: watchers\r\n - method: leftronicd.contrib.github.repo_metric\r\n verbosename: django CMS Forks\r\n type: number\r\n interval: 86400\r\n name: django-cms-forks\r\n repo: divio/django-cms\r\n metric: forks\r\n\r\n\r\n****************\r\nBuilt-in methods\r\n****************\r\n\r\n\r\n``leftronicd.contrib.github.repo_metric``\r\n=========================================\r\n\r\nReports a metric from a github repository.\r\n\r\nConfiguration:\r\n\r\n* ``repo``: The repo name, eg ``ojii/leftronicd``\r\n* ``metric``: Which value to grab from the repo, eg ``forks``\r\n\r\nOptional configuration:\r\n\r\n* ``username``: The username (for private repos)\r\n* ``password``: The password (for private repos)\r\n\r\n\r\n*******\r\nRunning\r\n*******\r\n\r\n``leftronicd [-v]``\r\n\r\n\r\n**************\r\nCustom methods\r\n**************\r\n\r\nCustom data collecting methods can be any Python callable that returns a\r\n`Twisted Deferred`_ which calls attached callbacks with the value to be posted\r\nto leftronic.com.\r\n\r\nThe Python callable is called with all additional configuration parameters\r\ngiven for a stream.\r\n\r\nExample\r\n=======\r\n\r\nThis example will show the amount of GitHub followers a user has.\r\n\r\nPython code (let's assume it's in a module called 'custom')::\r\n\r\n from leftronicd.helpers import get_page\r\n import json\r\n \r\n def github_followers(username):\r\n def handler(data):\r\n return json.loads(data)['followers']\r\n return get_page(handler, 'https://api.github.com/users/%s' % username)\r\n\r\nAs you can see, we use the ``leftronicd.helpers.get_page`` helper here, for\r\ndetails, see below.\r\n\r\nStream configuration::\r\n\r\n accesskey: SECRET\r\n streams:\r\n - method: custom.github_followers\r\n verbosename: Github Followers\r\n name: my-github-followers\r\n type: number\r\n interval: 300\r\n username: ojii\r\n\r\n\r\n*******\r\nHelpers\r\n*******\r\n\r\n``leftronicd.helpers.get_page``\r\n===============================\r\n\r\nA wrapper around ``twisted.web.client.getPage``. Takes a handler function as\r\nfirst argument which is called with the content of the page if the page is\r\nloaded successful. The handler function should then return the value to be\r\npassed to leftronic. ``get_page`` returns a deferred which can be returned from\r\nyour custom methods.\r\n\r\nAll arguments after the handler argument are the same as in\r\n``twisted.web.client.getPage``.\r\n\r\n\r\n.. _Twisted Deferred: http://twistedmatrix.com/documents/current/core/howto/defer.html\r\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sonofabell/leftronicd", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "leftronicd_db", "package_url": "https://pypi.org/project/leftronicd_db/", "platform": "OS Independent", "project_url": "https://pypi.org/project/leftronicd_db/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sonofabell/leftronicd" }, "release_url": "https://pypi.org/project/leftronicd_db/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "A twisted based daemon to send metrics to leftronic.com", "version": "0.1.2" }, "last_serial": 794118, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "be216e70167784661b6baa06fc8cdd9f", "sha256": "62dc7f2326dce55043ed1edb69d3a7c5862f856bc8436f0c9b0e667d88949b71" }, "downloads": -1, "filename": "leftronicd_db-0.1.tar.gz", "has_sig": false, "md5_digest": "be216e70167784661b6baa06fc8cdd9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6327, "upload_time": "2012-05-24T23:59:08", "url": "https://files.pythonhosted.org/packages/5c/bb/ec6d8f49b7c0a59da7e3325eafd2e4273760cc56725ff938a16616c66435/leftronicd_db-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "602e9539198240123a00770620f5c615", "sha256": "9f47f04f51bd7e236503f7fe08c39d07786a6f0a03e02dc74f7e6a4075df06b4" }, "downloads": -1, "filename": "leftronicd_db-0.1.1.tar.gz", "has_sig": false, "md5_digest": "602e9539198240123a00770620f5c615", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6382, "upload_time": "2012-05-25T00:26:06", "url": "https://files.pythonhosted.org/packages/7c/bb/b54c41bdf849bf32931003f399936ad2b4b39574994a4beb24b228c20f84/leftronicd_db-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3a29293fc29a864c15c9539a78b3b77d", "sha256": "208bbd672a6b6dc2519a14972e3fbdf0219b17717c2da51578f8affdd5f990ce" }, "downloads": -1, "filename": "leftronicd_db-0.1.2.win32.exe", "has_sig": false, "md5_digest": "3a29293fc29a864c15c9539a78b3b77d", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 207064, "upload_time": "2012-05-26T20:23:50", "url": "https://files.pythonhosted.org/packages/37/f2/37c466c538cc1eb89861455bc3b065598627839237cf3dfe308b3aff849f/leftronicd_db-0.1.2.win32.exe" }, { "comment_text": "", "digests": { "md5": "e1a4e792d5e8f6009bcaac2e330f4c81", "sha256": "f659dff59ad0df3c8dbb07d827a8c2c7d4597c5caf3688d4248aae12d5fa17c3" }, "downloads": -1, "filename": "leftronicd_db-0.1.2.zip", "has_sig": false, "md5_digest": "e1a4e792d5e8f6009bcaac2e330f4c81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10428, "upload_time": "2012-05-26T20:05:04", "url": "https://files.pythonhosted.org/packages/a0/07/1137879d66ee6706833ca7d0f723323bd2236d6c999dff49e9ffcad60eb0/leftronicd_db-0.1.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3a29293fc29a864c15c9539a78b3b77d", "sha256": "208bbd672a6b6dc2519a14972e3fbdf0219b17717c2da51578f8affdd5f990ce" }, "downloads": -1, "filename": "leftronicd_db-0.1.2.win32.exe", "has_sig": false, "md5_digest": "3a29293fc29a864c15c9539a78b3b77d", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 207064, "upload_time": "2012-05-26T20:23:50", "url": "https://files.pythonhosted.org/packages/37/f2/37c466c538cc1eb89861455bc3b065598627839237cf3dfe308b3aff849f/leftronicd_db-0.1.2.win32.exe" }, { "comment_text": "", "digests": { "md5": "e1a4e792d5e8f6009bcaac2e330f4c81", "sha256": "f659dff59ad0df3c8dbb07d827a8c2c7d4597c5caf3688d4248aae12d5fa17c3" }, "downloads": -1, "filename": "leftronicd_db-0.1.2.zip", "has_sig": false, "md5_digest": "e1a4e792d5e8f6009bcaac2e330f4c81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10428, "upload_time": "2012-05-26T20:05:04", "url": "https://files.pythonhosted.org/packages/a0/07/1137879d66ee6706833ca7d0f723323bd2236d6c999dff49e9ffcad60eb0/leftronicd_db-0.1.2.zip" } ] }