控制Shinobi的Python客户端(一种开源视频管理解决方案)

shinobi-client的Python项目详细描述


Build StatusCode CoveragePyPi

Shinobi Python客户端

用于控制Shinobi(一种开源视频管理)的Python客户端 解决方案)。

关于

这个包包含一组(非常不完整)的工具,用于使用Python与Shinobi交互。在

这个库尝试使用(相当独特的)documented API,但它也使用 未记录的终结点(可能不稳定)。在

安装

PyPi安装:

pip install shinobi-client

安装时能够启动Shinobi安装:

^{pr2}$

使用CLI安装:

pip install shinobi-client[cli]

使用

警告:方法通常不是线程安全的。

Python

从为特定的Shinobi安装创建客户端开始:

fromshinobi_clientimportShinobiClientshinobi_client=ShinobiClient(host,port,super_user_token=super_user_token)

({and}仅对某些操作是必需的

用户

user=shinobi_client.user.get(email)# Get user details using the user's password (does not require super user token)user=shinobi_client.user.create(email,password)users=shinobi_client.user.get_all()user=shinobi_client.user.create(email,password)modified=shinobi_client.user.modify(email,password=new_password)deleted=shinobi_client.user.delete(email)

API密钥

api_key=shinobi_client.api_key.get(email,password)

监视器(摄像头设置)

# Setting monitors (camera setups) for the user with the given email addressmonitor_orm=shinobi_client.monitor(email,password)monitors=monitor_orm.get_all()monitor=monitor_orm.get(monitor_id)monitor=monitor_orm.create(monitor_id,configuration)modified=monitor_orm.modify(monitor_id,configuration)deleted=monitor_orm.delete(monitor_id)

Shinobi控制器

{临时启动^/a7}。书面 为了测试的目的,但它也可以作为额外的安装。需要Docker。在

fromshinobi_clientimportstart_shinobiwithstart_shinobi()asshinobi_client:print(shinobi_client.url)# Do things with a temporary Shinobi installation

或者

fromshinobi_clientimportShinobiControllercontroller=ShinobiController()shinobi_client=controller.start()print(shinobi_client.url)# Do things with a temporary Shinobi installationcontroller.stop()

CLI

如果软件包安装了cli额外的命令行,则可以使用基本的自动生成CLI:

PYTHONPATH=. python shinobi_client/user.py \
        --host=HOST --port=PORT --super_user_token=SUPER_USER_TOKEN \
    get user@example.com

例如

$ PYTHONPATH=. python shinobi_client/cli.py \
        --host='0.0.0.0' --port=50694 --super_user_token='26dd3352-73c4-4bbd-8b09-17f2aacbd7b9'\
    create 'user@example.com''password123'

发展

使用开发依赖项安装:

poetry install --no-root --extras "shinobi-controller cli"

使用以下内容运行测试:

python -m unittest discover -v -s shinobi/tests

合法的

GPL v3.0。版权所有2020 Colin Nolan。在

我与Shinobi项目的开发没有任何关系。在

这项工作与我工作的公司毫无关系。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Spring启动测试中的java MockBean注释导致NonuniqueBeandDefinitionException   java Spring Hateoas调试模板不能为null   递归培根游戏Java程序?   java在Android中保存少量数据(对象)的最简单方法是什么?   异常处理Java中finally块的要点是什么?   是java。util。货币真的是工厂方法模式吗?   java如何输入字符以停止循环   java如何对流的某些部分执行缩减操作   java new Gson()。单例类的toJson(object)返回null   java Itext泰米尔字体显示不正确   java运行时。getRuntime()。gpg命令不起作用的exec()   java如何在preparedstatemenet中将字符连接到SQL字符串   java将同一实体的多个表示形式与lazyload合并时出错   JavaSpring、Hibernate和JPA:在entitymanager上调用persist似乎并没有提交到数据库   java osgi r6服务。组成部分注释属性列表