Pod⭐
Podstar is a Python library for working with podcasts. It optimizes for robustness, efficiency, and standards support while providing a clean and simple API. Podstar has some neat features:
- robust parsing of RSS-based podcast feeds
- transparent use of paginated feeds (via RSS pagination)
- support for HTTP caching headers (
ETagorLast-Modified), enabling long-running aggregator processes to request as little data as possible - easy access to audio information, including:
- duration (as determined by iTunes DTD metadata when available, or by streaming audio files to memory until necessary metadata is available)
- bitrate
- sample rate
Getting Started
Ensure that you've got Python >= 3.3 installed, and a new Python virtual environment activated. Install the library using:
$ pip install podstar
You're done!
Using Podstar
The following code iterates over a podcast feed, listing each episode and its duration:
import time
import podstar
feed = podstar.Feed('http://feeds.sceneonradio.org/SceneOnRadio')
# print some information about the podcast, including a text description (HTML in the description will be removed automatically)
print(feed.title)
print(feed.description + "\n")
# list each episode with its title, date published, and duration
for episode in feed.episodes():
pub_date = episode.published_at.strftime("%a %b %d, %Y")
duration = time.strftime("%H:%M:%S", time.gmtime(episode.duration))
print(f"– \"{episode.title}\" ({pub_date}) [{duration}]")
For further examples of how to use Podstar, see the examples/ directory.
Development
Getting started with development on Podstar is relatively straightforward.
Ensure that you have Python >= 3.3 installed, clone the repository, and cd to it
$ git clone <repo url>
$ cd podstar/
Use pip to install the dependencies specified in requirements.txt (if you haven't already) as well as the development dependencies specified in dev_requirements.txt
$ pip install -r requirements.txt
$ pip install -r dev_requirements.txt
To run all tests, execute
$ python -m pytest tests
To check test coverage, execute:
python -m pytest --cov=podstar --cov-report term-missing -s tests
Examples
examples/download.py – The original sketch used when designing the API for this library. Run it from the project's root directory by executing:
$ python -m examples.sketch
examples/crawl.py – Parses a good number of feeds in parallel using digitalpodcast.com as a convenient redirect. From the project's root directory, try it (on a decent internet connection) by executing:
$ python -m examples.crawl
Metadata
Release files for podstar 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| podstar-1.0.0.tar.gz | 14.2 kB | Without provenance | Details for podstar-1.0.0.tar.gz |
Release files / podstar-1.0.0.tar.gz
| Download URL | podstar-1.0.0.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16224b49e4adce4bc56957447da01d1ffff65aad67f274cd537df49d834ece72
|
|
BLAKE2b-256 checksum How to use checksums |
2fd34c216326fe7439048de03c26ad2e24e099c54be3bd1d51edeba7cdd1e2d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
|
Security for podstar 1.0.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.