Skip to main content

gmail

An object oriented library for working with the GMail API

Overview

A python library that wraps around the YouTube V3 API. You can use it find and manage YouTube resources including Videos, Playlists, Channels and Comments.

The library is modelled after Google's own documentation.

Requirements

  • Python 3.10+
  • Works on Linux, Windows, macOS, BSD

Installation

pip install google_email

Get started

To get started, you need a verified Google Account and Google API keys with the correct permissions.

How to Get A Google API Key

Follow the instructions in this short article to get an API key.

To get a particular video using the videos' id:

  1. Create an instance of the YouTube API passing in the path to the downloaded client secret file:
from tubectrl import YouTube

client_secrets_file = '/home/lyle/Downloads/secrets.json'
youtube = YouTube(client_secrets_file)
youtube.authenticate()
  1. Use the video id to find the video:
video = youtube.find_video_by_id('rfscVS0vtbw')
  1. To find many videos using their id's:
ids = ['rfscVS0vtbw', 'TFa38ONq5PY']
videos = youtube.find_videos(ids)
  1. To find the most popular videos in a given region e.g Kenya, pass in the region code:
popular_kenyan_videos = youtube.find_most_popular_video_by_region('ke')
  1. To search for videos (this returns an iterator):
from youtube.schemas import (
    SearchFilter, SearchOptionalParameters, SearchPart, YouTubeResponse, YouTubeRequest
)
from typing import Iterator
from youtube.models import Video

query: str = 'Python programming videos'
max_results: int = 10
part: SearchPart = SearchPart()
optional_parameters: SearchOptionalParameters = SearchOptionalParameters(
    q=query,
    maxResults=max_results,
    type=['video', 'playlist', 'channel']
)
search_request: YouTubeRequest = YouTubeRequest(
    part=part,
    optional_parameters=optional_parameters
)
video_iterator: Iterator = youtube.get_search_iterator(search_request)
videos: list[Video] = next(video_iterator)

Documentation and Tutorials

To learn more about the library including the documentation and tutorials, check out the libraries' documentation.

How to Contribute

To contribute, chack out the contribution guideline.

License

The API uses an MIT License

Developer

Lyle Okoth – @lylethedesigner on twitter

lyle okoth on medium

My email is lyceokoth@gmail.com

Here is my GitHub Profile

You can also find me on Linkedin

Metadata

Release files for googleemail 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for googleemail 0.0.1
File Size Uploaded Provenance
googleemail-0.0.1.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for googleemail 0.0.1
File Interpreter ABI Platform
googleemail-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / googleemail-0.0.1.tar.gz

Download URL googleemail-0.0.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0c39f0717b05d830a158c9275531fda6ee32f50e90d073300a04f95bb2581e2f
BLAKE2b-256 checksum
How to use checksums
e6f63c8056aad71ed7eb3e0df13e4ce0475e3cf19af7fc6b73180ed8a2357339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / googleemail-0.0.1-py3-none-any.whl

Download URL googleemail-0.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2559a944fbb58d899c4d133db7ac2094c51daa01634d8bf0bb3c97dc740de209
BLAKE2b-256 checksum
How to use checksums
e1162ec793ef2bead38060411221d87689caa5ea4bfb92020c31850236b00d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for googleemail 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page