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

Uploaded Source

Built Distribution

ampdup-0.2.3-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ampdup-0.2.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.0 CPython/3.6.6 Linux/4.17.11-gentoo

File hashes

Hashes for ampdup-0.2.3.tar.gz
Algorithm Hash digest
SHA256 48a3d77feeddec45cd8303ca64ec172c5a071c81bf8592c951ea7c05740816d5
MD5 0b442daa73656fa7ab01e9abac2e77cd
BLAKE2b-256 e1a41d7acf798bee6ec47f9f47584a204e62fc9c87304b2bf2c45b9eba212d02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ampdup-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 39.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.0 CPython/3.6.6 Linux/4.17.11-gentoo

File hashes

Hashes for ampdup-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 168a3ecd19dfaa3d5a52fe505b479a682be160f2dae333ea283d8e68288f92d2
MD5 2a9e341b5242f7184f01467acea0d546
BLAKE2b-256 b37c90a09c067c94f627bfe6c514a0e6fb42df23fad79f796af00b4b177064c6

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