访问yaks服务的python api
yaks的Python项目详细描述
[![PYPI版本](https://badge.fury.io/py/yaks.svg)](https://badge.fury.io/py/yaks) [![生成状态](https://travis-ci.com/atolab/yaks-python.svg?token=LBmcudV28U4KHP4F42om&branch=master)](https://travis-ci.com/atolab/yaks-python) [![codecov](https://codecov.io/gh/atolab/yaks-python/branch/master/graph/badge.svg)](https://codecov.io/gh/atolab/yaks-python)
#yaks python api v0.2版
此repo包含python的yaks api绑定
####安装
$ make install
或
$ pip3 install yaks
要卸载旧版本,请运行此命令,直到pip说没有其他软件包为止
$ pip3 uninstall yaks
####更改日志
参见[ChangeLog文件](changelog.md)
####示例
在example文件夹中可以找到两个示例,一个使用主内存作为数据存储 而另一个正在使用mariadb。
为了运行示例,您需要运行一个yaks服务器。
主存储器示例:
yaksd -w [–verbosity=debug]
- 客户:
- python3 client.py<;yaks ip>;
您还可以将db示例与uses mariadb一起用于存储数据。
Mariadb示例:
你需要一个数据库演示和一个表测试。
数据库创建:
# mysql -u root -p > create database demo; > use demo;
定义tabla并放入一些测试数据:
> CREATE TABLE test (id SERIAL NOT NULL PRIMARY KEY, mystring VARCHAR(255), myint INT, myfloat REAL, mydate DATE); > INSERT INTO test VALUES (1, ‘test1’, 1, 1.1, ‘2018-01-01’); > INSERT INTO test VALUES (2, ‘test2’, 2, 2.2, ‘2018-02-02’); > INSERT INTO test VALUES (3, ‘test3’, 3, 3.3, ‘2018-03-03’);
启动Yaks服务器:
yaksd [–verbosity=debug] -u mariadb://root:password@127.0.0.1:3306/test -w
- 客户:
- python3客户端-sql.py<;yasks ip>;
####文档
要生成HTML文档,您需要sphinx和sphinx_rtd_theme
$ pip3 install sphinx sphinx_rtd_theme $ make doc
文档有两种格式,分别是pdf和html -docs/build/latex/yaks.pdf文件 -docs/build/dirhtml/index.html
版权所有2018 Adlink Technology Inc.