Python клиент для Telecore Telegram Database API с поддержкой proxy
Project description
Telecore API Client
Python клиент для работы с Telecore Telegram Database API с поддержкой proxy.
Установка
pip install telecore-api
Быстрый старт
from telecore import TelecoreAPI
# Создание клиента
api = TelecoreAPI(api_key="your-api-key")
# С proxy
api = TelecoreAPI(
api_key="your-api-key",
proxy="socks5://localhost:1080"
)
pypi-AgEIcHlwaS5vcmcCJDY1MzkzM2M5LTBiNWMtNGZkZC1hNDIwLWJjODZkNGUxOWVjMQACKlszLCI3Y2M5OWQ1ZS1mZDUxLTQxMDYtYTljZC0zMTAzYzg4YzBkZmMiXQAABiCCU23tYLL7N__08s-sufPfXy--pvsl0KAVFGykZ2_wNA
# Поиск пользователей
result = api.search_users(username="durov")
for user in result.data:
print(f"{user.user_id}: {user.first_name}")
# Семантический поиск
result = api.semantic_search("уязвимость CVE", limit=10)
for msg in result.data.results:
print(f"[{msg.score:.2f}] {msg.text[:50]}")
# Баланс
balance = api.get_balance()
print(f"Баланс: {balance.data.balance}")
api.close()
Async
import asyncio
from telecore import AsyncTelecoreAPI
async def main():
async with AsyncTelecoreAPI(api_key="your-key") as api:
users = await api.search_users(username="example")
print(users.data)
asyncio.run(main())
Proxy Support
# HTTP/HTTPS
api = TelecoreAPI(api_key="xxx", proxy="http://proxy:8080")
# SOCKS5
api = TelecoreAPI(api_key="xxx", proxy="socks5://localhost:1080")
# С аутентификацией
api = TelecoreAPI(api_key="xxx", proxy="http://user:pass@proxy:8080")
API Методы
| Метод | Описание |
|---|---|
search_users() |
Поиск пользователей |
get_user_messages() |
Сообщения пользователя |
get_message_context() |
Контекст сообщения |
semantic_search() |
Семантический поиск |
get_user_history() |
История изменений профиля |
search_history() |
Поиск по истории |
search_channels() |
Поиск каналов |
get_channel_info() |
Информация о канале |
get_balance() |
Баланс аккаунта |
License
MIT
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
telecore_api-1.1.2.tar.gz
(11.3 kB
view details)
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 telecore_api-1.1.2.tar.gz.
File metadata
- Download URL: telecore_api-1.1.2.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bcf650ad26b281edda72aa3011d46784158909467e6df154666efa92dc7b632
|
|
| MD5 |
19023abe336f14f16b896421de44db6f
|
|
| BLAKE2b-256 |
aef6ad0aa8c565b31c13a670bcfe00080585ed0c982e13a556d61dce3ed5f1ad
|
File details
Details for the file telecore_api-1.1.2-py3-none-any.whl.
File metadata
- Download URL: telecore_api-1.1.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3b6a0a5000a156eb4f4844931212f66d7f986dfdc3eb52c54d1ad33af493f81
|
|
| MD5 |
d82eabeafa28742c36964cf6bf2af425
|
|
| BLAKE2b-256 |
0329f74889b7b048c7d01e43a2c15083cdae5ab02e9c578c5ad43268321eb91c
|