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.8.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.8-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ytpa_api_utils-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 53a50442f1ffb52d4c03c09dc4395d76527c09531deb866d494411110f2729f3
MD5 22c3540a62c987215ed292de0a297713
BLAKE2b-256 37216c8533511c472ab8f32581c6dc269d8959d0b7a140bb6fd41a18ff58d9e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ytpa_api_utils-0.1.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2f94355a588e2ec1fcae919b8d780ca9e9661e2c27dd4f4c9f654953d8d99030
MD5 5045ed5f2d5bab7613cb2162b123064e
BLAKE2b-256 65d9154947a23f61268b47728291f0a134b65fc66324ffe47c558e89b38cefeb

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