Bulgaria Lichna karta (Лична карта) OCR Python SDK

Instantly extract Cyrillic text, EGN numbers, and validate cryptographic MRZ checksums from Bulgarian IDs using our native Python library.

AI extracting Cyrillic text, EGN, and TD1 MRZ data from a Bulgaria Lichna karta
StructOCR engine extracting Bilingual Visual Zone (VIZ) and validating the MRZ on a Bulgarian document in real-time.

Parsing Lichna karta (Лична карта) Challenges

Bulgarian Lichna karta presents unique OCR challenges. First, the mix of Cyrillic and Latin characters within the same document necessitates robust bilingual recognition that standard OCR engines struggle to provide. Second, locating and accurately extracting the 10-digit EGN (ЕГН - Uniform Civil Number) is critical for local compliance but formatting often varies. Finally, manually parsing the Machine-Readable Zone (MRZ) on the back of the card to mathematically verify the document's authenticity adds significant engineering overhead.

Why StructOCR for Bulgaria

StructOCR is specifically trained on a large dataset of Bulgarian Lichna karta, ensuring unparalleled accuracy with both Cyrillic and Latin scripts. Our Python SDK automatically locates critical fields like the EGN and simplifies integration via our national ID parsing API, making it ideal for accelerating your KYC automation platform.

Common Use Cases in the Balkans

  • Digital Onboarding: Verify users for Fintech apps in Bulgaria by pre-filling EGN and Cyrillic name data in < 2 seconds.
  • Telecom Registration: Automate SIM card registration with native Cyrillic script extraction.
  • Pan-Balkan Expansion: Seamlessly process users across Eastern Europe. Our unified Python SDK automatically detects and extracts data from neighboring documents, such as the Romania ID or Greece ID, without requiring custom rules.

Live Demo: ID card scanner

No registration required. Upload a file to test the extraction.

1
Upload
2
Results

Drop files here or click to browse

JPG · PNG · WebP  ·  up to 500 files · max 4.5 MB each

No files selected
Need more testing? Create a free account to get 200 free credits (equals 100 National ID scans).

Python SDK Integration

Install the SDK via pip: `pip install structocr`. The SDK automatically maps Bulgaria-specific fields (like EGN) and parses the TD1 MRZ block.

Prerequisite: Python 3.6+ and `structocr` library installed.

from structocr import StructOCR

# 🔑 Need a key for Bulgaria? Get 200 free credits instantly:
# 👉 https://structocr.com/register
# Initialize with your API Key
client = StructOCR("YOUR_API_KEY_HERE")

def scan_bulgaria_id():
    # Note: Supports JPG, PNG, WebP (Max 4.5MB)
    image_path = "bulgaria_lichna_karta.jpg"

    try:
        print(f"Scanning {image_path}...")
        result = client.scan_national_id(image_path)

        if result.get('success'):
            data = result['data']
            print("✅ Bulgaria Lichna Karta Extraction Successful!")
            
            # Basic Identity
            print(f"Region:      {data.get('country_code')}")
            print(f"Name:        {data.get('given_names')} {data.get('surname')}")
            print(f"ID Number:   {data.get('document_number')}")
            
            # Critical Local Field: EGN (ЕГН)
            print(f"EGN (ЕГН):   {data.get('personal_number')}")
            
            # Demographics
            print(f"DOB:         {data.get('date_of_birth')} ({data.get('sex')})")
            print(f"Address:     {data.get('address')}")
            
            # Extract TD1 MRZ Data
            additional = data.get('additional_fields', {})
            if additional.get('mrz_line_1'):
                print("\n🔍 MRZ Data Extracted & Validated:")
                print(f"Line 1: {additional.get('mrz_line_1')}")
                print(f"Line 2: {additional.get('mrz_line_2')}")
                print(f"Line 3: {additional.get('mrz_line_3')}")
        else:
            print(f"❌ Extraction Failed: {result.get('error')}")

    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    scan_bulgaria_id()

Technical Specs

  • Latency: < 4s (Average)
  • Uptime: 99.9% SLA
  • Security: AES-256 Encryption & SOC2 Compliant
  • Input: JPG, PNG, WebP (Max 4.5MB)
  • Output: JSON (Structured Data + MRZ Block)

Key Features

  • Native Cyrillic OCR: Perfectly captures Bulgarian Cyrillic characters seamlessly alongside Latin scripts, returning standardized Unicode.
  • EGN (ЕГН) Extraction: Automatically locates and formats the critical 10-digit Uniform Civil Number.
  • Hybrid VIZ + MRZ AI: Cross-validates unstructured visual data against cryptographic TD1 MRZ checksums for zero hallucination.
  • Smart Crop: Removes background noise and deskews rotated images automatically, ideal for user-submitted mobile photos.

JSON Response Example

The SDK returns a Python dictionary containing the parsed visual data (VIZ) in Cyrillic, the EGN, and the raw Machine-Readable Zone (MRZ) block.

{
  "success": true,
  "data": {
    "type": "national_id",
    "country_code": "BGR",
    "nationality": "БЪЛГАРИЯ",
    "document_number": "640123456",
    "card_series": "",
    "personal_number": "9005151234",
    "surname": "ИВАНОВ",
    "given_names": "ДИМИТЪР",
    "sex": "M",
    "date_of_birth": "1990-05-15",
    "place_of_birth": "СОФИЯ",
    "address": "ж.к. Младост 1, бл. 10, вх. А, ап. 3, София",
    "date_of_issue": "2020-01-01",
    "date_of_expiry": "2030-01-01",
    "issuing_authority": "МВР София",
    "additional_fields": {
      "tramite_number": null,
      "mrz_line_1": "IDBGR6401234560<<<<<<<<<<<<<<<",
      "mrz_line_2": "9005156M3001018BGR<<<<<<<<<<<4",
      "mrz_line_3": "IVANOV<<DIMITAR<<<<<<<<<<<<<<<"
    }
  }
}

Frequently Asked Questions

Does the SDK validate the MRZ on the back of the Bulgarian Lichna karta?

Yes. Our engine extracts the TD1 format MRZ lines and runs the ICAO 9303 checksum verification (modulus 10 with 7-3-1 weighting) on the document number and date of birth to ensure data integrity.

Can it extract the EGN (ЕГН)?

Absolutely. The models natively target the 10-digit EGN (Uniform Civil Number) required for official database verification in Bulgaria, mapping it to the `personal_number` field.

Does it support Cyrillic characters?

Yes, our OCR engine is fully optimized for Bulgarian Cyrillic typography. It simultaneously processes both Bulgarian and English text, outputting clean, standardized Unicode strings without encoding errors.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Bulgaria Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Bulgaria passports with a server-side integration.

Python · Passport
Country Tutorial

Senegal Carte d'Identité CEDEAO OCR Python SDK

Python Tutorial: Automate KYC in Senegal. Extract data from Carte d'Identité CEDEAO using StructOCR Python SDK. Supports native text and MRZ extraction.

Python · carte d'identité cedeao
Country Tutorial

Morocco Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Morocco passports with a server-side integration.

Python · Passport
Country Tutorial

UAE Emirates ID OCR Python SDK

Python Tutorial: Automate KYC in the UAE. Extract data from Emirates ID using the StructOCR Python SDK. Supports bilingual (Arabic/English) text, front/back sides, and 3-line MRZ extraction.

Python · emirates id
Country Tutorial

Ukraine Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Ukraine passports with a server-side integration.

Python · Passport
Country Tutorial

Germany Personalausweis OCR Python SDK

Python Tutorial: Automate KYC in Germany. Extract data from Personalausweis and validate TD1 MRZ using StructOCR Python SDK. Supports native German text.

Python · personalausweis
Country Tutorial

Vietnam Passport OCR with Python SDK

Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Vietnam passports with a server-side integration.

Python · Passport
Country Tutorial

Uzbekistan ID Karta OCR Python SDK

Python Tutorial: Automate KYC in Uzbekistan. Extract data from ID Karta using StructOCR Python SDK. Supports native text and MRZ parsing.

Python · id karta
Country Tutorial

Vietnam CCCD OCR Python SDK

Python Tutorial: Automate KYC in Vietnam. Extract data from the Vietnamese Identity Card (Căn cước công dân / CCCD) using StructOCR Python SDK. Supports native text, diacritics, and MRZ extraction.

Python · cccd
Country Tutorial

Vietnam Passport OCR with Node.js SDK

Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Vietnam passports.

Node.js · Passport

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime 99.9% Uptime