这是整个易度平台的Python SDK,供第三方应用访问易度的各种服务。
易度开放API,基于OAuth2协议构建, 参看这里
安装
标准的pip安装流程:
pip install edo_client
最简使用方法
如果你知道用户名和密码,可以使用如下最简使用方法:
from edo_client import get_client
可以直接得到工作平台的客户端, 上传文件、修改属性:
wo_client = get_client('workonline',
oc_api='http://192.168.1.12/oc_api',
account='zopen',
instance='instance',
username='admin',
password='admin')
wo_client.content.upload('/files', filename=ur'c:\mydoc\abc.doc')
wo_client.content.items('/files')
wo_client.content.update_properties('/files', fields={'subject':['Good']})
如果需要操作组织结构:
org_client = get_client('org',
oc_api='http://192.168.1.12/oc_api',
account='zopen',
instance='instance',
username='admin',
password='admin')
org_client.org.list_org_structure()
使用code认证
假设你的回调url是redirect_uri:
from edo_client import WoClient, OcClient api_host = 'http://192.168.1.12/oc_api' key = 'test' secret = '022127e182a934dea7d69s10697s8ac2' # 得到认证地址 oc_client = OcClient(api_host, key, secret, redirect=redirect_uri, account='zopen', instance='default') authorize_url = oc_client.get_authorize_url()
你可以通过浏览器访问authorize_url,会自动附带code参数跳转到redirect_uri,继续认证过程:
oc_client.auth_with_code(code)
Metadata
Release files for edo_client 0.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| edo_client-0.9.3.tar.gz | 17.2 kB | Without provenance | Details |
Release files / edo_client-0.9.3.tar.gz
| Download URL | edo_client-0.9.3.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2828bf54919396695d150887fc1e350f9930f49ee3441402ff2bbd5fd95ad78
|
|
BLAKE2b-256 checksum How to use checksums |
0582a5139183a971c0f892df3a0a652c9e998239102204bb27b8c6a3ec1297be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for edo_client 0.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.