Skip to main content

basylic-python-client

Module to access Basylic API.

Summary

Developed by ETAONIS, Basylic is a SaaS solution performing document fraud detection with "state-of-the-art" performances. The solution is also used as a powerful tool to extract information from documents. This module provides a Python interface for accessing Basylic.

Installation

This module is available on PyPI. You can install it with pip command:

pip install basylic

Alternatively, you can access the module source code on GitHub:

Basic usage

To access the API, refresh and access tokens should be provided. You can access your Refresh token via the Portal interface. Then, we recommend you store its value in the environment variable BASYLIC_REFRESH_TOKEN.

from basylic import Basylic
basylic = Basylic()

Alternatively, if your refresh token is stored in a non-standard location, you can specify its value with argument refresh_token during class instantiation:

from basylic import Basylic
basylic = Basylic(refresh_token=...)
  1. At least two arguments should be set: one of file_path, file_obj or ftp_file, and document_type:
basylic.send_document(file_path="corinne-berthier-recto-verso.pdf", document_type="french_ids")
  • The file_path argument is a string with the document path (e.g.: "~/FILE.pdf")
  • document_type is a string specifying which Basylic API to call (e.g.: "french_ids")

Possible values for document_type are: 'french_ids', 'rib', 'ri', 'avis-imposition'...

With those arguments specified, send_document returns a comprehensive JSON document.

  1. Data about applicants can also be joined to the API call:
applicants_information = {"applicant_0": {"identity": "BERTHIER CORINNE"}}
basylic_result = basylic.send_document(
    file_path="corinne-berthier-recto-verso.pdf",
    document_type="french_ids", applicants_information=applicants_information)
print(basylic_result)
  1. And various arguments could be passed as kwargs. For example:
  • a. save_report=True will save the result of your request in your user space on Basylic Portal;
  • b. with_image=True will return a base64 image for each recognised document;

For example, this code:

applicants_information = {"applicant_0": {"identity": "BERTHIER CORINNE"}}
basylic_result = basylic.send_document(
    file_path="corinne-berthier-recto-verso.pdf",
    document_type="french_ids", applicants_information=applicants_information,
    with_image=True, save_report=True)
print(basylic_result)

will act in the following way:

  1. Uploads of document whose path is file_path to Basylic service french_ids;
  2. Produces of a JSON document basylic_result with all relevant information;
  3. Compares identity provided and identity extracted by Basylic OCR;
  4. A base64 encoded image will be returned in the approriate key of basylic_result.

Metadata

Release files for basylic 0.22.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for basylic 0.22.0
File Size Uploaded
basylic-0.22.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for basylic 0.22.0
File Interpreter ABI Platform
basylic-0.22.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / basylic-0.22.0.tar.gz

Download URL basylic-0.22.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1ecdca05a71c9d805473342a5fbadda5af42b821aa2ef80b81cf19b51972d9bd
BLAKE2b-256 checksum
How to use checksums
2a99bfc977bb1188855ef939d0e056849124e6355159c6fddbbc6feec9d1a449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / basylic-0.22.0-py3-none-any.whl

Download URL basylic-0.22.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab12feb2b9c8cc149453badb73a6b375c98b4e2cdc17817a0a9143fe955f350f
BLAKE2b-256 checksum
How to use checksums
f2444400741a87eecd518ee3eb14fcb636d1fbe7672f3627cb175518e9c5158e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.22.0 This release

2 release files

0.21.1

1 release file

0.21.0

1 release file

0.20.8

1 release file

0.20.7

1 release file

0.20.6

1 release file

0.20.5

1 release file

0.20.4

1 release file

0.20.3

1 release file

0.20.2

1 release file

0.20.1

1 release file

0.20

1 release file

0.12.7

1 release file

0.12.6

1 release file

0.12.5

1 release file

0.12.3

1 release file

0.12.2

1 release file

0.12.1

1 release file

0.12

1 release file

0.11

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page