Coder Social home page Coder Social logo

pyuque's Introduction

pyuque

pyuque一个蚂蚁金服的语雀的Python版本的API Client,并且提供了一些命令行工具来辅助进行授权、组织和管理语雀上的文档。

pyuque的文档也是通过pyuque更新到语雀上的,具体见https://www.yuque.com/socrateslee/pyuque.

安装

通过pip安装和升级pyuque

pip install -U pyuque

调用语雀API

下面是一个简单的范例,通过pyuque调用语雀API来获取一篇语雀官方开发文档的内容

from pyuque.client import Yuque

# 建立一个语雀API的client
client = Yuque("<YOUR_ACCESS_TOKEN>")

# 调用API,获取文档内容
client.doc.get("yuque/developer", "api")

在cli中进行OAuth认证

在下面的范例中,可以通过pyuque的cli在命令行中进行OAuth授权,获取access token:

python -m pyuque.cli --client_id <YOUR_CLIENT_ID>\
                     --client_secret <YOUR_CLIENT_SECRET>\
                     oauth-nonweb

在上面的命令中的oauth-nonweb代码非web流程,将运行命令后的网址粘贴到浏览器进行授权后,直接进入下一步就可以获得access token。

pyuque's People

Contributors

socrateslee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.