New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

SlyYTAAPI

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

SlyYTAAPI

No-boilerplate, async and typed YouTube Analytics API access.

  • 0.2.0
  • PyPI
  • Socket score

Maintainers
1

sly logo Sly YTAAPI for Python

🐍 For Python 3.10+

No boilerplate, async and typed Youtube Analytics API access. 😋

pip install slyytaapi

This library does not have full coverage. Currently, the following topics are supported:

  • Targeted queries for channels and videos

You can directly grant user tokens using the command line, covering the whole OAuth 2 grant process.


Example usage:

import asyncio
from datetime import date
from SlyYTAAPI import *

async def main():

    auth = OAuth2('test/app.json', 'test/user.json')
    analytics = YouTubeAnalytics('UCxATMl-Cv8BEF0FtZMRvRgA', auth)

    result = await analytics.query(
        since=date(2020, 1, 1),
        end_date=date(2021, 1, 1),
        metrics=Metrics.SubsGained+Metrics.SubsLost+Metrics.WatchTime,
        dims=Dimensions.Day
        )

    result.saveCSV('test/test.csv')

asyncio.run(main())

Example CLI usage for getting authorized:

# WINDOWS
py -m SlyYTAAPI grant
# MacOS or Linux
python3 -m SlyYTAAPI grant

Granting credentials requires a Google Cloud Console account and JSON file. Please see https://docs.dunkyl.net/SlyAPI-Python/tutorial/oauth2.html for more information.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc