M
M
Mikkkch2020-12-31 16:25:57
Python
Mikkkch, 2020-12-31 16:25:57

How should the call to the API be organized?

Hello, I am writing a small asynchronous library that accesses an API. One already exists, but it is synchronous. I already wrote a lib on this topic and it was written in Go, and now I am writing in Python. In a library that already exists and is written in Python, just a response is returned as a result of accessing endpoints. In go, I took and put all the data in structures with json tags. Should I dump into classes in Python? I think that it will be much more convenient for a person to work this way, and in aiogram all results are unloaded into types and then work with already filled classes is carried out in handlers.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question