semvec/pypi-packages huggingface dataset:
PyBeatSaver 0.1.16
Beat Saver API wrapper
Requires Python: >=3.8

[![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 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:
```python
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:
```python
from faker import Faker
from pybeatsaver import BeatSaverProvider


faker = Faker()
faker.add_provider(BeatSaverProvider)

beatmap = faker.map_detail()
print(beatmap)
```
torch-sci 1.0.0
Differentiable PyTorch functions to calculate scientific notation.
Requires Python: >=3.10

# torch-sci

![Test](https://github.com/github/docs/actions/workflows/test.yml/badge.svg)

Differentiable PyTorch functions to calculate scientific notation.

## Installation

Bring your own PyTorch, then install this package:

```bash
pip install torch-sci
```

## Usage

```python
import torch

import torch_sci


x = torch.tensor(1234.0, requires_grad=True)
sig, exp = torch_sci.to_sci(x)
sig, exp
# => tensors: 1.234, 3.0

# some made up loss function, to test differentiability
loss = sig * exp
loss.backward()
assert x.grad != 0.0

torch_sci.from_sci(sig, exp)
# => tensor: 1234

# more test cases
torch_sci.to_sci(torch.tensor(-1234.0, requires_grad=True))
# => -1.234, 3
torch_sci.to_sci(torch.tensor(-0.1234, requires_grad=True))
# => -1.234, -1
torch_sci.to_sci(torch.tensor(0.0, requires_grad=True))
# => 0, -8 (common trick of + 1e-8 to avoid log 0)
torch_sci.to_sci(torch.tensor(0.1234, requires_grad=True))
# => 1.234, -1
torch_sci.to_sci(torch.tensor(1234.0, requires_grad=True))
# => 1.234, 3
```

## Development

### Setup

[Install uv](https://docs.astral.sh/uv/getting-started/installation/) for dependency management if you haven't already. Then run:

```bash
# setup virtualenv
venv sync
```

### Unit Tests

```bash
uv run pytest
```