tonie-podcast-sync


Nametonie-podcast-sync JSON
Version 3.0.0 PyPI version JSON
download
home_pagehttps://github.com/alexhartm/tonie-podcast-sync
Summaryallows synching podcast episodes to creative tonies
upload_time2024-03-01 15:17:37
maintainer
docs_urlNone
authorAlexander Hartmann
requires_python>=3.10.11,<4.0.0
licenseMIT
keywords toniebox podcast
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tonie-podcast-sync

tonie-podcast-sync allows synching podcast episodes to [creative tonies](https://tonies.com).

This is a purely private project and has no association with Boxine GmbH.

# Constraints and Limitations

- currently limited to podcasts providing mp3 files
- tested with the following podcasts:
    - WDR [Maus Podcasts](https://www.wdrmaus.de/hoeren/MausLive/Podcasts/podcasts.php5), e.g.
        - [Gute Nacht mit der Maus](https://kinder.wdr.de/radio/diemaus/audio/gute-nacht-mit-der-maus/diemaus-gute-nacht-104.podcast)
        - [Maus zum Hören - 60 Minuten](https://kinder.wdr.de/radio/diemaus/audio/diemaus-60/diemaus-60-106.podcast)
        - [Maus Zoom - Kindernachrichten](https://kinder.wdr.de/radio/diemaus/audio/maus-zoom/maus-zoom-106.podcast)
    - [Bayern 2: Pumuckl - Der Hörspiel-Klassiker](https://www.br.de/mediathek/podcast/pumuckl/830)
    - [Checker Tobi Podcast](https://www.br.de/mediathek/podcast/checkpod-der-podcast-mit-checker-tobi/859)
    - [Anna und die wilden Tiere - der Podcast](https://www.br.de/mediathek/podcast/anna-und-die-wilden-tiere/858)
- ... but in general, it should hopefully work with all podcasts out there

# Prerequisites

- requires Python >= 3.10.11
- if you use the `volume_adjustment` feature for a Podcast, `ffmpeg` needs to be installed

# Usage

tonie-podcast-sync is available as [a pip package on pypi](https://pypi.org/project/tonie-podcast-sync). Install via

`pip install tonie-podcast-sync`

You then have two options of using this: via its CLI or as a python library.

## via CLI

The most convienent way is to just use the CLI:


A first step is to configure `tonie-podcast-sync`

```bash
tonie-podcast-sync create-settings-file
```

The command will guide you through the process. The settings and optionally also a secret file will be stored in `~/.toniepodcastsync`.

Afterwards, you can run

```bash
tonie-podcast-sync update-tonies
```

to fetch new podcast episodes and download them onto the tonies.
If you want to perform changes (e.g. switch to another podcast), you can edit the settings file `~/.toniepodcastsync/settings.toml` in a text editor.

To periodically fetch for new episodes, you can schedule `tonie-podcast-sync` e.g. via systemd (on a Linux OS).

In addition,

```bash
tonie-podcast-sync --help
```

provides an overview about these and other available commands.


## in your own Python scripts

You can use `tonie-podcast-sync` by importing it into your own Python scripts, as in this example code:

```python
from toniepodcastsync import ToniePodcastSync, Podcast, EpisodeSorting

# Create some Podcast objects, providing the feed URL to each
pumuckl = Podcast("https://feeds.br.de/pumuckl/feed.xml")

# By default, podcasts are placed onto Tonies by newest episode first
# If you want to change the episode sorting, following options are available
# - EpisodeSorting.BY_DATE_NEWEST_FIRST (default)
# - EpisodeSorting.BY_DATE_OLDEST_FIRST
# - EpisodeSorting.RADNOM
maus_60min = Podcast(
    "https://kinder.wdr.de/radio/diemaus/audio/diemaus-60/diemaus-60-106.podcast",
    episode_sorting = EpisodeSorting.BY_DATE_NEWEST_FIRST
)
maus_gute_nacht = Podcast(
    "https://kinder.wdr.de/radio/diemaus/audio/gute-nacht-mit-der-maus/diemaus-gute-nacht-104.podcast",
    episode_sorting = EpisodeSorting.RANDOM
)

# If you want to adjust the volume of a podcast, set volume_adjustment to an integer other than 0
# The audio will be adjusted (+/-) by that amount in dB
anne_und_die_wilden_tiere = Podcast(
    "https://feeds.br.de/anna-und-die-wilden-tiere/feed.xml",
    episode_sorting = EpisodeSorting.RANDOM,
    volume_adjustment = -2
)

# Some Podcasts inject episodes that are very short (e.g. announcing a holiday break).
# `episode_min_duration_sec` can be used to filter out all episodes shorter then this value.
# the example below will skip all episodes shorter then 30 seconds.
checker_tobi = Podcast(
    "https://feeds.br.de/checkpod-der-podcast-mit-checker-tobi/feed.xml",
    episode_sorting = EpisodeSorting.RANDOM,
    episode_min_duration_sec = 30
)

# Create instance of ToniePodcastSync
tps = ToniePodcastSync("<toniecloud-username>", "<toniecloud-password>")

# For an overview of your creative Tonies and their IDs
# The IDs are needed to address specific Tonies in the next step
tps.print_tonies_overview()

# Define creative Tonies based on their ID
greenTonie = "<your-tonieID>"
orangeTonie = "<your-tonieID>"

# Fetch new podcast episodes and copy them to greenTonie.
# The tonie will be filled with as much episodes as fit (90 min max).
tps.sync_podcast_to_tonie(pumuckl, greenTonie)

# Kid's should fall asleep, so let's limit the podcast
# Episodes on this tonie to 60 minutes in total.
# Use the optional parameter for this:
tps.sync_podcast_to_tonie(maus_gute_nacht, orangeTonie, 60)
```

For the tonie to fetch new content from tonie-cloud, you have to press one ear for 3s (until the "ping" sound) with no tonie on the box (refer also to TonieBox manual).

# Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/alexhartm"><img src="https://avatars.githubusercontent.com/u/16985220?v=4?s=100" width="100px;" alt="Alexander Hartmann"/><br /><sub><b>Alexander Hartmann</b></sub></a><br /><a href="#code-alexhartm" title="Code">💻</a> <a href="#ideas-alexhartm" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-alexhartm" title="Maintenance">🚧</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/Wilhelmsson177"><img src="https://avatars.githubusercontent.com/u/16141053?v=4?s=100" width="100px;" alt="Wilhelmsson177"/><br /><sub><b>Wilhelmsson177</b></sub></a><br /><a href="#code-Wilhelmsson177" title="Code">💻</a> <a href="#ideas-Wilhelmsson177" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-Wilhelmsson177" title="Maintenance">🚧</a> <a href="#test-Wilhelmsson177" title="Tests">⚠️</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://cv.maltebaer.vercel.app/"><img src="https://avatars.githubusercontent.com/u/29504917?v=4?s=100" width="100px;" alt="Malte Bär"/><br /><sub><b>Malte Bär</b></sub></a><br /><a href="#bug-maltebaer" title="Bug reports">🐛</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

> Use the [all-contributors github bot](https://allcontributors.org/docs/en/bot/usage) to add contributors here.

## builds upon work of / kudos to
- moritj29's awesome [tonie_api](https://github.com/moritzj29/tonie_api)
- [Tobias Raabe](https://tobiasraabe.github.io/blog/how-to-download-files-with-python.html)
- [Matthew Wimberly](https://codeburst.io/building-an-rss-feed-scraper-with-python-73715ca06e1f)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alexhartm/tonie-podcast-sync",
    "name": "tonie-podcast-sync",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10.11,<4.0.0",
    "maintainer_email": "",
    "keywords": "toniebox,podcast",
    "author": "Alexander Hartmann",
    "author_email": "16985220+alexhartm@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/08/ea/34f2e21b0ca77e9cbfc8d81a48f3199a48b49f69e2c40b25e3d6af518488/tonie_podcast_sync-3.0.0.tar.gz",
    "platform": null,
    "description": "# tonie-podcast-sync\n\ntonie-podcast-sync allows synching podcast episodes to [creative tonies](https://tonies.com).\n\nThis is a purely private project and has no association with Boxine GmbH.\n\n# Constraints and Limitations\n\n- currently limited to podcasts providing mp3 files\n- tested with the following podcasts:\n    - WDR [Maus Podcasts](https://www.wdrmaus.de/hoeren/MausLive/Podcasts/podcasts.php5), e.g.\n        - [Gute Nacht mit der Maus](https://kinder.wdr.de/radio/diemaus/audio/gute-nacht-mit-der-maus/diemaus-gute-nacht-104.podcast)\n        - [Maus zum H\u00f6ren - 60 Minuten](https://kinder.wdr.de/radio/diemaus/audio/diemaus-60/diemaus-60-106.podcast)\n        - [Maus Zoom - Kindernachrichten](https://kinder.wdr.de/radio/diemaus/audio/maus-zoom/maus-zoom-106.podcast)\n    - [Bayern 2: Pumuckl - Der H\u00f6rspiel-Klassiker](https://www.br.de/mediathek/podcast/pumuckl/830)\n    - [Checker Tobi Podcast](https://www.br.de/mediathek/podcast/checkpod-der-podcast-mit-checker-tobi/859)\n    - [Anna und die wilden Tiere - der Podcast](https://www.br.de/mediathek/podcast/anna-und-die-wilden-tiere/858)\n- ... but in general, it should hopefully work with all podcasts out there\n\n# Prerequisites\n\n- requires Python >= 3.10.11\n- if you use the `volume_adjustment` feature for a Podcast, `ffmpeg` needs to be installed\n\n# Usage\n\ntonie-podcast-sync is available as [a pip package on pypi](https://pypi.org/project/tonie-podcast-sync). Install via\n\n`pip install tonie-podcast-sync`\n\nYou then have two options of using this: via its CLI or as a python library.\n\n## via CLI\n\nThe most convienent way is to just use the CLI:\n\n\nA first step is to configure `tonie-podcast-sync`\n\n```bash\ntonie-podcast-sync create-settings-file\n```\n\nThe command will guide you through the process. The settings and optionally also a secret file will be stored in `~/.toniepodcastsync`.\n\nAfterwards, you can run\n\n```bash\ntonie-podcast-sync update-tonies\n```\n\nto fetch new podcast episodes and download them onto the tonies.\nIf you want to perform changes (e.g. switch to another podcast), you can edit the settings file `~/.toniepodcastsync/settings.toml` in a text editor.\n\nTo periodically fetch for new episodes, you can schedule `tonie-podcast-sync` e.g. via systemd (on a Linux OS).\n\nIn addition,\n\n```bash\ntonie-podcast-sync --help\n```\n\nprovides an overview about these and other available commands.\n\n\n## in your own Python scripts\n\nYou can use `tonie-podcast-sync` by importing it into your own Python scripts, as in this example code:\n\n```python\nfrom toniepodcastsync import ToniePodcastSync, Podcast, EpisodeSorting\n\n# Create some Podcast objects, providing the feed URL to each\npumuckl = Podcast(\"https://feeds.br.de/pumuckl/feed.xml\")\n\n# By default, podcasts are placed onto Tonies by newest episode first\n# If you want to change the episode sorting, following options are available\n# - EpisodeSorting.BY_DATE_NEWEST_FIRST (default)\n# - EpisodeSorting.BY_DATE_OLDEST_FIRST\n# - EpisodeSorting.RADNOM\nmaus_60min = Podcast(\n    \"https://kinder.wdr.de/radio/diemaus/audio/diemaus-60/diemaus-60-106.podcast\",\n    episode_sorting = EpisodeSorting.BY_DATE_NEWEST_FIRST\n)\nmaus_gute_nacht = Podcast(\n    \"https://kinder.wdr.de/radio/diemaus/audio/gute-nacht-mit-der-maus/diemaus-gute-nacht-104.podcast\",\n    episode_sorting = EpisodeSorting.RANDOM\n)\n\n# If you want to adjust the volume of a podcast, set volume_adjustment to an integer other than 0\n# The audio will be adjusted (+/-) by that amount in dB\nanne_und_die_wilden_tiere = Podcast(\n    \"https://feeds.br.de/anna-und-die-wilden-tiere/feed.xml\",\n    episode_sorting = EpisodeSorting.RANDOM,\n    volume_adjustment = -2\n)\n\n# Some Podcasts inject episodes that are very short (e.g. announcing a holiday break).\n# `episode_min_duration_sec` can be used to filter out all episodes shorter then this value.\n# the example below will skip all episodes shorter then 30 seconds.\nchecker_tobi = Podcast(\n    \"https://feeds.br.de/checkpod-der-podcast-mit-checker-tobi/feed.xml\",\n    episode_sorting = EpisodeSorting.RANDOM,\n    episode_min_duration_sec = 30\n)\n\n# Create instance of ToniePodcastSync\ntps = ToniePodcastSync(\"<toniecloud-username>\", \"<toniecloud-password>\")\n\n# For an overview of your creative Tonies and their IDs\n# The IDs are needed to address specific Tonies in the next step\ntps.print_tonies_overview()\n\n# Define creative Tonies based on their ID\ngreenTonie = \"<your-tonieID>\"\norangeTonie = \"<your-tonieID>\"\n\n# Fetch new podcast episodes and copy them to greenTonie.\n# The tonie will be filled with as much episodes as fit (90 min max).\ntps.sync_podcast_to_tonie(pumuckl, greenTonie)\n\n# Kid's should fall asleep, so let's limit the podcast\n# Episodes on this tonie to 60 minutes in total.\n# Use the optional parameter for this:\ntps.sync_podcast_to_tonie(maus_gute_nacht, orangeTonie, 60)\n```\n\nFor the tonie to fetch new content from tonie-cloud, you have to press one ear for 3s (until the \"ping\" sound) with no tonie on the box (refer also to TonieBox manual).\n\n# Contributors\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/alexhartm\"><img src=\"https://avatars.githubusercontent.com/u/16985220?v=4?s=100\" width=\"100px;\" alt=\"Alexander Hartmann\"/><br /><sub><b>Alexander Hartmann</b></sub></a><br /><a href=\"#code-alexhartm\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#ideas-alexhartm\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"#maintenance-alexhartm\" title=\"Maintenance\">\ud83d\udea7</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/Wilhelmsson177\"><img src=\"https://avatars.githubusercontent.com/u/16141053?v=4?s=100\" width=\"100px;\" alt=\"Wilhelmsson177\"/><br /><sub><b>Wilhelmsson177</b></sub></a><br /><a href=\"#code-Wilhelmsson177\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#ideas-Wilhelmsson177\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"#maintenance-Wilhelmsson177\" title=\"Maintenance\">\ud83d\udea7</a> <a href=\"#test-Wilhelmsson177\" title=\"Tests\">\u26a0\ufe0f</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://cv.maltebaer.vercel.app/\"><img src=\"https://avatars.githubusercontent.com/u/29504917?v=4?s=100\" width=\"100px;\" alt=\"Malte B\u00e4r\"/><br /><sub><b>Malte B\u00e4r</b></sub></a><br /><a href=\"#bug-maltebaer\" title=\"Bug reports\">\ud83d\udc1b</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\n> Use the [all-contributors github bot](https://allcontributors.org/docs/en/bot/usage) to add contributors here.\n\n## builds upon work of / kudos to\n- moritj29's awesome [tonie_api](https://github.com/moritzj29/tonie_api)\n- [Tobias Raabe](https://tobiasraabe.github.io/blog/how-to-download-files-with-python.html)\n- [Matthew Wimberly](https://codeburst.io/building-an-rss-feed-scraper-with-python-73715ca06e1f)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "allows synching podcast episodes to creative tonies",
    "version": "3.0.0",
    "project_urls": {
        "Homepage": "https://github.com/alexhartm/tonie-podcast-sync",
        "Repository": "https://github.com/alexhartm/tonie-podcast-sync"
    },
    "split_keywords": [
        "toniebox",
        "podcast"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa56b6131bca01ac14d5742d51d59283e1081bd929c0e3e9f65e44705991bf36",
                "md5": "e93bee755582047516dc09b6b77eac11",
                "sha256": "91f87b0ec61cd3226abc0a6178ce6401088a9bd916f7f1008b70e20872213676"
            },
            "downloads": -1,
            "filename": "tonie_podcast_sync-3.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e93bee755582047516dc09b6b77eac11",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.11,<4.0.0",
            "size": 12685,
            "upload_time": "2024-03-01T15:17:35",
            "upload_time_iso_8601": "2024-03-01T15:17:35.374004Z",
            "url": "https://files.pythonhosted.org/packages/aa/56/b6131bca01ac14d5742d51d59283e1081bd929c0e3e9f65e44705991bf36/tonie_podcast_sync-3.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08ea34f2e21b0ca77e9cbfc8d81a48f3199a48b49f69e2c40b25e3d6af518488",
                "md5": "5fb2004d0b728fb0e342a4f9343a4040",
                "sha256": "460608224d1c698d79815955cb3967be6a8d1b3c4cddc6f62d3603c6aea53a3c"
            },
            "downloads": -1,
            "filename": "tonie_podcast_sync-3.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5fb2004d0b728fb0e342a4f9343a4040",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.11,<4.0.0",
            "size": 13332,
            "upload_time": "2024-03-01T15:17:37",
            "upload_time_iso_8601": "2024-03-01T15:17:37.291479Z",
            "url": "https://files.pythonhosted.org/packages/08/ea/34f2e21b0ca77e9cbfc8d81a48f3199a48b49f69e2c40b25e3d6af518488/tonie_podcast_sync-3.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-01 15:17:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexhartm",
    "github_project": "tonie-podcast-sync",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tonie-podcast-sync"
}
        
Elapsed time: 0.20148s