npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ocr-sdk

v0.3.2

Published

OCR Javascript SDK

Downloads

6

Readme

ocr-sdk

ocr - JavaScript client for ocr-sdk The OCR API 'ocr' performs Optical Character Resolution on input files. The flow is generally as follows: 1. First upload an image/file using the /ocr POST endpoint. You will get back a job response that contains a job with its associated settings. 2. Start the job from a PUT request to the /ocr/{jobid} endpoint, with the Job and Settings JSON as request body. The ocr extraction will now start. 3. Check the job status from the /ocr/{jobid} GET endpoint until the status has changed to DONE or ERROR. Messaging using a websocket will be available as an alternative in a future version 4. Retrieve the OCR result using the /ocr/{jobid}/result GET endpoint. This will return the OCR result only when the status is DONE. In other cases it will return the Job Response JSON (with http code 202 instead of 200) Interactive testing: A web based test console is available in the <a href="https://store.sphereon.com">Sphereon API Store This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 0.3.2
  • Build date: 2017-03-30T16:04:07.623+02:00
  • Build package: class io.swagger.codegen.languages.JavascriptClientCodegen For more information, please visit https://sphereon.com

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install ocr-sdk --save

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Getting Started

Please follow the installation instruction and execute the following JS code:

var ocr = require('ocr-sdk');

var defaultClient = ocr.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2schema
var oauth2schema = defaultClient.authentications['oauth2schema'];
oauth2schema.accessToken = "YOUR ACCESS TOKEN"

var api = new ocr.OcrApi()

var jobid = "jobid_example"; // {String} jobid

api.deleteJob(jobid).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://gw.api.cloud.sphereon.com/

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- ocr.OcrApi | deleteJob | DELETE /ocr/1.0.0/ocr/{jobid} | Delete a job manually ocr.OcrApi | getJob | GET /ocr/1.0.0/ocr/{jobid} | Job definition and state ocr.OcrApi | getJobs | GET /ocr/1.0.0/ocr | Get all jobs ocr.OcrApi | getResult | GET /ocr/1.0.0/ocr/{jobid}/result | Get the current ocr result ocr.OcrApi | submitJob | PUT /ocr/1.0.0/ocr/{jobid} | Submit OCR job for processing ocr.OcrApi | uploadFile | POST /ocr/1.0.0/ocr | Upload first file

Documentation for Models

Documentation for Authorization

oauth2schema

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
    • global: accessEverything