semvec/pypi-packages huggingface dataset:
spot-link 0.0.2
A small module for wavelink to turn spotify track and playlist links into wavelink track objects. Also works without wavelink, then it just gives a dict with artist names and song name
License: MIT
Requires Python: >=3.7

# spot_link
A simple module for wavelink to convert spotify track and playlist urls into wavelink track objects or a dict with artists and song name if wavelink client isn't provided.
# Requirements
* A Spotify app client: https://developer.spotify.com/dashboard
* Lavalink: https://github.com/Frederikam/Lavalink
# Example Usage
## without wavelink client
```python
from spot_link import SpotLink

spotify_client_id = ''  # your spotify client id
spotify_client_secret = ''  # your spotify client secret

spotify_parser = SpotLink(spotify_client_id, spotify_client_secret)

url = 'https://open.spotify.com/playlist/4LoUlTwMM2GEtRvWcTmRTC?si=q-xgJeu3SQKRR8-Nn1KFPg'
spotify_tracks = await spotify_parser.process_spotify_url(url)
# [{'artists': ['SIAMES', 'Tish Planes'], 'name': 'Mr. Fear'}, ...
```
## with wavelink client
```python
from discord.ext import commands
from spot_link import SpotLink

spotify_client_id = ''  # your spotify client id
spotify_client_secret = ''  # your spotify client secret

class Music(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.spotify_parser = SpotLink(spotify_client_id, spotify_client_secret, self.bot.wavelink)

    async def process_spotify_url(self, url):
        spotify_tracks = await self.spotify_parser.process_spotify_url(url)
        # [<wavelink.player.Track object at 0x7fec146fb430>, ...
    ...
```
mypy-extras 0.1.0
A collection of extra types and features for mypy
License: MIT
Requires Python: >=3.6,<3.9

# mypy-extras

[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake.services)
[![test](https://github.com/wemake-services/mypy-extras/workflows/test/badge.svg?branch=master&event=push)](https://github.com/wemake-services/mypy-extras/actions?query=workflow%3Atest)
[![codecov](https://codecov.io/gh/wemake-server/mypy-extras/branch/master/graph/badge.svg)](https://codecov.io/gh/wemake-server/mypy-extras)
[![Python Version](https://img.shields.io/pypi/pyversions/mypy-extras.svg)](https://pypi.org/project/mypy-extras/)
[![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)


## Features

- Provides a custom `mypy` plugin to enhance its possibilities
- Provides new types that can be used in your programs with our plugin
- Fully typed with annotations and checked with mypy, [PEP561 compatible](https://www.python.org/dev/peps/pep-0561/)


## Installation

```bash
pip install mypy-extras
```

You also need to [configure](https://mypy.readthedocs.io/en/stable/config_file.html)
`mypy` correctly and install our custom plugin:

```ini
# In setup.cfg or mypy.ini:
[mypy]
plugins =
  mypy_extras.plugin.entrypoint
```

We also recommend to use the same `mypy` settings [we use](https://github.com/wemake-services/wemake-python-styleguide/blob/master/styles/mypy.toml).


## Usage

### AttrOf

We provide a special type to get named attributes of other types, like so:

```python
from typing_extensions import Literal  # or typing on python3.8+
from mypy_extras import AttrOf

class User(object):
    def auth(self, username: str, password: str) -> bool:
        return False  # Just an example

def get_callback(user: User) -> AttrOf[User, Literal['auth']]:
    return user.auth

user: User
reveal_type(get_callback(user))
# Revealed type is 'def (username: builtins.str, password: builtins.str) -> builtins.bool'
```


### ensure_attr

We can ensure that some `str` attribute exists on a object:

```python
from mypy_extras import ensure_attr


class User(object):
    policy = 'update'


reveal_type(ensure_attr(User, 'policy'))  # Revealed type is 'Literal['policy']'
reveal_type(ensure_attr(User, 'missing'))  # Error: attribute "missing" does not exist on type "User"
```

It is useful when we do any manipulations with objects based on a string field:

```python
DEFAULT_POLICY_FIELD: Final = ensure_attr(User, 'policy')  # typesafe
# vs
DEFAULT_POLICY_FIELD: Final = 'policy'  
# User can rename the field, and this will blow now!
```


## License

[MIT](https://github.com/wemake.services/mypy-extras/blob/master/LICENSE)