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密钥正确
-记录并检查响应主体
上传
[![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密钥正确
-记录并检查响应主体
上传