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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ampdup-0.2.4.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.4 CPython/3.7.0 Linux/4.18.5-arch1-1-ARCH

File hashes

Hashes for ampdup-0.2.4.tar.gz
Algorithm Hash digest
SHA256 546f03f4c500c2d3fe926fbf81721581782f42261879481ba4ab0800e98e6305
MD5 73a76777f0a4a1a1eb546cf9884874d0
BLAKE2b-256 784112c7d6c2153f1c55549b6aba7556205bce6f50d1b7c939cad318f3ba3591

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ampdup-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 66b8d50be3ebc2e8239e3ee2689e153decf857a092a66fda89c40eb53c20e694
MD5 5588e1c9f93ddc16a61181d261ee80a6
BLAKE2b-256 c52f7946e9119de2894d64ad2a0967fd2447b0309cc8aecc166749c69ad86f3a

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