Asyncio is an alternative module for working with A-parser.
Project description
aparser-async-api
Asyncio is an alternative module api-python for working with A-parser.
1. Dependencies
2. Implementation details
Adaptation of synchronous code should require a minimum of effort. All method names are identical to the original ones. The structure of the class is also similar to the original.
3. Usage example
import asyncio
from aparser_async_api import AParser
APARSER_URL = '''your A-parser API URL'''
APARSER_PASS = '''your A-parser API password'''
async def main():
task_id = 1
api = AParser(APARSER_URL, APARSER_PASS)
print(f'Ping: {await api.ping()}\n')
print(f'A-parser Info: {await api.info()}\n')
print(f'File link: {await api.getTaskResultsFile(task_id)}\n')
print(f'Task state: {await api.getTaskState(task_id)}\n')
print(f'Task config: {await api.getTaskConf(task_id)}\n')
print(f'Task list: {await api.getTasksList()}')
await api.close() # Mandatory closure of the session `aiohttp.ClientSession` if you no longer need it
if __name__ == '__main__':
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aparser_async_api-1.0.1.tar.gz.
File metadata
- Download URL: aparser_async_api-1.0.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dffa256cee980e8053bc96bb248255ceb11c64270b9262235b223f32a9482d5
|
|
| MD5 |
f18d7f25ad68b0c5cb818d4c7899eef2
|
|
| BLAKE2b-256 |
1b360b25ca957c86aeebf537c433b1383919fd91a86db7500b7babeb48c7e399
|
File details
Details for the file aparser_async_api-1.0.1-py3-none-any.whl.
File metadata
- Download URL: aparser_async_api-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7131a43f4ba14390a037308131f09dc1dfe5ed5c7f62f7e1cebb62c8af0234a
|
|
| MD5 |
72568d6d048b83846887bae704b7c107
|
|
| BLAKE2b-256 |
56a6eee5415e1b18826d69cc3f9c21f2ff75623a9b3804def08239e641abfe5d
|