PHPackages                             keyvan/german-ocr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. keyvan/german-ocr

ActiveLibrary

keyvan/german-ocr
=================

High-performance German document OCR - Local &amp; Cloud API

7505PythonCI failing

Since Mar 19Pushed 2mo agoCompare

[ Source](https://github.com/Keyvanhardani/german-ocr)[ Packagist](https://packagist.org/packages/keyvan/german-ocr)[ RSS](/packages/keyvan-german-ocr/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)DependenciesVersions (1)Used By (0)

 [![German-OCR Logo](docs/icon.png)](docs/icon.png)

German-OCR
==========

[](#german-ocr)

 **High-performance German document OCR - Local &amp; Cloud**

 [![PyPI version](https://camo.githubusercontent.com/d86d07d942da8015c495845a3238e00bc5884ac650b8d4679900ba9044503ccf/68747470733a2f2f62616467652e667572792e696f2f70792f6765726d616e2d6f63722e737667)](https://pypi.org/project/german-ocr/) [![npm version](https://camo.githubusercontent.com/23093c3095a70f168d69080b770078e442d05a1f22615e5231f65e2036ef8715/68747470733a2f2f62616467652e667572792e696f2f6a732f6765726d616e2d6f63722e737667)](https://www.npmjs.com/package/german-ocr) [![Packagist](https://camo.githubusercontent.com/a47318403539a9ff1181d6fbe9867d06e9326ec58f5384993dd90d206e69f2ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b657976616e2f6765726d616e2d6f6372)](https://packagist.org/packages/keyvan/german-ocr) [![License](https://camo.githubusercontent.com/a549a7a30bacba7bfceebdc207a8e86c3f2c02995a2527640dca30048fd2b64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c75652e737667)](https://opensource.org/licenses/Apache-2.0) [![Cloud API](https://camo.githubusercontent.com/c3db34478d4f18915798c21959177b2f84c0db4b14687872de511857553a5a71/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436c6f75642d4150492d677265656e)](https://app.german-ocr.de)

 [![Hugging Face](https://camo.githubusercontent.com/ded76f9b0573da29b943622a40aa42b74d5d7f5574f167d82ffa44878de2ff4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652ff09fa49725323048756767696e67253230466163652d4d6f64656c732d79656c6c6f77)](https://huggingface.co/Keyven) [![Ollama](https://camo.githubusercontent.com/6d59fdb655d359d57759aa95ca59715b4cdf7eb578757481829e5d6fb1dd0160/68747470733a2f2f696d672e736869656c64732e696f2f62616467652ff09fa6992532304f6c6c616d612d4d6f64656c732d626c7565)](https://ollama.com/Keyvan) [![llama.cpp](https://camo.githubusercontent.com/1e8e4cf54c886bd6c558fcf5be16f13cb893b2e92164dd1b581b89885823cf39/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6c616d612e6370702d474755462d6f72616e6765)](https://camo.githubusercontent.com/1e8e4cf54c886bd6c558fcf5be16f13cb893b2e92164dd1b581b89885823cf39/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6c616d612e6370702d474755462d6f72616e6765)

---

🚀 Supported Backends
--------------------

[](#-supported-backends)

 [ ![Hugging Face](https://camo.githubusercontent.com/ec801398cdae083f9c3a349f535455258e31c7f7a7b252626ab60f7f2f822cac/68747470733a2f2f68756767696e67666163652e636f2f66726f6e742f6173736574732f68756767696e67666163655f6c6f676f2d6e6f626f726465722e737667) ](https://huggingface.co/Keyven) [ ![Ollama](https://camo.githubusercontent.com/a07b906d6c455840ca72fefbc46eab4f1eb9824d3ac09e8f15d7f7a52d98f058/68747470733a2f2f6f6c6c616d612e636f6d2f7075626c69632f6f6c6c616d612e706e67) ](https://ollama.com/Keyvan) [ ![llama.cpp](https://user-images.githubusercontent.com/1991296/230134379-7181e485-c521-4d23-a0d6-f7b3b61ba524.png) ](https://github.com/ggerganov/llama.cpp)

 **Hugging Face** • **Ollama** • **llama.cpp**

---

✨ Features
----------

[](#-features)

FeatureLocalCloud (v1)Cloud (v2)**German Documents**Invoices, contracts, formsAll document typesStructured extraction**Output Formats**Markdown, JSON, textJSON, Markdown, text, n8nTyped JSON fields**PDF Support**Images onlyUp to 50 pagesUp to 50 pages**Privacy**100% localDSGVO-konform (Frankfurt)DSGVO-konform (Frankfurt)**Speed**~5s/page~2-3s/page (async)Instant (synchronous)**Backends**Ollama, llama.cpp, HuggingFaceCloud APICloud API**Hardware**CPU, GPU, NPU (CUDA/Metal/Vulkan/OpenVINO)ManagedManaged📦 Installation
--------------

[](#-installation)

### Python

[](#python)

```
pip install german-ocr
```

### Node.js

[](#nodejs)

```
npm install german-ocr
```

### PHP

[](#php)

```
composer require keyvan/german-ocr
```

---

⚡ Quick Start
-------------

[](#-quick-start)

### Option 1: ☁️ Cloud API (Recommended)

[](#option-1-️-cloud-api-recommended)

No GPU required. Get your API credentials at [app.german-ocr.de](https://app.german-ocr.de)

```
from german_ocr import CloudClient

# API Key + Secret (Secret is only shown once at creation!)
client = CloudClient(
    api_key="gocr_xxxxxxxx",
    api_secret="your_64_char_secret_here"
)

# Simple extraction
result = client.analyze("invoice.pdf")
print(result.text)

# Structured JSON output
result = client.analyze(
    "invoice.pdf",
    prompt="Extrahiere Rechnungsnummer und Gesamtbetrag",
    output_format="json"
)
print(result.text)
```

### Node.js

[](#nodejs-1)

```
const { GermanOCR } = require('german-ocr');

const client = new GermanOCR(
    process.env.GERMAN_OCR_API_KEY,
    process.env.GERMAN_OCR_API_SECRET
);

const result = await client.analyze('invoice.pdf', {
    model: 'german-ocr-ultra'
});
console.log(result.text);
```

### PHP

[](#php-1)

```
