Skip to main content

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


Download files

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

Source Distribution

data_grid_surface-1.2.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

data_grid_surface-1.2.0-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

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