faunadb python驱动程序
faunadb的Python项目详细描述
用于FaunaDB的python驱动程序。
安装
$ pip install faunadb
兼容性
支持以下版本的python:
- python 2.7版
- Python3.3
- Python3.4
- Python3.5
- python 3.6
文档
驱动程序文档位于https://faunadb.readthedocs.org/en/latest/。
有关完整的api引用,请参见FaunaDB Documentation,或者查看tests 更多的例子。
基本用法
fromfaunadbimportqueryasqfromfaunadb.objectsimportReffromfaunadb.clientimportFaunaClientclient=FaunaClient(secret="your-secret-here")indexes=client.query(q.paginate(q.indexes()))print(indexes)
自己建造
设置
$ virtualenv venv
$ source venv/bin/activate
$ pip install .
测试
要运行测试,必须有一个faunadb数据库可用。 然后将环境变量FAUNA_ROOT_KEY设置为数据库的根键。 如果您使用faunadb cloud,这是您登录时使用的密码。
然后运行make test。 要测试单个测试,请使用例如python -m unittest tests.test_client.ClientTest.test_ping。
测试也可以通过带有^{tt4}的Docker容器运行$ (另一个基于alpine的python映像可以通过运行时映像提供)。
覆盖范围
要使用coverage运行测试,请使用pip install .[coverage]安装coverage依赖项, 然后运行make coverage。将向终端显示摘要和详细的覆盖率报告 将在htmlcov/index.html提供。
记录
运行pip install .[doc]安装生成文档所需的包。 然后运行make doc,然后在Web浏览器中打开docs/_build/html/index.html。
贡献
Github拉取请求非常受欢迎。
许可证
版权所有2019 Fauna, Inc.
根据Mozilla公共许可证2.0版(即 “许可证”);您不得使用本软件,除非符合 执照。您可以在
除非适用法律要求或书面同意,否则软件 根据许可证分发是按“原样”分发的, 没有任何形式的保证或条件,无论是明示的还是 暗指的。有关特定语言的管理,请参见许可证 许可下的权限和限制。