{ "info": { "author": "Devin Fee", "author_email": "devin.fee@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Pyramid", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2" ], "description": "pyramid_analytics\n=================\n\nSegment.io initializer for the Pyramid Web Framework. 100% Nose Test Covered.\n\nConfiguration\n-------------\n- To use pyramid_analytics, you should include the following directive in your\n configuration file::\n\n pyramid.includes =\n pyramid_analytics\n\n- The following configuration options are available. Note, \n ``analytics.api_token`` and ``analytics.secret`` are required.::\n\n analytics.api_token = mytoken\n analytics.async = True\n analytics.flush_after = 10\n analytics.flush_at = 20\n analytics.max_queue_size = 100000\n analytics.secret = mysekret\n analytics.send = True\n \n- ``flush_after`` specifies after how much time (in seconds) of no flushing \n that the server will flush. Used in conjunction with the flush_at size \n policy.\n\n- To manage the ``log_level`` and ``log`` options specified by Segment.io's\n analytics-python, you should set the following configuration in your .ini\n file::\n\n [logger_analytics]\n level = WARN\n handlers = console # The config needs to include this handler\n qualname = analytics\n propagate = 0 # This \"disables\" logging\n formatter = generic # The config needs to include this formatter \n\n Additionally, you'll want to register this logger:\n\n- Under the hood, analytics-python turns logging \"off\" by setting the logging\n level to ``CRITICAL``. Setting ``propagate = 0`` is perhaps a more elegant\n solution.\n \n- All other options are detailed at `Segment.io's Python Documentation \n `_.\n\n\nPyramid Integration\n-------------------\n- This library attaches an attribute, ``analytics``, to the request object.\n pyramid_analytics checks for an ``authenticated_userid`` with the Pyramid\n api, and will identify or track data for the authenticated user.\n\n- To update the userid that this ``analytics`` package makes calls on behalf\n of, you should send a new ``UpdatedAnalyticsUserId`` event. Example::\n\n from pyramid_analytics.events import UpdatedAnalyticsUserId\n\n # ...\n # User logged in\n event = UpdatedAnalyticsUserId(request, userid, alias=False)\n request.registry.notify(event)\n\n This event will update the analytic. If a user registers for your service,\n you should set ``alias=True``. This does not send any code to segment.io,\n but instead plays nicely with the Jinja2 template described below.\n\n- This analytics package sends as much data directly from your server as it\n can, and falls back on supplying events to the browser via the Jinja2 \n template. Below are the examples of identifying and tracking::\n\n # identify the authenticated user with certain traits (timestamp and \n # context are optional and described by the segment.io documentation)\n request.analytics.identify(traits, timestamp=None, context=None)\n\n # identify a (not identified) user with certain traits (timestamp and \n # context are optional and described by the segment.io documentation)\n request.analytics.identify_foreign(user_id, traits, timestamp=None, \n context=None)\n\n # track an authenticated user with an event and properties (timestamp and \n # context are optional and described by the segment.io documentation)\n request.analytics.track(event, properties, timestamp=None, context=None)\n\n # track a (not identified) user with an event and properties (timestamp and\n # context are optional and described by the segment.io documentation)\n request.analytics.track_foreign(user_id, event, properties, timestamp=None,\n context=None)\n\n- When Pyramid fires the ``BeforeRender`` event, pyramid_analytics adds the\n following to the renderer globals::\n\n analytics: {\n api_token: 'mytoken',\n tracking: {\n alias: userid, // or null if analytics hasn't been told to alias\n events: [{event: 'myevent', \n properties: {property1: 'pvalue1'},\n context: {context1: 'cvalue1'}}]\n identify: userid, // or null\n }\n tracking_json: '...' // the tracking item as json\n }\n\n\nJinja2 Integration\n------------------\n- An easy to use jinja2 template is provided. To use this template, you must\n add pyramid_analytics to your jinja2 search path. If you're using Pyramid's\n pyramid_jinja2, update your config.ini as shown below::\n\n jinja2.directories =\n pyramid_analytics:templates\n myapp:templates\n\n- To use the template, place this in your templates after including \n segment.io's javascript::\n\n {# Segment.io's javascript precedes this... #}\n {% include 'analytics.jinja2' %}\n\nAdditional\n----------\n- For more information, visit `Segment.io's Python Documentation \n `_ and\n `Segment.io's Javascript Documentation \n `_.\n\n\n0.2.1 (2013-07-03)\n------------------\n\n- Fixed MANIFEST.in to include all necessary files\n\n\n0.2 (2013-07-02)\n----------------\n\n- Added AnalyticsHelper to the package, provide deeper Pyramid integration.\n\n0.1.2 (2013-07-02)\n------------------\n\n- Relying on Pyramid's asbool helper for more robust boolean detection.\n\n\n0.1 (2013-07-01)\n----------------\n\n- Allow for the following segment.io configuration options: \n ``secret``, \n ``flush_at``, \n ``flush_after``, \n ``async``,\n ``send``, \n ``max_queue_size``\n\n- Logging configuration is also supported", "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/dfee/pyramid_analytics", "keywords": "segment.io analytics pyramid", "license": "BSD-derived (http://www.repoze.org/LICENSE.txt)", "maintainer": null, "maintainer_email": null, "name": "pyramid_analytics", "package_url": "https://pypi.org/project/pyramid_analytics/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyramid_analytics/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dfee/pyramid_analytics" }, "release_url": "https://pypi.org/project/pyramid_analytics/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Segment.io wrapper for the Pyramid Web Framework", "version": "0.2.1" }, "last_serial": 807534, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3c5c7d8bfd8fd5a23a263e327c063b36", "sha256": "422448476a54986a9c380322adccfb7c12b7f055b8d8934282663d885be1f9a2" }, "downloads": -1, "filename": "pyramid_analytics-0.1.tar.gz", "has_sig": false, "md5_digest": "3c5c7d8bfd8fd5a23a263e327c063b36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4596, "upload_time": "2013-07-01T22:53:07", "url": "https://files.pythonhosted.org/packages/e3/d6/4c7df2ba90fc8d07f218221a85e3fcfa10f1592f8c7d4b8b222ff00d0c68/pyramid_analytics-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d466dfd4b986e17b400aa77f3e8d7b67", "sha256": "e417eab078affd00bb1111e3a8fd95b2f974fbc849ebf64ba3d584f403e1a756" }, "downloads": -1, "filename": "pyramid_analytics-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d466dfd4b986e17b400aa77f3e8d7b67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4609, "upload_time": "2013-07-01T22:55:07", "url": "https://files.pythonhosted.org/packages/eb/c0/de174a7387fcbb72cb4e72c210f1151c34714f6b1e405d5152517d19dc92/pyramid_analytics-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "86435df03c10c897308e43dd6dbfd0b4", "sha256": "5e50fdd4a3a1eec643954055b553d5e90e8534de738956fe99f2ef883e78b517" }, "downloads": -1, "filename": "pyramid_analytics-0.1.2.tar.gz", "has_sig": false, "md5_digest": "86435df03c10c897308e43dd6dbfd0b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4484, "upload_time": "2013-07-02T15:28:25", "url": "https://files.pythonhosted.org/packages/4f/4a/3f4eedee2abbb1fc9975a525ff04205566b3e5e0cc6d3f2f70675540fef0/pyramid_analytics-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "48784ac63ceb8ac8eb769caf35efe2c7", "sha256": "21a143a74ad27af86694197874706de2970d538d5c15b312952c41027f1701c4" }, "downloads": -1, "filename": "pyramid_analytics-0.2.tar.gz", "has_sig": false, "md5_digest": "48784ac63ceb8ac8eb769caf35efe2c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7967, "upload_time": "2013-07-03T00:55:30", "url": "https://files.pythonhosted.org/packages/40/f3/18301ae3c91b53b57fecb7e9c8a4dd8195f954ab651b7dfa97a737469ef0/pyramid_analytics-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "25f1797de42ec97b6e36cea2b3b32f1d", "sha256": "cf5237e61bea8b08dfca3cced7a0f4a73887f01176379eef92e7dd2c657ba92a" }, "downloads": -1, "filename": "pyramid_analytics-0.2.1.tar.gz", "has_sig": false, "md5_digest": "25f1797de42ec97b6e36cea2b3b32f1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8386, "upload_time": "2013-07-03T21:38:23", "url": "https://files.pythonhosted.org/packages/a6/d6/336d878c9745747f34dc034f6a4b7822207c107338bb5b7c674addaadb62/pyramid_analytics-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "25f1797de42ec97b6e36cea2b3b32f1d", "sha256": "cf5237e61bea8b08dfca3cced7a0f4a73887f01176379eef92e7dd2c657ba92a" }, "downloads": -1, "filename": "pyramid_analytics-0.2.1.tar.gz", "has_sig": false, "md5_digest": "25f1797de42ec97b6e36cea2b3b32f1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8386, "upload_time": "2013-07-03T21:38:23", "url": "https://files.pythonhosted.org/packages/a6/d6/336d878c9745747f34dc034f6a4b7822207c107338bb5b7c674addaadb62/pyramid_analytics-0.2.1.tar.gz" } ] }