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 currently uses curio as its means of establishing connections.

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.2.5.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

ampdup-0.2.5-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ampdup-0.2.5.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.7.1 Linux/4.19.1-arch1-1-ARCH

File hashes

Hashes for ampdup-0.2.5.tar.gz
Algorithm Hash digest
SHA256 695b835567f2a7d2cb297211c99595ea387f79b6a5631c07c4bda16f7cc2f7b1
MD5 9316ff99ea940df3b27039fc3b9c8d53
BLAKE2b-256 ac77420769ec6dafef9d0552ede774e00d107279b360a37c32e4a4ac89d50c94

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ampdup-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0092c2c1963f4b52dcd8f12507fd4bb5151c843b7051ac3bcbb07e78378c3963
MD5 e1c9ca22f3a41c25c72c8212247cda2d
BLAKE2b-256 ffcefe5509e168ed591d4c2939dd8e49ebd95df3e580a3c8ede8e7819760c10a

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