Metadata-Version: 2.4
Name: faircom-json-action-client
Version: 0.0.1
Summary: A helper client for FairCom JSON Action API
Project-URL: Homepage, https://github.com/AdamJHowell/JsonActionClient
Author-email: Your Name <your.email@example.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: requests
Description-Content-Type: text/markdown

# JsonActionClient

A wrapper for the FairCom JSON Action API.

## Installation

```bash
pip install faircom-json-action-client
```

## Usage

### Example credential usage:

```Python
client = JsonActionClient( "http://127.0.0.1:8080/api" )
client.login( "admin", "ADMIN" )

with client:
    list_databases_json = {
        "api":       "db",
        "action":    "listDatabases",
        "params":    { },
        "authToken": client.auth_token
    }
    response = client.post_json( list_databases_json )
    print( f"Response: {json.dumps( response, indent = 3 )}" )
```

### Example client certificate usage:

```Python
client = JsonActionClient( "https://127.0.0.1:8444/api", ca_cert = "/FairCom/ca.crt", client_cert = "/FairCom/client.pem" )
client.login()

with client:
    list_databases_json = {
        "api":       "db",
        "action":    "listDatabases",
        "params":    { },
        "authToken": client.auth_token
    }
    response = client.post_json( list_databases_json )
    print( f"Response: {json.dumps( response, indent = 3 )}" )
```

## Location

https://github.com/AdamJHowell/JsonActionClient
