一个蟒蛇的实现
tilda-wrapper-api的Python项目详细描述
蒂尔达API
的python实现开始
该项目通过使用数据类的面向对象的python接口提供对tilda.cc api的完全访问。
安装
使用包管理器pip安装包。
pip install tilda-wrapper-api
使用包管理器pipenv安装包。
pipenv install tilda-wrapper-api
用法
# Standard librariesimportos# Projectfromtilda_wrapper_api.clientimportClient# create a client object, default value secret=os.getenv('SECRET') and public=os.getenv('PUBLIC')client=Client()# get list of projectsprojects=client.get_projects_list()print(projects)# get project informationproject=client.get_project(projects.result[0].id)print(project)# get project information for exportproject_export=client.get_project_export(projects.result[0].id)print(project_export)# get list of pages in the projectpages=client.get_pages_list(projects.result[0].id)print(pages)# get information about the page (+ body html-code)page=client.get_page(pages.result[0].id)print(page)# get information about the page (+ full page html-code)page_full=client.get_page_full(pages.result[0].id)print(page_full)# get information about the page for export (+ body html-code)page_export=client.get_page_export(pages.result[0].id)print(page_export)# get information about the page for export (+ full page html-code)page_full_export=client.get_page_full_export(pages.result[0].id)print(page_full_export)
使用
构建- Requests-python对人类的http请求™
- dataclasses-json-库提供了一个简单的api,用于在json之间编码和解码数据类
贡献
欢迎拉取请求。对于重大变更,请先打开一个问题来讨论您希望更改的内容。
请确保根据需要更新测试。
作者
- sergey ozeranskiy-initial work-ozeranskiy
另请参阅参与此项目的contributors列表。
许可证
这个项目是在麻省理工学院的许可下授权的-请参见LICENSE.md文件了解详细信息