SDK to communicate with data-grid API
Project description
DATA-GRID-SURFACE
SDK to communicate with data-grid API service. It uses the API service and it's end-points to determine if the given emails or passwords have been compromised.
Installation
Install data-grid-surface SDK:
pip install data-grid-surface
Using data-grid-access sdk
Import DataGrid class from library
from data_grid_surface.data_grid import DataGrid
You will need to provide username and password parameters to DataGrid class constructor. These are credentials for data-grid API service.
NOTE: Passwords and emails are hashed with SHA256 algorithm before being sent to the API service.
DataGrid methods
DataGrid methods return dictionary as a result.
You can pass raw email/password or its hashed value. If you are passing hashed value you need to hash it with SHA256 algorithm and encode it in base64 format.
Methods:
-
check_email(email, is_hashed)
- email <String>
- is_hashed <Boolean> default value is True
-
check_password(password, is_hashed)
- password <String>
- is_hashed <Boolean> default value is True
-
check_phone_number(phone_number, is_hashed)
- phone_number <String>
- is_hashed <Boolean> default value is True
Use example:
from data_grid_surface.data_grid import DataGrid
dg = DataGrid(
username=<datagridapiusername>,
password=<datagridapipassword>
)
res = dg.check_email('email@example.com', False)
res = dg.check_password('passwordexample', False)
res = dg.check_phone_number('+38164....', False)
Response:
{
'status': 'success',
'data': {
'exposed': True|False,
'breach_source': 'facebook'
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for data_grid_surface-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b878c59eee5035de4b6eaafc16c0b415431564f9c4d58c0ba63e28064cb5e700 |
|
MD5 | 00b3e4143057a5bcd8698bc9c6652d23 |
|
BLAKE2b-256 | 86bc3d5169f835050c5feb04552f46b926037b736b4ac15347609a89e1fb6c81 |