Skip to content

Commit 4792e2a

Browse files
committed
feat: add codefactor and fix code style
1 parent e74f101 commit 4792e2a

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![CodeFactor](https://www.codefactor.io/repository/github/rhzs/serverless-ktp-ocr/badge/master)](https://www.codefactor.io/repository/github/rhzs/serverless-ktp-ocr/overview/master)
2+
13
## Serverless Indonesian KTP OCR with GCP
24

35
This is reproducible work from [Ekstraksi Informasi e-KTP dengan Google Cloud Function dan Cloud Vision API](https://medium.com/@imrenagi/ekstraksi-informasi-e-ktp-dengan-google-cloud-function-dan-cloud-vision-api-4655db21d084). It also contains code fix to match with ES6 compliant module usages.

extract-ktp/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def extract_ktp(data, context):
3333
"birthdate": res[4],
3434
}
3535

36-
print('Information extracted:{}'.format(p))
36+
print('Information extracted:{}'.format(p))

http-ktp/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
2+
"private": true,
23
"name": "http-ktp",
34
"version": "1.0.0",
45
"description": "",
56
"main": "index.js",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},
9-
"author": "",
10-
"license": "ISC",
1110
"dependencies": {
1211
"@google-cloud/storage": "^2.5.0",
1312
"busboy": "^0.3.1",

ktp-image-event-trigger/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ exports.processImageFromGCSEvent = (event, callback) => {
2727
const data = JSON.stringify({
2828
event_type: 'text.recognized',
2929
data: {
30-
results: results[0].textAnnotations,
30+
results: detections,
3131
image_path: gcsPath,
3232
operation_id: operationId
3333
}

ktp-image-event-trigger/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
2+
"private": true,
23
"name": "ktp-image-event-trigger",
34
"version": "1.0.0",
4-
"description": "",
5+
"description": "Event trigger for KTP image",
56
"main": "index.js",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},
9-
"author": "",
10-
"license": "ISC",
1110
"dependencies": {
1211
"@google-cloud/pubsub": "^0.30.1",
1312
"@google-cloud/vision": "^0.24.0"

0 commit comments

Comments
 (0)