控制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第三方库


热门话题
@SpringBootTest的java一次性配置   java如何在JSF中使用facelets创建左导航窗格?   [Java]检查一个数字是否为素数,使用extra-isPrime标志不起作用   关于java中的单线计算器的一个问题?   Java代码在Java环境中运行良好,但在Android环境中抛出错误   java使用int数组的元素初始化字符串   sqlquery中的mysql Java Hibernate常量   java在使用同一实例时从外部类调用内部类方法   中的java CriteriaBuilder   对JPA实体使用BaseEntity时,Sonar中的java“等于错误”   java获取数组的平均值   java ANDROID:在主细节流布局的另一个活动中更新数据   java如何使用SpringGateway以字符串形式获取响应体?   jsp中分页公告板的javasql