Metadata-Version: 2.1
Name: data-grid-surface
Version: 1.1.0
Summary: SDK to communicate with data-grid API
License: MIT
Keywords: data,grid,surface,breach
Author: DataGrid Dev Team
Author-email: dev@datagridsurface.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: requests (>=2.25.1,<3.0.0)
Description-Content-Type: text/markdown


# 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

**Use example:**

```
from data_grid_surface.data_grid import DataGrid

dg = DataGrid(
    username='testuser', 
    password='testpassword'
)
res = dg.check_email('email@example.com', False)
```

```
res = dg.check_password('passwordexample', False)
```

**Response:**

```
{
    'status': 'success', 
    'data': {
        'exposed': True|False
    }
}
```
