Skip to content

kylef/draughtsman

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Draughtsman

API Blueprint Parser for Python 3. Draughtsman is a Python binding for the API Blueprint parser drafter.

Installation

$ pip install draughtsman

Draughtsman requires the drafter library installed onto your system. Consult the drafter installation instructions for further information. Using Homebrew on macOS, Drafter can be installed via:

$ brew install drafter

Usage

>>> from draughtsman import parse
>>>
>>> parse_result = parse('# My API')
>>> parse_result.api.title.defract
'My API'

Draughtsman provides a parse function which returns a Refract ParseResult. See Python Refract for more information interacting with the parse result.

CLI

Draughtsman provides a convenience shell to parse an API Blueprint and interact with the parse result.

$ python -m draughtsman example.apib
>>> parse_result
<ParseResult content=[<Category content=[]>]>
>>> parse_result.annotations
[]
>>> parse_result.api.title
<String content='My API'>