zeitsprung package¶
Submodules¶
zeitsprung.base module¶
zeitsprung.database module¶
-
class
zeitsprung.database.SQLiteEngine(db_file: str, verbose: bool = True)[source]¶ Bases:
zeitsprung.base.BaseClass to set up and access a SQLite database to store the data from the ‘zeitsprung.fm’ website.
-
create_connection() → sqlite3.Connection[source]¶ Creates a connection object using the provided credentials in instance creation.
- Returns
A object for connecting to the database.
- Return type
Connection
-
insert_audio_row(row: list) → None[source]¶ Inserts a record row into the ‘audio’ relation.
- Parameters
row (list) – Values to insert.
- Returns
- Return type
None
-
insert_meta_row(row: list) → None[source]¶ Inserts a record row into the ‘meta’ relation.
- Parameters
row (list) – Values to insert.
- Returns
- Return type
None
-
query_all_audio() → pandas.core.frame.DataFrame[source]¶ Queries the complete record from the ‘audio’ relation and parses it into a DataFrame object.
- Returns
The audio table.
- Return type
DataFrame
-
query_all_meta() → pandas.core.frame.DataFrame[source]¶ Queries the complete record from the ‘meta’ relation and parses it into a DataFrame object.
- Returns
The meta table.
- Return type
DataFrame
-
zeitsprung.scraping module¶
-
class
zeitsprung.scraping.Scraper(data_folder: str, update_interval: int = 86400, reset: bool = False, verbose: bool = True)[source]¶ Bases:
zeitsprung.base.BaseClass for scraping and preprocessing the data from the ‘www.zeitsprung.fm’ website.
-
get_episode_audio(url: str) → Optional[pydub.audio_segment.AudioSegment][source]¶ Downloads the audio of a specified episode.
- Parameters
url (str) – URL to download the audio from.
- Returns
The audio of the episode.
- Return type
AudioSegment
-
get_episode_meta(i: int) → Optional[list][source]¶ Gets the episodes meta data (title, description, publication and modified at date) and stores it to the database.
- Parameters
i (int) – Number of the episode (i - 1).
- Returns
List containing the meta data of the episode.
- Return type
list
-
run() → None[source]¶ Start the scraper, which will download the meta data and audio files of all not yet existing episodes in the database.
- Returns
- Return type
None
-
Module contents¶
Top-level package for zeitsprung.