Documentation for the pyflix.loaders package
The pyflix.loaders package contains a file_helpers module that allows you to load episode information
from a CSV file or video file names.
Details of the load_from_csv function
The load_from_csv function loads data from a csv file. The separator must be
a semicolon (;) and the file must have the following header:
| "tvshow" | "season" | "ep_number" | "ep_title" | "duration" | "year" |
|---|---|---|---|---|---|
Details of the load_from_filenames function
The load_from_filenames function extracts information from the video file name.
The file name must have the following structure: series_name-sXXeYY-episode_title.ext.
series_nameis a string containing the name of the series. The_will be replaced by spaces.XXis an integer representing the season number with 2 digits. Season 1 will be01.YYis an integer representing the episode number with 2 digits. Episode 1 will be01.episode_titleis a string containing the episode title. The_will be replaced by spaces.
load_from_csv(file_path)
Générateur qui fournit les informations média série à partir d'un fichier csv
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path | str
|
Chemin vers un fichier csv correctement formaté |
required |
Source code in src/pyflix/loaders/file_helpers.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
load_from_filenames(dir_path)
Générateur qui fournit les informations média série à partir du nom des fichiers du répertoire.
Cette fonction se base sur les regex pour extraire les informations à partir d'un nom de fichier. Voir la documentation pour les détails sur la regax.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_path
|
Path | str
|
Chemin vers un répertoire de fichiers média correctement formatés |
required |
Source code in src/pyflix/loaders/file_helpers.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
load_from_sources(sources)
Générateur qui fournit les informations média série à partir d'une liste de sources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources
|
list[Path | str]
|
Liste chemins soit vers des fichiers csv soit vers des répertoires. |
required |
Source code in src/pyflix/loaders/file_helpers.py
44 45 46 47 48 49 50 51 52 53 54 55 56 | |