Simplified fetching of media for Filonov library
Project description
Media Fetcher
Problem statement
Solution
media-fetcher performs fetching of images and videos performance from various data sources.
Deliverable (implementation)
media-fetcher is implemented as a:
- library - Use it in your projects with a help of
media_fetching.MediaFetchingServiceclass. - CLI tool -
media-fetchertool is available to be used in the terminal.
Deployment
Prerequisites
- Python 3.10+
- Google Ads API enabled and configured
- YouTube Data API enabled and configured
- (Optional) If using
taggingmodules - media-tagger configured
Installation
Install media-fetcher with pip install media-fetching command.
Usage
Fetching media
Once media-fetcher is installed you can call it:
media-fetcher \
--source <MEDIA_SOURCE> \
--media-type <MEDIA_TYPE> \
--extra_info <EXTRA_INFO_MODULES> \
--writer <WRITER_TYPE> \
--output <OUTPUT_FILE_NAME>
where:
<SOURCE>- source of media data:googleads- fetch all assets from a Google Ads account / MCC.file- fetch all assets with their tags and metrics from CSV filesyoutube- fetch public videos from a YouTube channel.
<MEDIA_TYPE>- type of media (YOUTUBE_VIDEO, VIDEO, IMAGE).<WRITER_TYPE>- writer identifier (check available options at garf-io library).<OUTPUT_FILE_NAME>- name of the file to store results of tagging (by defaultmedia_results).
Source customizations
Source customizations are performed via --source.parameters=value syntax (i.e. --googleads.account=1)
-
googleads:Mandatory:
- account=ACCOUNT_ID
Optional:
- ads_config_path=PATH-TO-GOOGLE-ADS-YAML
- campaign-types=CAMPAIGN_TYPE
- start-date=YYYY-MM-DD
- end-date=YYYY-MM-DD
-
youtube:Mandatory:
- channel=YOUTUBE_CHANNEL_ID
-
file:Mandatory:
- path=PATH_TO_FILE
Optional:
- media_identifier=IDENTIFIER_OF_MEDIA
- metric_names=COMMA_SEPARATED_METRIC_NAMES
-
bq:Mandatory:
- table=FULLY_QUALIFIED_TABLE_NAME (in
project.dataset.tableformat)
Optional:
- media_identifier=IDENTIFIER_OF_MEDIA
- metric_names=COMMA_SEPARATED_METRIC_NAMES
- table=FULLY_QUALIFIED_TABLE_NAME (in
-
sqldb:Mandatory:
- connection_string=DATABASE_CONNECTION_STRING (in SQLAlchemy format)
- table=TABLE_NAME
Optional:
- media_identifier=IDENTIFIER_OF_MEDIA
- metric_names=COMMA_SEPARATED_METRIC_NAMES
Available extra info modules
Source customizations are performed via --extra-info module.method syntax (i.e. --extra-info tagging.languages,googleads.main_geo)
Currently supported modules:
-
googleads:- main_geo - identifies main spending country for a media.
- approval_rate - calculates approval rate (from 0 to 1) for each media.
-
tagging:- language - identifies language of a media.
-
youtube:- language - identifies language of YouTube Video based on YouTube Data API.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file media_fetching-0.6.3.tar.gz.
File metadata
- Download URL: media_fetching-0.6.3.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b8894bebc125f52976f4fcc1f481bdc27c67b099a88f463ed94ab8f80987a0
|
|
| MD5 |
f6cefc078aad52893d248465eaf4840e
|
|
| BLAKE2b-256 |
60a375ad553ada20e5f98267aa67419f754c6bff82e7f949970f90d0ead2747b
|
File details
Details for the file media_fetching-0.6.3-py3-none-any.whl.
File metadata
- Download URL: media_fetching-0.6.3-py3-none-any.whl
- Upload date:
- Size: 36.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53e81e696f6f0e8dff3e0f1090168e32724393f9fe537a17adb190e745eb61aa
|
|
| MD5 |
5372cb97eb4902b60cc1afc506fbed22
|
|
| BLAKE2b-256 |
105dc0a87f0310118edbf19c51eaa3b21f37be33e1b5efe555829b0cbf81e4b1
|