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

Uploaded Source

Built Distribution

ampdup-0.2.2-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ampdup-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1db712c429185bdcb9f3ebca185a4e6a09c3a2657b70ea518f36ae335e30c673
MD5 2d591e7184fe2eb6ff6dea85a8e49fb1
BLAKE2b-256 d4d1a2982344e089912982706e902db8e9505d9691c9369b81723debcea79c5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ampdup-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 491826191682c91b339f6641485a2b7afb0f197aed51c28e4ffb71dfe16eb1a2
MD5 44babd435568755e10a58bd3560ca120
BLAKE2b-256 ed8d805f653eedb40381ef20bf7fbf9826ca753ca13a0fd56595fe73f4c9be20

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