Skip to main content

Tiny asyncio-based telgram api wrapper library

Project description

# aiotelegram
Tiny asyncio-based telgram api wrapper library.

## Reasons
* [aiotg](https://github.com/szastupov/aiotg) is framework, not library and have no proxy support.
* Raw api calls translation is better for understanding and will not break if telegram api will be changed.
* `snake_case`

## Features:
* Simple as telegram api is.
* Based on [`aiohttp`](https://github.com/KeepSafe/aiohttp).
* Proxy available (via [`aiohttp`](https://github.com/KeepSafe/aiohttp) [`ProxyConnector`](http://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ProxyConnector)).
* `snake_case` api converted to telegram `camelCase`.
* Polling `offset` handled for you via `get_updates` method.
* Source code is [short and simple](https://github.com/pohmelie/aiotelegram/blob/master/aiotelegram.py).

## Usage
### Polling updates
```python
import aiotelegram


async def ...(...):

api = aiotelegram.Api(token)
while True:

response = await api.get_updates()
if not response["ok"]:

...

else:

for update in response["result"]:

...

await asyncio.sleep(delay)
```
### Sending message
```python
async def ...(...):

await api.send_message(
chat_id=123456,
text="*foobar*",
parse_mode="Markdown",
)
```

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

aiotelegram-0.1.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

aiotelegram-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file aiotelegram-0.1.0.tar.gz.

File metadata

  • Download URL: aiotelegram-0.1.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aiotelegram-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b73b1d0ba29623d68bf990e67a50fdfa05ab12e4048214064d4c7f9883988129
MD5 f41d667e4c6adc03c550f14181ad6569
BLAKE2b-256 162ca17b7f797c433b54a9d48a3ff3800368dca16daa2cb223767c0a3dfc48da

See more details on using hashes here.

File details

Details for the file aiotelegram-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiotelegram-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2398b934c4279358fbc65b09b89036f158c4ddd8027bc02515190361929563c
MD5 0a6d093797cfb3746cf506b46c0c071b
BLAKE2b-256 7ec061a34d620bfaada623e0b530a5e5263f59e8b2255fad9a3cbef28d7acc59

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