Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

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

:warning: NOTE: for some systems `python3` and `pip3` commands should be used, instead of `python` and `pip`.
:warning: NOTE: for some systems, `python3` and `pip3` commands should be used instead of `python` and `pip`.

:warning: NOTE: If a custom Document Reader endpoint is not specified, demo web API will be used by default.
By sending requests to demo Regula Document Reader web API,
you agree with our [Privacy Policy](https://api.regulaforensics.com/terms)
and [License Agreement](https://downloads.regulaforensics.com/work/SDK/doc/Eula.pdf).

Requirements:
- installed python 3.5 or higher
Expand All @@ -27,31 +32,29 @@ Setup project and download dependencies:
pip install -e ./
```

### Running with local Regula Document Reader web API installation
### Running the client with demo Regula Document Reader web API

Follow [the instructions](https://docs.regulaforensics.com/web/quick-start-guide) to run Regula Document Reader web API.
Assuming you have successfully launched instance, use next line command to run example:
Execute example:
```bash
cd example
python example.py

# If Regula Document Reader web API is running not on localhost, specify host via env variable:
API_BASE_PATH="http://192.168.0.101:8080" python example.py
```

### Running using Regula Document Reader web API test SaaS
### Running the client with local Regula Document Reader web API installation

Get your [free trial here](https://mobile.regulaforensics.com/). You should obtain `regula.license` file.
Copy it to **example** folder. You are ready for running!
Get your [free trial here](https://mobile.regulaforensics.com/). When you receive the `regula.license` file,
copy it to the [example](../example) folder. Now you are ready for start!

Follow [the instructions](https://docs.regulaforensics.com/web/quick-start-guide) to run Regula Document Reader web API.
If the instance has been launched successfully, use the following line command to run the example:

Execute example:
```bash
cd example
API_BASE_PATH="https://test-api.regulaforensics.com" python example.py
API_BASE_PATH="http://127.0.0.1:8080" python example.py
```

### Output
This sample generates next text output:
This sample generates the following text output:
```text
---------------------------------------------------------------------------
Document Overall Status: not valid
Expand All @@ -62,5 +65,6 @@ This sample generates next text output:
MRZ-Visual values comparison: 1
---------------------------------------------------------------------------
```
Also, it creates [portrait](portrait.jpg) and [document image](document-image.jpg) pictures inside current folder.
Edit on your own [example.py](./example.py), and re-run to see your results.
Also, it stores [portrait](portrait.jpg) and [document image](document-image.jpg) images in the current folder.
You can modify [this example](../example/src/main/java/com/regula/documentreader/webclient/example/Main.java)
and re-run it to get your own results.
14 changes: 7 additions & 7 deletions regula/documentreader/webclient/gen/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, host=None,
):
"""Constructor
"""
self._base_path = "http://localhost:8080" if host is None else host
self._base_path = "https://api.regulaforensics.com" if host is None else host
"""Default Base url
"""
self.server_index = 0 if server_index is None and host is None else server_index
Expand Down Expand Up @@ -384,17 +384,17 @@ def get_host_settings(self):
:return: An array of host settings
"""
return [
{
'url': "http://localhost:8080/",
'description': "Local on-premise installation",
},
{
'url': "https://api.regulaforensics.com/",
'description': "Regula document reader SaaS",
'description': "Latest stable Regula Document Reader demo endpoint",
},
{
'url': "https://test-api.regulaforensics.com/",
'description': "Regula document reader test SaaS",
'description': "Nightly Regula document reader demo endpoint",
},
{
'url': "http://localhost:8080/",
'description': "Local on-premise installation",
}
]

Expand Down