semvec/pypi-packages huggingface dataset:
botobackoff 0.0.2
boto3 retry and backoff utility
License: MIT
Requires Python: >=3.7

# botobackoff

botobackoff provides a boto3 client wrapper and function decorator that automatically retries failed boto3 calls
with exponential backoff and jitter. 

The decorator and client wrapper include options to add additional error codes to catch and retry on and
error codes to ignore and fail silently returning `None`.


## Motivation

Boto3 provides limited retry functionality for failed calls. I wanted to create a simple way to retry boto3 calls
with exponential backoff and jitter as well as more flexibility as to what errors can be retried or ignored without
needing to add additional try/except blocks around boto3 calls.

## Installation
install from PyPI: `pip install botobackoff`

## Usage

Example with the client wrapper:

```python
from botobackoff import BotoBackoff

# `BotoBackoff` can be instantiated with a boto3 client or service name
wrapped_client = BotoBackoff("s3", max_retries=5)

print(wrapped_client.list_objects(Bucket="my-bucket"))
```

Example as context manager:
```python
from botobackoff import BotoBackoff

wrapped_client = BotoBackoff("s3", max_retries=2)

# use `with_options` to change any of the options for the context manager instance
with wrapped_client.with_options(max_retries=5) as client:
    print(client.list_objects(Bucket="my-bucket"))

```

Example with the decorator:
```python
from botobackoff import botobackoff

import boto3

@botobackoff(max_retries=5)
def list_objects():
    return boto3.client("s3").list_objects(Bucket="my-bucket")

print(list_objects())
```

The boto3 errors that are retried by default are:
- ThrottlingException
- TooManyRequestsException
- ServiceUnavailableException
- RequestLimitExceeded
- RequestThrottled
- RequestThrottledException
- ProvisionedThroughputExceededException
- LimitExceededException
- EndpointConnectionError
- ConnectTimeoutError
- Unavailable
- InternalFailure
- InternalError

to add additional errors to retry on use the `added_error_codes` parameter:
```python
from botobackoff import botobackoff

import boto3

@botobackoff(added_error_codes=["NoSuchBucket"])
def list_objects():
    return boto3.client("s3").list_objects(Bucket="my-bucket")
```
song-metadata-client 0.0.2
A generic client to fetch metadata for any song
License: MIT
Requires Python: >=3.9,<4.0
Keywords: metadata,python,song metadata,spotify,youtube,youtube music,music,song

# Song Metadata Client

**Get metadata about your favorite songs and playlists !**

## Features

 - Automatic metadata fetching from different services
   - Currently supported : Spotify, Youtube Music
 - Metadata fetching from an URL or a query
 - Supports playlist URLs
 - Easy to use, straightforward interface
 - Possible to use via DI integration

## Installation

### Pip

```
pip install song-metadata-client
```

### Poetry

[Poetry](https://python-poetry.org/) is a Python dependency management and packaging tool. I actually use it for this project.

```
poetry add song-metadata-client
```

## Usage

There are 2 ways to use this library : using the SongMetadataClient object or via the DI.

### Using SongMetadataClient

The library exposes the SongMetadata class. This class has 1 methods : `search`.

This method fetches the metadata corresponding to the request you give it, whether it is an URL or a query. It returns the result as a `SongMetadata` object or a `PlaylistMetadata` object.

**Example :**

```python
from song_metadata_client import SongMetadataClient

client = SongMetadataClient()
result = client.search("in the end - linkin park")

title = result.title # In The End
```

### Using DI

The library also exposes a `BaseMetadataClient` interface and a `add_song_metadata_client` function for [Taipan-DI](https://github.com/Billuc/Taipan-DI).

In this function, the clients are registered as a Pipeline. All you need to do is to resolve the pipeline and execute it.

**Example :**

```python
from song_metadata_client import BaseMetadataClient, add_song_metadata_client
from taipan_di import DependencyCollection

services = DependencyCollection()
add_song_metadata_client(services)

provider = services.build()
client = provider.resolve(BaseMetadataClient)

result = client.exec("in the end - linkin park")
title = result.title # In The End
```

## Inspirations

This library is partially based on spotDL's [spotify-downloader](https://github.com/spotDL/spotify-downloader).