Skylab Genesis Python客户端

skylab-genesis的Python项目详细描述


#Skylab Genesis Python客户端

[![Circleci](https://circleci.com/gh/skylab-tech/genesis_client_python.svg?style=svg)(https://circleci.com/gh/skylab tech/genesis_client_python)
[![可维护性](https://api.codeculate.com/v1/badges/6e3316f60d72a9ca9276/可维护性)(https://codeculate.com/github/skylab tech/genesis_client_python/可维护性)
[![测试覆盖范围](https://api.codeculate.com/v1/badges/6e3316f60d72a9ca9276/test棼coverage)(https://codeculate.com/github/skylab-tech/genesis棼client棼python/test棼coverage)


[genesis.skylabtech.ai](https://genesis.skylabtech.ai)


##要求

-[python请求库](http://docs.python requests.org/en/master/user/install/install)

假设:

``python
import skylab_genesis

````

无论响应类型如何,api调用都返回一个响应对象。








\\\\\\\\\\\\\\\\\\\



```python
>api.list\jobs()
`````




``````python

```` python
>有效负载=={
>br/>"配置文件ID":1
}


api.create_job(payload=payload)
````

查阅[API文档](http://docs.genesis.skyllabtech.ai/35; _id:2
}


api.create_job(job_id=1,有效载荷=有效载荷)
```

对于所有有效载荷选项,查阅[API文档](http://docs.genesis.skyllabtech.ai/operation/updatejoobobbyid)的API文档(http://docs.genesis.genesis.skyllabtech.ai/operation/updatejobbobbyid),删除Job



``python
`````删除Job(job_id=1)
``````




```````` python
api.process job/api.process-job/api.process(作业id=1)取消工作


``python
api.取消工作(job_id=1)
`````


``python
``python
`` api.list_profiles()
```````````列出所有的个人资料

````````````````````````````````````
/>```取消工作(job id=1)
`````````````````````````列出所有的个人资料

/>"配置文件ID":1
}


api.为所有有效载荷选项创建配置文件(payload=payload)
```

,查阅[API文档](http://docs.genesis.skyllabtech.ai/operation/createprofile)的[API文档](http://docs.genesis.genesis.skyllabtech.ai/operation/createprofile)获取profile




`` python
api.get_profile(profile_id=1)
````





python

python/>
有效载荷{
_id':2
}


api.为所有有效载荷选项创建配置文件(配置文件id=1,有效载荷=payload)
````

,查阅[API文档](http://docs.genesis.skyllabtech.ai/operation/updateprofilebebyid)http://docs.genesis.genesis.skyllabtech.ai/operation/updateprofilebyid.operation/updateprofilebyid.



``python
`` api.delete\\\\\35;; ` `
``` `





` ` ` ` ` ` ` ` ` ` ` ` ` ` `u photos()
```

photo

`` python
payload={
'photo\u id':1
}


api.为所有payload选项创建照片(payload=payload)
```

,查阅[API文档](http://docs.genesis.skyllabtech.ai/operation/createphotopic)的API文档(http://docs.genesis.genesis.skyllabtech.ai/operation/create photo)获取照片



``python
api.get\u photo(photou id=1)获取照片
`````




```更新照片

`` python
python的有效载荷{
_id:2
}


api.create_photo(photo_id=1,有效载荷=有效载荷)
```

对于所有有效载荷选项,查阅[API文档](http://docs.genesis.skyllabtech.ai/operation/updatephotototototobyid)的API文档(http://docs.genesis.genesis.skyllabtech.ai/operation/updatephototototobyid),删除照片

``python
api.delete照片(photou id=1)
````

````

`````

`>
`




////``````


`` bash
>>>响应。状态代码
200

>;>response.json().get('success')
true

>;>response.json().get('status')
u'ok'

>>gt;response.json().get('profile\u-id')
u'numeric-profile-id'
````




<





```bash
>gt;>response.status\u code
>400
````



>*坏的api键






```bash


>````bash




>;>;>;响应。状态代码
403
````




<<


使用[tox](https://tox.readthedocs.io/en/latest/)运行测试:


`` bash
`
````
```
```
````
`
`
`
这假设您拥有[tox](https://tox.readthedocdoc)使用[tox](https://tox.readthedoc s.io/en/latest/)安装并使用
[pyenv](https://github.com/yyuu/pyenv)安装多个版本的python。

一旦安装了所有受支持的python版本,只需运行:

``bash
tox
````

` tox.ini`.

通常,这会有一个精确的错误

enable debug mode

debug mode打印出底层请求信息以及发送到genesis的数据
负载。您很可能会在日志中找到这些信息。要启用它,只需在实例化api对象时将"debug=true"作为参数。使用调试模式比较发送到[Genesis'API文档](http://docs.genesis.skylabtech.ai/)的数据负载。

``python
import skylab_genesis

api=skylab_genesis.api(api_key="your-api-key",debug=true)
````
响应范围遵循以下步骤:

-仔细检查数据和ID是否传递到Genesis
-确保API密钥正确
-记录并检查响应主体

上传

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

推荐PyPI第三方库


热门话题
JavaSpring重定向请求处理程序   SwingJava:拆分字符串并将其放入文本区域的   Java:标记“”上出现语法错误,此标记后面应为表达式   web服务Java RestService从日志文件写入和读取数据   java如何将ArrayList<String>转换为char数组,然后向后打印每个单词?   java SimpleDataFormat解析返回年终日期   加密Java aes解密bytebuffer,包括填充为空字节   java有没有办法从特定的if语句调用变量?   java从更新返回到渲染   spring GRPC Java登录测试   java为什么下面的代码不工作(StringBuffer.toString!=null)   java是一种可行的模式吗?   使用Spring集成测试的JavaOSGi片段   java jCommander为未知和未使用的值引发异常?   在imageView的editText中输入的java图像URL