Asynchronous Python client for the NRK Podcast/Radio API
pip install nrk-psapi
The following are some basic examples of how to use the library.
Get information about a specific podcast:
import asyncio
from nrk_psapi import NrkPodcastAPI
async def main():
"""Main function."""
async with NrkPodcastAPI() as client:
podcast = await client.get_podcast(podcast_id="desken_brenner")
print(podcast)
if __name__ == "__main__":
asyncio.run(main())
Get all episodes for a specific podcast:
episodes = await client.get_podcast_episodes(podcast_id="desken_brenner")
for episode in episodes:
print(episode)
Search for a specific podcast:
search_results = await client.search(
query="Norsk", search_type=SearchResultType.PODCAST
)
for result in search_results.hits:
print(result)
Get curated podcasts:
curated_podcasts = await client.curated_podcasts()
for section in curated_podcasts.sections:
print(section)
for podcast in section.podcasts:
print(podcast)
If you'd like to contribute to the project, please submit a pull request or open an issue on the GitHub repository.
nrk-psapi is licensed under the MIT license. See the LICENSE file for more details.
If you have any questions or need assistance with the library, you can contact the project maintainer at @bendikrb.