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

tims-ocr-api

v3.2.0

Published

OCR for TIMS-server API

Downloads

13

Readme

TIMS-OCR-API For Nodejs

NPM version Build Status Coveralls Status

Downloads

intro

TIMS OCR提供两种接口:

  • Socket
  • HTTP(已废弃)

将Socket接口封装成OCR.scan()这样的Node.js接口。

API Document: https://yyssc.github.io/tims-ocr-api/jsdoc/

Advantages

  • 支持本地图片 外部图片(速度取决图片大小)
  • 用扫描仪扫描出的发票,识别率基本能达到 95%
  • 支持 shell/nodejs 全局安装可在控制台直接运行
  • bluebird/promise 接口操作灵活

识别发票类型

  • 增值税专用发票(票样

依赖

  • 安装ocr_srv并启动./start.sh

Install & Usage

1. Global

npm install tims-ocr-api -g

ocr --help

# 远程图片
ocr http://7pun4e.com1.z0.glb.clouddn.com/test.jpg

# 本地图片
ocr ./test.jpg
OCR识别输入和输出

ocr example

2. Nodejs

npm install tims-ocr-api --save

FYI examples

var host = '127.0.0.1';
var port = '39456';
var ocr = require('tims-ocr-api').create(host, port);
// 本地图片
ocr.upload('/tmp/test.jpg').then(function (result) {
  return console.log(result)
}).catch(function (err) {
  console.log('err', err);
})

Run UnitTest

make test
DEBUG=* make test # show debug log
mocha --ui tdd -g 'utils' # only test 'utils', and use TDD interface
make cov # Coverage rate

Note: travis-ci.org will run this test https://travis-ci.org/yyssc/tims-ocr-api

Build API document

grunt [jsdoc]

Publish API doc to github project pages

The generated API document is located in out/ dir.

.utility/push-jsdoc-to-gh-pages.sh will called when travis-ci finished Unittest, to push out/ dir to branch gh-pages of current repo.

TODO: out/ should generated automatically.

Mock server

You could use a mock test for testing.

https://github.com/yyssc/mock-tims-ocr

test data

  • 增值税专用发票 https://drive.google.com/drive/folders/0B_RIK8efdyq-VmZqMUJOaTVtVm8

ocr_srv API

OCR server socket API

License MIT