Skip to content

Commit d4b27d3

Browse files
authored
Merge pull request #4 from Monogramm/develop
Fix build URL for travis
2 parents 8a8f9b1 + 4edfee7 commit d4b27d3

File tree

6 files changed

+82
-30
lines changed

6 files changed

+82
-30
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ before_script:
1414
- env | sort
1515
- dir="test"
1616
- export IMAGE_NAME=docker-erpnext-ext:erpnext_ocr-travis
17+
- export BUILD_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}
18+
- export BUILD_URL=https://github.com/${TRAVIS_PULL_REQUEST_SLUG:-${TRAVIS_REPO_SLUG}}
1719

1820
script:
1921
- cd "$dir"
@@ -41,6 +43,7 @@ script:
4143
- docker-compose -f docker-compose.${DATABASE}.yml logs "erpnext_web"
4244
- docker-compose -f docker-compose.${DATABASE}.yml ps "erpnext_web" | grep "Up"
4345
- echo 'Wait until test finished (1-2 minutes)' && sleep 90
46+
- docker-compose -f docker-compose.${DATABASE}.yml logs "sut"
4447
- docker-compose -f docker-compose.${DATABASE}.yml ps "sut" | grep "Exit 0"
4548
# Test container restart
4649
- docker-compose -f docker-compose.${DATABASE}.yml down

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
10+
### Changed
11+
12+
### Fixed
13+
14+
### Removed
15+
16+
<a name="0.9.0"></a>
17+
## [0.9.0] - 2019-11-06
18+
819
### Added
920
- PDF management in `OCR Read`
1021
- `OCR Language` to manage available tesseract traindata files

README.md

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,62 @@
88

99
## ERPNext OCR
1010

11-
OCR with [tesseract](https://github.com/tesseract-ocr/tesseract).
11+
> :alembic: **Experimental** Frappe OCR application with [tesseract](https://github.com/tesseract-ocr/tesseract).
1212
13-
#### License
13+
This project is a fork of [ERPNext-OCR](https://github.com/jvfiel/ERPNext-OCR) by [John Vincent Fiel](https://github.com/jvfiel). Its aim is to fix and cleanup the original source code and add some new features.
1414

15-
MIT# ERPNext-OCR
15+
https://discuss.erpnext.com/t/erpnext-ocr-app/33834/7
1616

17-
## About this project
1817

19-
This project is a fork of [ERPNext-OCR](https://github.com/jvfiel/ERPNext-OCR) by John Vincent Fiel.
20-
Its aim is to fix and cleanup the original source code and add some new features.
18+
## :chart_with_upwards_trend: Changes
2119

22-
**Changes**
23-
* See [CHANGELOG](./CHANGELOG.md)
20+
See [CHANGELOG](./CHANGELOG.md)
2421

2522

26-
**Roadmap**
27-
* See [Taiga.io](https://tree.taiga.io/project/monogrammbot-monogrammerpnext_ocr/ "Taiga.io monogrammbot-monogrammerpnext_ocr")
23+
## :bookmark: Roadmap
2824

25+
See [Taiga.io](https://tree.taiga.io/project/monogrammbot-monogrammerpnext_ocr/ "Taiga.io monogrammbot-monogrammerpnext_ocr")
2926

30-
## Sample Screenshot
31-
![Sample Screenshot](https://github.com/jvfiel/ERPNext-OCR/blob/master/erpnext_ocr/erpnext_ocr/Selection_046.png)
3227

33-
## File Being Read
34-
![Sample Screenshot 2](https://github.com/jvfiel/ERPNext-OCR/blob/master/erpnext_ocr/erpnext_ocr/Selection_047.png)
28+
## :construction: Install
3529

30+
**Pre-requisites: tesseract-python and imagemagick**
3631

37-
## Pre-requisites: tesseract-python and imagemagick
38-
39-
- Install tesseract-ocr, plus imagemagick and ghostscript (to work with pdf files) using this command on Debian:
32+
Install tesseract-ocr, plus imagemagick and ghostscript (to work with pdf files) using this command on Debian:
4033
```
4134
sudo apt-get install tesseract-ocr imagemagick libmagickwand-dev ghostscript
4235
```
4336

44-
## Installation
37+
**Install Frappe application**
4538

46-
```
47-
bench get-app --branch develop erpnext_ocr https://github.com/Monogramm/erpnext_ocr
48-
bench install-app erpnext_ocr
49-
```
39+
```sh
40+
bench get-app --branch develop erpnext_ocr https://github.com/Monogramm/erpnext_ocr
41+
bench install-app erpnext_ocr
42+
```
5043

5144
When installing Frappe app, the following python requirements will be installed:
5245
* python binding for tesseract, [pytesseract](https://pypi.org/project/pytesseract/)
5346
* image processing library in python, [pillow](https://pypi.org/project/Pillow/)
5447
* HTTP library in python, [requests](https://pypi.org/project/requests/)
5548
* python binding for imagemagick, [wand](https://pypi.org/project/Wand/)
5649

57-
## Tesseract trained data
50+
## :rocket: Usage
51+
52+
**Sample Screenshot**:
53+
54+
![Sample Screenshot](./erpnext_ocr/erpnext_ocr/Selection_046.png)
55+
56+
57+
**File Being Read**:
58+
59+
![Sample Screenshot 2](./erpnext_ocr/erpnext_ocr/Selection_047.png)
60+
61+
### Tesseract trained data
5862

5963
In order to use OCR with different languages, you need to install the appropriate trained data files.
60-
Check tesseract Wiki for details https://github.com/tesseract-ocr/tesseract/wiki/Data-Files
64+
Check tesseract Wiki for details: https://github.com/tesseract-ocr/tesseract/wiki/Data-Files
6165

62-
## Known issues
66+
### Known issues
6367

6468
* `wand.exceptions.PolicyError: not authorized '/opt/sample.pdf' @ error/constitute.c/ReadImage/412`
6569
* This can happen due to security configuration in imagemagick, preventing it to read PDF files.
@@ -73,3 +77,37 @@ Check tesseract Wiki for details https://github.com/tesseract-ocr/tesseract/wiki
7377
* `OSError: encoder error -2 when writing image file`
7478
* This might happen when trying to open a TIFF image, but the real error is "_hidden_" and only displayed in console.
7579
* If the original error in console is `Fax3SetupState: Bits/sample must be 1 for Group 3/4 encoding/decoding.` that usually happens when TIFF image compression is not valid / recognized.
80+
81+
## :white_check_mark: Run tests
82+
83+
```sh
84+
bench bench run-tests --profile --app erpnext_autoinstall
85+
```
86+
87+
## :bust_in_silhouette: Authors
88+
89+
**Monogramm**
90+
91+
* Website: https://www.monogramm.io
92+
* Github: [@Monogramm](https://github.com/Monogramm)
93+
94+
**John Vincent Fiel**
95+
96+
* Github: [@jvfiel](https://github.com/jvfiel)
97+
98+
## :handshake: Contributing
99+
100+
Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/Monogramm/erpnext_ocr/issues).
101+
[Check the contributing guide](./CONTRIBUTING.md).<br />
102+
103+
## :thumbsup: Show your support
104+
105+
Give a :star: if this project helped you!
106+
107+
## :page_facing_up: License
108+
109+
Copyright © 2019 [Monogramm](https://github.com/Monogramm).<br />
110+
This project is [MIT](uri_license) licensed.
111+
112+
***
113+
_This README was generated with :heart: by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

erpnext_ocr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
__version__ = '0.0.1'
4+
__version__ = '0.9.0'
55

test/docker-compose.mariadb.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ services:
3838
context: ./
3939
dockerfile: Dockerfile.${VARIANT}
4040
args:
41-
- BUILD_BRANCH=${TRAVIS_BRANCH}
42-
- BUILD_URL=https://github.com/${TRAVIS_REPO_SLUG}
41+
- BUILD_BRANCH=${BUILD_BRANCH}
42+
- BUILD_URL=${BUILD_URL}
4343
image: ${IMAGE_NAME}
4444
container_name: erpnext_app
4545
command: app

test/docker-compose.postgres.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ services:
3838
context: ./
3939
dockerfile: Dockerfile.${VARIANT}
4040
args:
41-
- BUILD_BRANCH=${TRAVIS_BRANCH}
42-
- BUILD_URL=https://github.com/${TRAVIS_REPO_SLUG}
41+
- BUILD_BRANCH=${BUILD_BRANCH}
42+
- BUILD_URL=${BUILD_URL}
4343
image: ${IMAGE_NAME}
4444
container_name: erpnext_app
4545
#restart: always

0 commit comments

Comments
 (0)