A type-hinted async python mpd client library.
Project description
ampdup
A type-hinted async python mpd client library.
Summary
ampdup
is an async/await based MPD library.
It is fully type-hinted and MPD responses are typed as well, so it is able to
play nicely with mypy
and autocompletion such as what is provided by jedi
.
Examples
First a basic usage example. make()
returns a connected client as a context
manager that handles disconnection automatically.
async def main():
async with MPDClient.make('localhost', 6600) as m:
await m.play()
The IdleClient class provides the idle()
function. Since ampdup
is
async
/await
-based this loop can easily run concurrently with other
operations.
async def observe_state():
async with IdleClient.make('localhost', 6600) as i:
while True:
changed = await i.idle()
handle_changes(changed)
Todo
- Support command lists.
- Support connecting through Unix socket.
- Support the more obscure MPD features such as partitions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ampdup-0.12.0.tar.gz
.
File metadata
- Download URL: ampdup-0.12.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.9.14-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 276d11e4a88248065479e17164a2f396acb1a3360764b83f901273357bc19a83 |
|
MD5 | da606db847be6feb24c1d8e66fe12c7d |
|
BLAKE2b-256 | bbddd8cec0015ff9a51b567494c27fd37ae683be13755b0d4f48d5577f042d76 |
File details
Details for the file ampdup-0.12.0-py3-none-any.whl
.
File metadata
- Download URL: ampdup-0.12.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.9.14-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4e04fe3ec7820627cc4a2c90faaabc8f6e4b83e1cd75ca431ae0cbb03efaedc |
|
MD5 | e8e9cb9ce173c48c3210f434a98c6cf3 |
|
BLAKE2b-256 | df302ee6f3569d89fc1453eef0f642ab9d1a096be88295eb289eb209ed8daa7b |