Skip to main content

ITD client for python

Project description

pyClient

Клиент ITD для python

Установка

pip install itd-iter-api

Пример

from iter import Client

c = Client() # вход через встроенный браузер или из файла
c = Client(email='mail@example.com', password='1234') # вход через встроенный браузер и автозаполнение или из файла
c = Client(token='afvrc...', cookies='refresh_token=...;__ddg1=...; ...') # вход используя токен и куки или из файла
c = Client(use_manual_login=False) # можно отключить вход через браузер
c = Client(session_file='session.jsoon') # файл сессии с токеном и куки

print(c.get_me())

Скрипт на обновление имени

Этот код сейчас работает на @itd_sdk (обновляется имя и пост)

from itd import Client
from time import sleep
from random import randint
from datetime import datetime
from datetime import timezone

c = Client(None, '...')

while True:
    c.update_profile(display_name=f'PYTHON ITD SDK | Рандом: {randint(1, 100)} | {datetime.now().strftime("%m.%d %H:%M:%S")}')
    sleep(1)

Скрипт на смену баннера

from itd import Client

c = Client(None, '...')

id = c.upload_file('любое-имя.png', open('реальное-имя-файла.png', 'rb'))['id']
c.update_profile(banner_id=id)
print('баннер обновлен')

Встроенные запросы

Существуют встроенные эндпоинты для комментариев, хэштэгов, уведомлений, постов, репортов, поиска, пользователей, итд.

c.get_user('ITD_API') # получение данных пользователя
c.get_me() # получение своих данных (me)
c.update_profile(display_name='22:26') # изменение данных профиля, например имя, био итд
c.create_post('тест1') # создание постов
# итд

Кастомные запросы

from iter.request import fetch

fetch(c.token, 'метод', 'эндпоинт', {'данные': 'данные'})

Из методов поддерживается get, post, put итд, которые есть в requests К названию эндпоинта добавляется домен итд и api, то есть в этом примере отпарвится https://xn--d1ah4a.com/api/эндпоинт.

[!NOTE] xn--d1ah4a.com - punycode от "итд.com"

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

itd_iter_api-2.1.2.tar.gz (20.1 kB view details)

Uploaded Source

File details

Details for the file itd_iter_api-2.1.2.tar.gz.

File metadata

  • Download URL: itd_iter_api-2.1.2.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for itd_iter_api-2.1.2.tar.gz
Algorithm Hash digest
SHA256 2241d0f15b706f866cc36498679b99372d3e0690f372ea5f04596fc7174d246b
MD5 d8a76d0d9ce6bfde2d3683b918d9f27b
BLAKE2b-256 08d01d2ae89c040545350b088a8e402038518f560df77e553f3f703764f49f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for itd_iter_api-2.1.2.tar.gz:

Publisher: python-publish.yml on Sharkow1743/Iter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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