Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Document APIs with CoreAPI.

Project Description

coreapidocs [![travis][travis-image]][travis-url] [![pypi][pypi-image]][pypi-url]
Document APIs with CoreAPI.

### Prerequisites

- Python (2.7, 3.3, 3.4, 3.5)
- Core API ([Read More](

### Installation
You can install `coreapidocs` through pypi.

pip install coreapidocs

### Usage
You will have to pass a `.json` document to initialize the docs.

from import Docs

schema = open(filename, 'rb').read()
docs = Docs(schema)
except (IOError, OSError):
abort(400, {"msg": "No such file or directory - %s" % filename})

Then you can simply pass the `docs` variable to your template (ie. Flask):

return render_template('home.html', docs=docs.get_docs())

For more information view the source of [](coreapidocs/

### Development
Create the virtualenv and install the requirements.

virtualenv env
source env/bin/activate

pip install -r requirements.txt

You will need to pass an argument ie. `document.json`.

python coreapidocs/ document.json
# Then go to:

### Usage
Below you can find an example Flask application. Using `jinja2` you can pass the `coreapidocs` template to your view.

import sys
import jinja2
from flask import Flask, abort, render_template
from import Docs

app = Flask(__name__)

def docs():
Generate the coreapidocs and serve them to roor.
Accepts one parameter with a filename (ie. document.json)

if len(sys.argv) != 2:
abort(400, {"msg": "Missing file parameter ie. document.json"})

filename = sys.argv[-1]

schema = open(filename, 'rb').read()
docs = Docs(schema)
except (IOError, OSError):
abort(400, {"msg": "No such file or directory - %s" % filename})

templates_loader = jinja2.PackageLoader('coreapidocs', 'templates')
template_env = jinja2.Environment(loader=templates_loader)
template = template_env.get_template('docs.html')

# FIXME: Figure out how to pas static files

return render_template(template, docs=docs.get_docs())

def static_proxy(path):
Serve static files.
"send_static_file" will guess the correct MIME type
return app.send_static_file(path)

if __name__ == '__main__':
app.debug = True

### Tests
In order to run the tests you will have to run:




Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.4 kB) Copy SHA256 Hash SHA256
Source None Apr 19, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers