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

Uploaded Source

Built Distribution

ampdup-0.11.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ampdup-0.11.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.9.1-arch1-1

File hashes

Hashes for ampdup-0.11.0.tar.gz
Algorithm Hash digest
SHA256 e0f3409374d05a7e9ab86862a3f7996d431ce100ea4831b3363bfbbac1789103
MD5 6c8be0f5de2351fc1c7ff5220fdd2c39
BLAKE2b-256 73fe8622cb8feb4e783d1613519be8ffed819b0f6115455b31fadbe6115c74ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ampdup-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.9.1-arch1-1

File hashes

Hashes for ampdup-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3abc2b10f0f2243daf951c4d417d19a1f0cbda7d0e8769a202b2abb65a6cdf6
MD5 dcab3c2fb35957958cfd84519ecdc1cb
BLAKE2b-256 5d6b798b673ae17abd729db742a19e8a0e1d11c47143d8b56b68ae613d9549b8

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