Skip to main content

Python websocket client for reading Gulf IDs

Project description

Read Gulf ID card data

Python package that interfaces with the Gulf ID and EID card reader service. It uses websocket to connect to the service installed on the host machine where a USB smart card reader is connected.

Usage

  • Install the card reader service on a windows machine
  • Ensure the services are running
  • Get the IP of the machine
import aiohttp
from gulf_id_scanner import Client, ServiceError

session = aiohttp.ClientSession()
client = Client(host="192.168.3.45", web_session=session)
# validate connection
try:
    await client.connect()
except ServiceError as err:
    return False

# read card data
try:
  card_data = client.async_read_card():
    # code to process returned card data
except ServiceError as err:
    return
# detect when card is inserted and read card data
try:
  async for card_data in client.async_detect_card():
    # code to process returned card data
except ServiceError as err:
    return
await session.close()

Card Data

The CardData class provides the main card data fields that are commonly required when reading the ID. For more specific fields you can find all the data fields retrived from CardData.card_data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gulf_id_scanner-0.1.0b2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

gulf_id_scanner-0.1.0b2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file gulf_id_scanner-0.1.0b2.tar.gz.

File metadata

  • Download URL: gulf_id_scanner-0.1.0b2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.11 Linux/5.15.123.1-microsoft-standard-WSL2

File hashes

Hashes for gulf_id_scanner-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 03fceefd023512519b122b49e506cd2377d00d0583f2244de52f9af0c7d8d230
MD5 e07cd1918fac5bf2dacb9b46993a380e
BLAKE2b-256 9ca0a793f034b7e446ef4332680375cfae8735c3b0e72879a3151bdadf743ee9

See more details on using hashes here.

File details

Details for the file gulf_id_scanner-0.1.0b2-py3-none-any.whl.

File metadata

  • Download URL: gulf_id_scanner-0.1.0b2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.11 Linux/5.15.123.1-microsoft-standard-WSL2

File hashes

Hashes for gulf_id_scanner-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 398c9b6e068b9ae2afac71fce543a1a018f2d926ec236e5f4518d077d6e3d01d
MD5 e3861754d6dc87ac200ffaa665430e7b
BLAKE2b-256 42edfe180a6be4d31c748f9f94bd7241a7b9507e36da2b922ddc4a8cb759178b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page