Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kylef/draughtsman
API Blueprint Parser for Python 3
https://github.com/kylef/draughtsman
api-blueprint
Last synced: 10 days ago
JSON representation
API Blueprint Parser for Python 3
- Host: GitHub
- URL: https://github.com/kylef/draughtsman
- Owner: kylef
- License: bsd-3-clause
- Created: 2017-05-03T16:05:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T13:53:19.000Z (almost 5 years ago)
- Last Synced: 2024-12-23T08:02:50.182Z (19 days ago)
- Topics: api-blueprint
- Language: Python
- Homepage: https://apiblueprint.org
- Size: 19.5 KB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Draughtsman
[API Blueprint](https://apiblueprint.org) Parser for Python 3. Draughtsman is a
Python binding for the API Blueprint parser
[drafter](https://github.com/apiaryio/drafter).## Installation
```shell
$ pip install draughtsman
```Draughtsman requires the drafter library installed onto your system. Consult
the [drafter installation](https://github.com/apiaryio/drafter#install)
instructions for further information. Using Homebrew on macOS, Drafter can be
installed via:```shell
$ brew install drafter
```## Usage
```python
>>> 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](http://python-refract.readthedocs.io/en/latest/apielements.html#parseresult).
See [Python Refract](http://python-refract.readthedocs.io/en/latest/) 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.```shell
$ python -m draughtsman example.apib
>>> parse_result
]>
>>> parse_result.annotations
[]
>>> parse_result.api.title```