Skip to content

Instantly share code, notes, and snippets.

@ashhadulislam
Last active March 4, 2026 07:39
Show Gist options
  • Select an option

  • Save ashhadulislam/c39684476111b6ea104c9d6dd7de06ed to your computer and use it in GitHub Desktop.

Select an option

Save ashhadulislam/c39684476111b6ea104c9d6dd7de06ed to your computer and use it in GitHub Desktop.
import requests
import json
import base64
import os
import time
import json
import re
EXPECTED_KEYS = {
"serial_number",
"name",
"father_name",
"house_number",
"age",
"gender",
"id_number",
"under_adjudication",
"file_identifier",
"file_name"
}
openrouter_api_key='...' # your own api key
namecard_info_extractor_prompt='''
Extract the required fields from the image.
Fields:
- serial_number
- name
- father_name
- house_number
- age
- gender
- id_number
- under_adjudication
If watermark "Under Adjudication" is visible (even faint):
under_adjudication = true
Else:
under_adjudication = false
Return the extracted values.
No markdown.
No explanation.
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment