Skip to main content

analytix is a simple yet powerful API wrapper to make getting analytical information from your favourite services easier than ever.

Project description

analytix

PyPi version PyPI pyversions License

analytix is a simple yet powerful API wrapper to make getting analytical information from your favourite services easier than ever. Note: Only the YouTube Anaytics API is supported as this time, though more will be added over time!

Installation

Python 3.6 or greater is required.

You can install the latest version of analytix using the following command:

# Linux/macOS
python3 -m pip install -U analytix

# Windows
py -3 -m pip install -U analytix

# In a virtual environment
pip install analytix

You can also install the development version by running the following (this example assumes you're on Linux/macOS):

$ git clone https://github.com/parafoxia/analytix
$ cd analytix
$ git checkout develop
$ python3 -m pip install -U .

Getting started

To get started with analytix, have a look at the documentation.

Quick example

The following example shows you how to save a CSV of day-by-day analytics for 2020 from the YouTube Analytics API:

import datetime as dt

from analytix.youtube import TimeBasedYouTubeAnalytics, YouTubeService

service = YouTubeService("./secrets.json")  # Load from secrets file
service.authorise("yt-analytics.readonly", "yt-analytics-monetary.readonly")
analytics = TimeBasedYouTubeAnalytics(service)
report = analytics.retrieve(
    ("views", "likes", "comments"),
    start_date=dt.date(2020, 1, 1),
    end_date=dt.date(2020, 12, 31),
    dimensions=("day",)
)
report.to_csv("./analytics.csv")

You can also use the metrics attribute to any report to use all valid metrics for a report:

analytics.metrics

Contributing

If you're interested in contributing to analytix, check out the contributing guide.

License

The analytix module for Python is licensed under the BSD-3-Clause License.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

analytix-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

analytix-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file analytix-0.1.0.tar.gz.

File metadata

  • Download URL: analytix-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for analytix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d3e02125b9c27bb4f19454b7c851e923636ed84e039302faf9e3637ac67e2b4b
MD5 bc2b6e9003908713e8ef12d923f607c9
BLAKE2b-256 67dc38d23fed4db3905a708036f4aa990a1736eb12713385e4c18c572050f7e6

See more details on using hashes here.

File details

Details for the file analytix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: analytix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for analytix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 042494782a0fe8a7c1c148f5d386378afe53ef743cb8d2ac589834b98e2c746d
MD5 61f2e336587af8264475463e96b8d2ac
BLAKE2b-256 ecf878d3969b5c9cb59465bce46edd68547757879b2d1a1d7171f7eea290813f

See more details on using hashes here.

Supported by

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