Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiyomi-parents/pybeatsaver
Beat Saver API wrapper
https://github.com/kiyomi-parents/pybeatsaver
async beatsaver beatsaver-api python python-3
Last synced: about 1 month ago
JSON representation
Beat Saver API wrapper
- Host: GitHub
- URL: https://github.com/kiyomi-parents/pybeatsaver
- Owner: Kiyomi-Parents
- License: mit
- Created: 2021-08-03T02:24:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-01T14:57:32.000Z (over 1 year ago)
- Last Synced: 2024-04-23T13:17:39.135Z (9 months ago)
- Topics: async, beatsaver, beatsaver-api, python, python-3
- Language: Python
- Homepage:
- Size: 153 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GitHub license](https://img.shields.io/github/license/Kiyomi-Parents/PyBeatSaver)](https://github.com/Kiyomi-Parents/PyBeatSaver/blob/master/LICENSE)
[![PyPI version](https://badge.fury.io/py/PyBeatSaver.svg)](https://pypi.org/project/PyBeatSaver)
[![codecov](https://codecov.io/gh/Kiyomi-Parents/PyBeatSaver/branch/master/graph/badge.svg?token=IUFZTBDVEE)](https://codecov.io/gh/Kiyomi-Parents/PyBeatSaver)
[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/pybeatsaver.svg)](https://pypi.org/project/PyBeatSaver)
[![PyPI downloads](https://img.shields.io/pypi/dm/pybeatsaver?color=blueviolet&logo=pypi)](https://pypi.org/project/PyBeatSaver)
# PyBeatSaver
Beat Saver API wrapper### Features
* Rate Limit handling
* Query Caching
* Everything is ``async``
* Additional helper methods and async generators
* Faker data providerThe faker data mode can be activated with the following ```beatsaver = BeatSaverAPI(test_mode=True)```.
This will return random data instead of making API requests to Beat Saver.### Usage:
```python
import asyncio
from pybeatsaver import BeatSaverAPI, BeatSaverasync def main():
async with BeatSaverAPI() as beatsaver:
beatmap = await beatsaver.beatmap("16d22")
print(beatmap)# Without "async with" syntax
async def main2():
beatsaver = BeatSaver()
await beatsaver.start()beatmap = await beatsaver.beatmap("16d22")
print(beatmap)# Get fake data instead
async def main_fake():
async with BeatSaverAPI(test_mode=True) as beatsaver:
beatmap = await beatsaver.beatmap("16d22")
print(beatmap)asyncio.run(main())
asyncio.run(main2())
asyncio.run(main_fake())
```### Faker provider:
```python
from faker import Faker
from pybeatsaver import BeatSaverProviderfaker = Faker()
faker.add_provider(BeatSaverProvider)beatmap = faker.map_detail()
print(beatmap)
```