Skip to content

Commit

Permalink
Updated README + LICENSE file + poetry.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
bendikrb committed Sep 15, 2024
1 parent 693672e commit f5dc476
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 14 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2021-2024 Bendik R. Brenne

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
78 changes: 65 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,94 @@
# NrkPodcastAPI
# nrk-psapi

NrkPodcastAPI is a Python library for interacting with the NRK Podcast API. It provides a simple interface for retrieving podcast information and episode details.
[![GitHub Release][releases-shield]][releases]
[![Python Versions][py-versions-shield]][py-versions]
![Project Maintenance][maintenance-shield]
[![License][license-shield]](LICENSE.md)

## Installation
[![Build Status][build-shield]][build]
[![Code coverage][codecov-shield]][codecov]

To install the library, you can use pip:

```
Asynchronous Python client for the NRK Podcast/Radio API

## Installation

```bash
pip install nrk-psapi
```

## Usage

Here's an example of how to use the library to retrieve information about a podcast:
The following are some basic examples of how to use the library.

Get information about a specific podcast:

```python
import asyncio

from nrk_psapi import NrkPodcastAPI

api = NrkPodcastAPI()
podcast = api.get_podcast("podcast_id")
print(podcast.title)

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())
```

You can also retrieve information about an episode:
Get all episodes for a specific podcast:

```python
episode = api.get_episode("podcast_id", "episode_id")
print(episode.title)
episodes = await client.get_podcast_episodes(podcast_id="desken_brenner")
for episode in episodes:
print(episode)
```

Search for a specific podcast:

```python
search_results = await client.search(
query="Norsk", search_type=SearchResultType.PODCAST
)
for result in search_results.hits:
print(result)
```

Get curated podcasts:

```python
curated_podcasts = await client.curated_podcasts()
for section in curated_podcasts.sections:
print(section)
for podcast in section.podcasts:
print(podcast)
```


## Contributing

If you'd like to contribute to the project, please submit a pull request or open an issue on the GitHub repository.

## License

NrkPodcastAPI is licensed under the MIT license. See the LICENSE file for more details.
nrk-psapi is licensed under the MIT license. See the LICENSE file for more details.

## Contact

If you have any questions or need assistance with the library, you can contact the project maintainer at @bendikrb.

[license-shield]: https://img.shields.io/github/license/bendikrb/nrk-psapi.svg
[license]: https://github.com/bendikrb/nrk-psapi/blob/main/LICENSE
[releases-shield]: https://img.shields.io/pypi/v/nrk-psapi
[releases]: https://github.com/bendikrb/nrk-psapi/releases
[build-shield]: https://github.com/bendikrb/nrk-psapi/actions/workflows/test.yaml/badge.svg
[build]: https://github.com/bendikrb/nrk-psapi/actions/workflows/tests.yaml
[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
[py-versions-shield]: https://img.shields.io/pypi/pyversions/nrk-psapi
[py-versions]: https://pypi.org/project/nrk-psapi/
[codecov-shield]: https://codecov.io/gh/bendikrb/nrk-psapi/graph/badge.svg?token=011O5N9MKL
[codecov]: https://codecov.io/gh/bendikrb/nrk-psapi
31 changes: 30 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f5dc476

Please sign in to comment.