Skip to main content

API utils for the YouTube Predictive Analytics system

Project description

ytpa-api-utils

Description

This package contains utility functions used by the YouTube video predictive analytics (YTPA) system's API engine. They support functionality for:

  • requests: request_utils.py
  • websockets: websocket_utils.py
  • other: misc_utils.py

The file websocket_utils.py implements the send/receive logic for chunking a large pandas DataFrame, sending the chunks through a websocket connection, and assembling them into a single DataFrame on the other side. This allows for streaming DataFrames in a dynamic way while minimizing bandwidth per unit time. It hides the websocket logic from both sides of the transaction, making it possible to set up the websocket connection once and then deal only with DataFrame generators.

Installation

Install from PyPI with pip install ytpa-api-utils.

Make commands

Several make commands are implemented in Makefile.

Testing

Tests are implemented in the test/ directory, one file per module. Run them locally with make test.

Deploying a new package version

A new version of the package can be deployed by incrementing the version number in pyproject.toml and running make deploy. A better practice is to git push and allow the Github Actions pipeline to take care of running tests and deploying the new version only when the entire pipeline succeeds. Make sure to use the right version of the package in your other environments (update it in a requirements file and update the environment).

Project details


Download files

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

Source Distribution

ytpa_api_utils-0.1.7.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

ytpa_api_utils-0.1.7-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file ytpa_api_utils-0.1.7.tar.gz.

File metadata

  • Download URL: ytpa_api_utils-0.1.7.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.5 Linux/5.15.0-1053-azure

File hashes

Hashes for ytpa_api_utils-0.1.7.tar.gz
Algorithm Hash digest
SHA256 908b3fe7dc98b244a46403c8f7c7a02138f6524940ba3fc5c401ce233e3a936c
MD5 b5e7fa7f8ae51161476580507433dcbe
BLAKE2b-256 83b0abd357c4fa30a657f218763453a3e4404dc5e7fd0a5492a172e7ec042de9

See more details on using hashes here.

File details

Details for the file ytpa_api_utils-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ytpa_api_utils-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.5 Linux/5.15.0-1053-azure

File hashes

Hashes for ytpa_api_utils-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d7491e387c37b5e5794d6c8995c7ffad585d3b924d71a20c58272601394f6716
MD5 a8cb92f40ad357d52490536460b64e7c
BLAKE2b-256 f1906ab56f5e999c89c1a004fb4608eaaa3784e7e290882c7ec8033129684c60

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