Improve the structure of this lib
See original GitHub issueThis is my idea about how it can be improved:
-
Get rid of
global
. This is not Pythonic. It may be useful for ad-hoc automation script, but for a serious, well-structured library, uhm, no. -
Let accept server URL as input, so that the lib can be used with SUSI server installed anywhere. We have these URLs hardcoded:
https://api.susi.ai
,http://localhost:4000/
, but we should treat them as “default” value. Actually, when we make server URL customizable, we only need 1 default value, eitherhttps://api.susi.ai
orhttp://localhost:4000/
. -
If we can, let’s make this lib “sans-IO”, i.e, the lib won’t do the job of receiving, sending data (over network), it only takes care of parsing, combining data. With this approach, our lib can be used both in synchronous code (where
requests
is often used for transporting) and asyncio code (whereaiohttp
is used for transporting). List of sans-io libs as reference: https://github.com/brettcannon/sans-io/blob/master/index.rst
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
I think 1 and 2 are relatively easy and can be implemented without big interruption.
3 sounds a bit more complicated, though, since it requires adaptions of
susi_linux
interaction, I guess.I vote for getting 1 and 2 done soon!
@stealthanthrax Great!