API Blueprint Parser for Python 3
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
draughtsman
tests
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
setup.py

README.md

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 --HEAD \
  https://raw.github.com/apiaryio/drafter/master/tools/homebrew/drafter.rb

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'>