Skip to content

Commit b4c404a

Browse files
author
regula-bot
committed
Merge remote-tracking branch 'origin/stable'
2 parents 0c0e66f + 728ac84 commit b4c404a

File tree

304 files changed

+24537
-37598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+24537
-37598
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/run-smoke-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Python
1616
uses: actions/setup-python@v2
1717
with:
18-
python-version: 3.8
18+
python-version: 3.9
1919
- name: Install pipenv
2020
run: |
2121
python -m pip install --upgrade pip
@@ -27,4 +27,3 @@ jobs:
2727
working-directory: example
2828
env:
2929
API_BASE_PATH: "https://nightly-api.regulaforensics.com"
30-
TEST_LICENSE: ${{secrets.TEST_LICENSE}}

.openapi-generator-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ README.md
1111
.gitignore
1212
setup.py
1313
regula/documentreader/webclient/__init__.py
14+
pyproject.toml
15+
.github/workflows/python.yml

.openapi-generator/FILES

Lines changed: 100 additions & 23 deletions
Large diffs are not rendered by default.

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
7.13.0

Pipfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ name = "pypi"
66
[packages]
77
certifi = ">=2024.07.04"
88
six = ">=1.10"
9-
python-dateutil = ">=2.5.3"
10-
urllib3 = ">=1.26.19"
9+
python-dateutil = ">=2.8.2"
10+
urllib3 = ">=1.25.3, <3.0.0"
1111
vistir = ">=0.4.0, <=0.6.1"
1212
idna = "==3.7"
13-
requests = ">=2.32.3"
13+
requests = ">=2.32.4"
14+
pydantic = ">=2"
15+
typing-extensions = ">=4.7.1"
1416

1517
[dev-packages]
16-
setuptools = "==74.1.1"
1718
wheel = "*"
1819
twine = "*"
1920
chardet = "*"
2021
packaging = ">=22.0"
22+
types-python-dateutil = ">=2.8.19.14"
23+
mypy = ">=1.5"
24+
setuptools = "==78.1.1"
2125

2226
[requires]
23-
python_version = "3.8"
27+
python_version = "3.9"

Pipfile.lock

Lines changed: 529 additions & 274 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Regula Document Reader web API Python 3.8+ client
1+
# Regula Document Reader web API Python 3.9+ client
22

33
[![pypi](https://img.shields.io/pypi/v/regula.documentreader.webclient?style=flat-square)](https://support.regulaforensics.com/hc/en-us/articles/115000916306-Documentation)
44
[![OpenAPI](https://img.shields.io/badge/OpenAPI-defs-8c0a56?style=flat-square)](https://github.com/regulaforensics/DocumentReader-web-openapi)

dev.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
11
# Development
22

3-
To regenerate models, clone [latest OpenAPI definitions](https://github.com/regulaforensics/DocumentReader-web-openapi)
4-
and use next command from the project root:
3+
Models generation based on [openapi spec](https://github.com/regulaforensics/DocumentReader-api-openapi).
4+
5+
## Generation
6+
7+
To regenerate models from openapi definition,
8+
clone [latest open api definitions](https://github.com/regulaforensics/DocumentReader-api-openapi)
9+
and use next command from the project root.
510
```bash
611
./update-models.sh
712
```
13+
14+
## Generator configuration Features
15+
16+
1. When generating oneOf schemas, the generator creates its
17+
own abstract class, which does not look like it would like.
18+
The problem was solved by replacing the abstract generator
19+
class with ours using typeMappings in the generator config.
20+
2. The generator treats the discriminator value as a string,
21+
but in our case it's numbers. To solve this problem, changes
22+
have been made to the model_generic.mustache template.
23+
24+
## Problem solving
25+
26+
To solve new problems, use the generator
27+
settings ([python](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/python.md),
28+
[common](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md))
29+
and [templates](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/python).
30+
31+
**Do not edit the generated files! They will be overwritten after generation!**

example/README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Regula Document Reader web API Python 3.5+ client
1+
# Regula Document Reader web API Python 3.9+ client
22

33
:bulb: Before you start: if you just want to play with an online demo, visit our [playground](https://api.regulaforensics.com).
44

@@ -10,15 +10,15 @@ you agree with our [Privacy Policy](https://regulaforensics.com/en/company/priva
1010
and [License Agreement](https://downloads.regulaforensics.com/work/SDK/doc/Eula.pdf).
1111

1212
Requirements:
13-
- installed python 3.5 or higher
13+
- installed python 3.9 or higher
1414
- installed [pip](https://pip.pypa.io/en/stable/installing/)
1515

1616
Verify Python and pip versions:
1717
```bash
1818
python --version
19-
> Python 3.8.2
19+
> Python 3.9.2
2020
pip --version
21-
> pip 20.2.1 from /home/user/.local/lib/python3.8/site-packages/pip (python 3.8)
21+
> pip 22.0.4 from /home/user/.local/lib/python3.9/site-packages/pip (python 3.9)
2222
```
2323

2424
Cloning example:
@@ -54,16 +54,29 @@ API_BASE_PATH="http://127.0.0.1:8080" python example.py
5454
```
5555

5656
### Output
57+
5758
This sample generates the following text output:
59+
5860
```text
5961
---------------------------------------------------------------------------
60-
Document Overall Status: not valid
61-
Document Number Visual: OO0000000
62-
Document Number MRZ: OO0000000
63-
Validity Of Document Number Visual: 0
64-
Validity Of Document Number MRZ: 0
65-
MRZ-Visual values comparison: 1
62+
Web API version: 7.5.308602.1848
6663
---------------------------------------------------------------------------
64+
Document Overall Status: not valid
65+
Document Number Visual: C01YPTNHM
66+
Document Type: Germany - ePassport (2017) Service
67+
Validity Of Document Number Visual: 2
68+
69+
-----------------------All Text Fields------------------------
70+
Source: Surname, Value: MUSTERMANN
71+
Source: Surname And Given Names, Value: MUSTERMANN ERIKA
72+
Source: Document Status, Value: SPECIMEN
73+
Source: Surname, Value: MUSTERMANN
74+
Source: Surname And Given Names, Value: MUSTERMANN ERIKA
75+
Source: Document Number Checkdigit, Value: 1
76+
Source: Document Class Code, Value: PO
77+
78+
...
6779
```
80+
6881
Also, it stores [portrait](portrait.jpg) and [document image](document-image.jpg) images in the current folder.
6982
You can modify [this example](../example/example.py) and re-run it to get your own results.

0 commit comments

Comments
 (0)