平面API客户端
flat-api的Python项目详细描述
平面api允许您轻松地扩展Flat Platform的功能,包括 以下内容:-使用musicxml创建和导入新的音乐乐谱 或MIDI文件-浏览、更新、复制、导出用户的分数 (例如MP3、WAV或MIDI)-使用 教育平台:创建和更新组织帐户 课程、名册和作业。
您可以找到api引用,包括代码示例和我们的openapi 位于以下URL的规范: https://flat.io/developers/api/reference。
要请求一些api凭据,请访问 https://flat.io/developers。
这个python包是由Swagger Codegen项目自动生成的。
要求。
python 2.7和3.4+
安装和使用
pip安装
pip install flat_api
pip install git+https://github.com/FlatIO/api-client-python.git
然后导入包:
importflat_api
设置工具
通过Setuptools安装。
python setup.py install --user
(或sudo python setup.py install为所有用户安装软件包 用户)
然后导入包:
importflat_api
开始
请遵循上述安装过程,然后运行 以下内容:
from__future__importprint_functionimporttimeimportflat_apifromflat_api.restimportApiExceptionfrompprintimportpprintconfiguration=flat_api.Configuration()# Configure your personal access token or OAuth2 access tokenconfiguration.access_token='YOUR_ACCESS_TOKEN'flat_api_client=flat_api.ApiClient(configuration)# create an instance of the API classapi_instance=flat_api.AccountApi(flat_api_client)try:# Get current user profileapi_response=api_instance.get_authenticated_user()pprint(api_response)exceptApiExceptionase:print("Exception when calling AccountApi->get_authenticated_user: %s\n"%e)