Mixcloud API wrapper for Python and Async IO

Overview

aiomixcloud

Mixcloud API wrapper for Python and Async IO

PyPI PyPI - License PyPI - Python Version Coverage Build Status Documentation Status

aiomixcloud is a wrapper library for the HTTP API of Mixcloud. It supports asynchronous operation via asyncio and specifically the aiohttp framework. aiomixcloud tries to be abstract and independent of the API's transient structure, meaning it is not tied to specific JSON fields and resource types. That is, when the API changes or expands, the library should be ready to handle it.

Installation

The following Python versions are supported:

  • CPython: 3.6, 3.7, 3.8, 3.9
  • PyPy: 3.5

Install via pip:

pip install aiomixcloud

Usage

You can start using aiomixcloud as simply as:

from aiomixcloud import Mixcloud

# Inside your coroutine:
async with Mixcloud() as mixcloud:
    cloudcast = await mixcloud.get('bob/cool-mix')

    # Data is available both as attributes and items
    cloudcast.user.name
    cloudcast['pictures']['large']

    # Iterate over associated resources
    for comment in await cloudcast.comments():
        comment.url

A variety of possibilities is enabled during authorized usage:

# Inside your coroutine:
async with Mixcloud(access_token=access_token) as mixcloud:
    # Follow a user
    user = await mixcloud.get('alice')
    await user.follow()

    # Upload a cloudcast
    await mixcloud.upload('myshow.mp3', 'My Show', picture='myshow.jpg')

For more details see the usage page of the documentation.

License

Distributed under the MIT License.

You might also like...
Async wrapper over hentaichan.live

hentai-chan-api-async is a small asynchronous parser library that will allow you to easily use manga from https://hentaichan.live Recommended to use python3.7+

Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

Aio-binance-library - Async library for connecting to the Binance API on Python

aio-binance-library Async library for connecting to the Binance API on Python Th

Powerful and Async API for AnimeWorld.tv πŸš€

Powerful and Async API for AnimeWorld.tv πŸš€

Async client API for the Telegram Group Calls
Async client API for the Telegram Group Calls

PyTgCalls This project allow to make Telegram group call with MTProto Api using Pyrogram and WebRTC, this is possible thanks to the power of NodeJS's

Revolt.py - An async library to interact with the https://revolt.chat api.

Revolt.py An async library to interact with the https://revolt.chat api. This library will be focused on making bots and i will not implement anything

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

Comments
  • Upload of Flac files

    Upload of Flac files

    Hi there,

    can you think of any limitation preventing me from upload flac files? While this works fine using the WebUI of Mixcloud, I always end up with a concurrent.futures._base.TimeoutError. Full trace:

    data = mixcloud.upload(file_path_and_name, show_name) File "/home/pi/.local/lib/python3.7/site-packages/aiomixcloud/sync.py", line 55, in sync_method return loop.run_until_complete(attribute(*args, **kwargs)) File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete return future.result() File "/home/pi/.local/lib/python3.7/site-packages/aiomixcloud/decorators.py", line 174, in wrapper return await coroutine(self, *args, params=params, **kwargs) File "/home/pi/.local/lib/python3.7/site-packages/aiomixcloud/decorators.py", line 112, in wrapper return await coroutine(self, *args, **kwargs) File "/home/pi/.local/lib/python3.7/site-packages/aiomixcloud/core.py", line 412, in upload return await self._upload(params, data, url) File "/home/pi/.local/lib/python3.7/site-packages/aiomixcloud/core.py", line 387, in _upload async with self._session.post(final_url, data=data) as response: File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__ self._resp = await self._coro File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/client.py", line 504, in _request await resp.start(conn) File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 860, in start self._continue = None File "/home/pi/.local/lib/python3.7/site-packages/aiohttp/helpers.py", line 596, in __exit__ raise asyncio.TimeoutError from None concurrent.futures._base.TimeoutError

    Tested this on both Debian Buster and Windows 10, same issue- with or without async upload. I know there is a file limit/ size assertion and I commented that out in the core.py.

    Cheers, J

    opened by fa7ecc1f76 8
  • Dashboard API Access?

    Dashboard API Access?

    Happened upon the reddit post where this app was posted...

    Are you aware of any endpoints with mixcloud where you can query the main homepage that is tailored to the currently logged in user?

    Below is an example screenshot of what I'm referring to...

    image

    opened by qwertycody 3
  • SyntaxError: 'async with' outside async function

    SyntaxError: 'async with' outside async function

    I'm trying to get even just the basic example in the README and am getting this error straight away.

    I'm new to python, and am using 3.7, so I'm wondering if I need to downgrade to an old version, or if the documentation is out of date.

    I get it working (sort of) by wrapper everything in an async function and calling it with asyncio.run(_main()) but that seems like it defeats the purpose of your library.

    opened by lockykeaney 1
Releases(v1.0.6)
Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

null 16 Mar 29, 2022
YARSAW is an Async Python API Wrapper for the Random Stuff API.

Yet Another Random Stuff API Wrapper - YARSAW YARSAW is an Async Python API Wrapper for the Random Stuff API. This module makes it simpler for you to

Bruce 6 Mar 27, 2022
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async and await

Senpai Development 4 Nov 5, 2021
A modern,feature-rich, and async ready API wrapper for Discord written in Python

discord.io A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using asyn

Vincent 18 Jan 2, 2023
An async python wrapper to interact with the Steam API and its CMs

steam.py A modern, easy to use, and async ready package to interact with the Steam API. Heavily inspired by discord.py and borrowing functionality fro

James Hilton-Balfe 90 Dec 15, 2022
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

disfork A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async a

null 2 Feb 9, 2022
A modern, easy to use, feature-rich, and async ready API wrapper improved and revived from original discord.py.

A Python API wrapper that is improved and revived from the original discord.py

Orion 19 Nov 6, 2021
An async-ready Python wrapper around FerrisChat's API.

FerrisWheel An async-ready Python wrapper around FerrisChat's API. Installation Instructions Linux: $ python3.9 -m pip install -U ferriswheel Python 3

FerrisChat 8 Feb 8, 2022
This is a simple unofficial async Api-wrapper for tio.run

Async-Tio This is a simple unofficial async Api-wrapper for tio.run

Tom-the-Bomb 7 Oct 28, 2022
πŸš€ An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022