{"id":18614083,"url":"https://github.com/enthought/python-analytics","last_synced_at":"2025-11-03T03:30:21.884Z","repository":{"id":28805484,"uuid":"32328564","full_name":"enthought/python-analytics","owner":"enthought","description":"Default Repo description from terraform module","archived":false,"fork":false,"pushed_at":"2015-06-17T15:24:05.000Z","size":284,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-12-27T02:43:11.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enthought.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-16T13:58:05.000Z","updated_at":"2021-06-01T16:38:41.000Z","dependencies_parsed_at":"2022-09-02T16:59:49.193Z","dependency_job_id":null,"html_url":"https://github.com/enthought/python-analytics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fpython-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fpython-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fpython-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fpython-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enthought","download_url":"https://codeload.github.com/enthought/python-analytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239406445,"owners_count":19633024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:25:03.038Z","updated_at":"2025-11-03T03:30:21.823Z","avatar_url":"https://github.com/enthought.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==================\n Python Analytics\n==================\n\n\nA very basic client library for server-side Google Universal Analytics\ncollection.\n\n\nBasic Usage\n===========\n\nCurrently ``python-analytics`` only supports sending the ``event`` hit\ntype to Google Analytics.  There are no plans at this stage to extend\nit beyond this.\n\nIn the most basic case where there are no custom dimensions or metrics\ndefined, the provided types may be used directly::\n\n    \u003e\u003e\u003e from python_analytics import Tracker, Event\n    \u003e\u003e\u003e tracker = Tracker('GA-ID')\n    \u003e\u003e\u003e event = Event(category='my-category', action='an-action', label='An Item', value=1)\n    \u003e\u003e\u003e tracker.send(event)\n\n\nIf custom dimensions or metrics are required, a subclass of event is\nrequired to provide developer-readable symbolic names for the custom\nattributes::\n\n    \u003e\u003e\u003e from python_analytics import Tracker, Event, CustomDimension, CustomMetric\n    \u003e\u003e\u003e tracker = Tracker('GA-ID')\n    \u003e\u003e\u003e class DownloadEvent(Event):\n    ...     filename = CustomDimension(1)\n    ...     target_architecture = CustomDimension(2)\n    ...     file_size = CustomMetric(1)\n    ...\n    \u003e\u003e\u003e event = DownloadEvent(\n    ...     category='downloads',\n    ...     action='download-installer',\n    ...     filename='installer.msi',\n    ...     target_architecture='x86_64',\n    ...     file_size=14322978,\n    ... )\n    # This handles encoding the custom dimensions as expected\n    \u003e\u003e\u003e print(event.encode())\n    {'cd2': 'x86_64', 'cm1': 14322978, 'cd1': 'installer.msi',\n     'ea': 'download-installer', 't': 'event', 'ec': 'downloads'}\n    \u003e\u003e\u003e tracker.send(event)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fpython-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenthought%2Fpython-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fpython-analytics/lists"}