Make easier to use Tuya’s API.
Project description
tuya-api
tuya-api is a lib that make you easier to use tuya's api.
Install
pip install tuya-api
Example
import logging
import tornado.ioloop
import tornado.web
from tornado import gen
from tuya_api import Tuya
ty = Tuya(client_id='your client_id', secret='your secret', schema='you schema')
class TokenHandler(tornado.web.RequestHandler):
def data_received(self, chunk):
pass
@gen.coroutine
def get(self):
try:
ret = yield ty.get_access_token()
return self.write(ret)
except Exception as e:
logging.exception(e)
def main():
app = tornado.web.Application([
(r"/token", TokenHandler)
])
app.listen(8888)
print("=" * 100)
print("* Server: Success!")
print("* Host: http://localhost:8888")
print("* Quit the server with Control-C")
print("=" * 100)
tornado.ioloop.IOLoop.instance().start()
if __name__ == '__main__':
main()
Document
Author
Feiben(feiben.dev@gmail.com)
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
tuya_api-1.0.5.tar.gz
(5.8 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 tuya_api-1.0.5.tar.gz.
File metadata
- Download URL: tuya_api-1.0.5.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c595400d4ad7473f523605ec71234d2b087633092d84802a9f630297d370332
|
|
| MD5 |
04526e07f08f0cbed968cd69b5263193
|
|
| BLAKE2b-256 |
e3c439b50437e1171882ab8a69f96ec2a7cbe4d48c4aa1759627782bcf493a3e
|
File details
Details for the file tuya_api-1.0.5-py3-none-any.whl.
File metadata
- Download URL: tuya_api-1.0.5-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0e6f84e211f66699b1afbaf43bd0527ac9fea73e0382fbfb8a3fc7a3ae70234
|
|
| MD5 |
457998f135ebf0d964fa073015355e10
|
|
| BLAKE2b-256 |
ed6d5c2868a5b135de5cc3100a9aec84b1b2060894074e0ac3b4225a783978fa
|