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

Uploaded Source

File details

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

File metadata

  • Download URL: ampdup-0.2.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ampdup-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a2a54035137f2fe6962c850658ac68fca63f5c3d5fcb481ee72bab317d7334b3
MD5 299fd88743840b9843a272eb8c07e8a9
BLAKE2b-256 16c46e4672ebf12e9c5e8ec086e0b27844209eb286e0a0cda327d65dbdb00a8d

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