Skip to main content

Beat Saver API wrapper

Project description

GitHub license PyPI version codecov PyPI supported Python versions PyPI downloads

PyBeatSaver

Beat Saver API wrapper

Features

  • Rate Limit handling
  • Query Caching
  • Everything is async
  • Additional helper methods and async generators
  • Faker data provider

The 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:

import asyncio
from pybeatsaver import BeatSaverAPI, BeatSaver


async 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:

from faker import Faker
from pybeatsaver import BeatSaverProvider


faker = Faker()
faker.add_provider(BeatSaverProvider)

beatmap = faker.map_detail()
print(beatmap)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyBeatSaver-0.1.15.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

PyBeatSaver-0.1.15-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file PyBeatSaver-0.1.15.tar.gz.

File metadata

  • Download URL: PyBeatSaver-0.1.15.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for PyBeatSaver-0.1.15.tar.gz
Algorithm Hash digest
SHA256 8667d121eb132e2509aba4f7bcc9b92fe33a545bd5651d15e10b8216c147c283
MD5 36cc9f929d131cd17bf9ec3bd377625b
BLAKE2b-256 0a83ededce13512e8263e8d3655e48cf125a0451c31c2d13ed0315d0503670ff

See more details on using hashes here.

File details

Details for the file PyBeatSaver-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: PyBeatSaver-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for PyBeatSaver-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 0e9f9759d28ee64b9f263b3102029541f7ebad58b97d22a6a28da2bc2091c6e5
MD5 55851ff52d8297604bf71230a0153981
BLAKE2b-256 ec630ac505a1882f9fe9f2c7fbcfff21d1dedb12c42bec1bba64d10e936d340d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page