{"id":17651781,"url":"https://github.com/lahsivjar/gcloud-ocr","last_synced_at":"2025-10-17T12:27:06.868Z","repository":{"id":71405591,"uuid":"197149729","full_name":"lahsivjar/gcloud-ocr","owner":"lahsivjar","description":"Sample OCR code to use with GCS and Cloud Functions","archived":false,"fork":false,"pushed_at":"2019-08-01T17:41:09.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T10:49:57.423Z","etag":null,"topics":["cloud-functions","gcloud","gcs","golang-examples","iap","pubsub"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lahsivjar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-16T08:08:55.000Z","updated_at":"2022-06-17T05:33:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"691bf5cf-16e3-4833-aebb-deb359fe0ff0","html_url":"https://github.com/lahsivjar/gcloud-ocr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lahsivjar%2Fgcloud-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lahsivjar%2Fgcloud-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lahsivjar%2Fgcloud-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lahsivjar%2Fgcloud-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lahsivjar","download_url":"https://codeload.github.com/lahsivjar/gcloud-ocr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296583,"owners_count":20754632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-functions","gcloud","gcs","golang-examples","iap","pubsub"],"created_at":"2024-10-23T11:43:38.838Z","updated_at":"2025-10-17T12:27:01.848Z","avatar_url":"https://github.com/lahsivjar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OCR using GCS and Cloud Functions\n\nSample code to use google functions with vision API and google cloud storage. The result is dumped into elasticsearch which is running on K8s cluster exposed via IAP.\n\n## Pipeline\n\n![OCR flow](ocr-flow.jpg)\n\n## Pre setup\n\n- Create pub/sub topic with name `image-file-type`\n- Create pub/sub topic with name `pdf-file-type`\n- Create pub/sub topic with name `es-upload`\n- Copy env.yaml.sample to env.yaml and update required values\n\n```\nWARNING: The env.yaml file has service account credentials which should be stored as a secret but it is out of scope for this PoC to do so. To learn more about it see [this](https://cloud.google.com/solutions/secrets-management/).\n```\n\n## Deployment\n```\ngcloud functions deploy DispatchWithFileType \\\n  --runtime go111 \\\n  --trigger-resource \u003ctarget_bucket_name\u003e \\\n  --trigger-event google.storage.object.finalize\n```\n\n```\ngcloud functions deploy DetectTextsFromImage \\\n  --runtime go111 \\\n  --trigger-topic image-file-types\n```\n\n```\ngcloud functions deploy UploadTextsToES \\\n  --runtime go111 \\\n  --trigger-topic es-upload \\\n  --env-vars-file env.yaml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flahsivjar%2Fgcloud-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flahsivjar%2Fgcloud-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flahsivjar%2Fgcloud-ocr/lists"}