Skip to main content

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


Download files

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

Source Distribution

ampdup-0.5.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

ampdup-0.5.0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file ampdup-0.5.0.tar.gz.

File metadata

  • Download URL: ampdup-0.5.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.9 CPython/3.7.1 Linux/4.19.4-arch1-1-ARCH

File hashes

Hashes for ampdup-0.5.0.tar.gz
Algorithm Hash digest
SHA256 89f659a0bfe765795e657644a387ecccf24e954e4280b0dc8d402c84d64fa5e2
MD5 235fec42f882b9d26f373997ea2eb73f
BLAKE2b-256 a8cc5f0f5ac1e8ab141d2e23f2152d6114c5e0570ff25bd84b08752e453580aa

See more details on using hashes here.

File details

Details for the file ampdup-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: ampdup-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.9 CPython/3.7.1 Linux/4.19.4-arch1-1-ARCH

File hashes

Hashes for ampdup-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c3a3676357af32ad1fd1b6d219992a17e10d04560b584e95c6211730eb06e75
MD5 c7bad75145110953e6184b0ddaa46b2b
BLAKE2b-256 f4205fccf392cb4c0e6a8f2113f250657615c7f158cce3bb6dc49a7386b6756a

See more details on using hashes here.

Supported by

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