{% extends 'bootstrap/base.html' %} {% import 'bootstrap/fixes.html' as fixes %} {% block title %}d3cryp7.py{% endblock %} {% block head %} {{super()}} {{fixes.ie8()}} {% endblock %} {% block content %}

Documentation

Home

Examples

Curl

$ curl http://{{ host }}:{{ port }}/api/statistics
$ curl http://{{ host }}:{{ port }}/api/recognize -F "image=<base64 encoded image>" -X POST

Python Requests

import requests

requests.get('http://{{ host }}:{{ port }}/api/statistics').json()
requests.post('http://{{ host }}:{{ port }}/api/recognize', data = {'image': '<base64 encoded image>'}).json()

The result of these examples is as follows:


Version

GET

Returns the version of the application

{
  "version": "0.1.0"
}
http://{{ host }}:{{ port }}/api/version

Statistics

GET

Returns statistics about the application and the Python interpreter

{
  "python": {
    "platform": "linux",
    "version": "3.5.2"
  },
  "d3cryp7": {
    "status_code": 0,
    "version": "0.1.0",
    "status": "RUNNING"
  },
  "time": {
    "running": 289,
    "start": 1475188829,
    "current": 1475189118
  }
}
http://{{ host }}:{{ port }}/api/statistics

Recognize

POST

Uses optical character recognition to extract text from an image

Arguments

Name Description
image A base64 encoded image
{
  "result": "The quick brown fox jumps over the lazy dog."
}
http://{{ host }}:{{ port }}/api/recognize
{% endblock %}