TGViewer
Zen of Python Zen of Python @zen_of_python · 18.8K subscribers
Post #2875 5.3K
tiny-api-client для своих эндпоинтов

Короче способа создать API, пожалуй, трудно найти:


from tiny_api_client import api_client, get, post, delete

@api_client('https://example.org/api/public/v{version}')
class MyAPIClient:
@get('/users/{user_id}')
def find_user(self, response):
return response

@post('/notes')
def create_note(self, response):
return response

>>> client = MyClient()
>>> client.find_user(user_id='PeterParker')
{'name': 'Peter', 'surname': 'Parker', ...}

Проект на GitHub

#API
  • 🍌 6
  • 👎 2
  • 👍 1
More from @zen_of_python
  1. Oct 8, 2026Почему цикл внутри теста скрывает часть ошибок Тест перебирает десять входов и проверяет р…
  2. Oct 8, 2026Как выполнять CPU-задачи в отдельных интерпретаторах Python В Python 3.14 InterpreterPoolE…
  3. Oct 8, 2026Как отличить отсутствие аргумента от None в Python Если None — допустимое значение настрой…
  4. Oct 7, 2026security.txt в Django: контакт для сообщений об уязвимостях Исследователь нашёл уязвимость…
  5. Oct 6, 2026Как открывать ссылки Django-сайта в приложениях Apple и Android Для этого нужна двусторонн…
  6. Oct 6, 2026Как собрать Rust-проект с Python-модулем и отдельной программой В пошаговом примере кальку…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →