Skip to main content

async client library for the Emote Collector API

Project description

An aiohttp-based client for the Emote Collector API.

Usage

import aioec

anonymous_client = aioec.Client()
authenticated_client = aioec.Client(token='your token here')
local_client = aioec.Client(base_url='http://ec.localhost:2018/api/v0')  # no trailing slash!

# this step isn't necessary but makes sure that your token is correct
my_user_id = await client.login()
# it returns the user ID associated with your token

# in a coroutine...
emote = await client.emote('Think')
emote.name  # Think

await emote.edit(name='Think_', description='a real happy thinker')
# remove the description:
await emote.edit(description=None)

for gamewisp_emote in await client.search('GW'):
        await gamewisp_emote.delete()

all_emotes = [emote async for emote in client.emotes()]
popular_emotes = await client.popular()

await client.close()

# it's also a context manager:
async with aioec.Client(token=my_token) as client:
        await client.delete('Think_')
# this will automatically close the client

With the Tor hidden services

You’ll need to install aiohttp_socks first.

from aiohttp_socks import SocksConnector
import aioec

connector = SocksConnector(port=9050, rdns=True)  # without rdns, the connector will fail to resolve onions
client = aioec.Client(
        connector=connector,
        base_url='http://emotesdikhisgxdcmh7wtlvzfw2yxp4vmkyy6mu5wixzgqfmxvuotryd.onion/api/v0',
)

License

MIT/X11

Copyright © 2018–2019 Io Mintz <io@mintz.cc>

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

aioec-0.6.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

aioec-0.6.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file aioec-0.6.0.tar.gz.

File metadata

  • Download URL: aioec-0.6.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for aioec-0.6.0.tar.gz
Algorithm Hash digest
SHA256 00e028f1c0e2260f7ce9d08b63adda229ff6b70a896e837143fee42653dc3d15
MD5 e18040984603ca231f414c6b48406a75
BLAKE2b-256 831a12de0d71a4efe7387885bffb8faa4842b27e49b2af5877f869ac98538123

See more details on using hashes here.

File details

Details for the file aioec-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: aioec-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for aioec-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04b50c3ab2a4e33b9968893e153bb8dd97ea10d98cb9cc085c57903d7960ced4
MD5 e2323f048c9c7d13d0c0a9fb193b7089
BLAKE2b-256 29fe446930ffb8f59ff5399d71b24ba89e024220b2c0ef740ac22093d3a40de3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page