pyenvoy


Namepyenvoy JSON
Version 0.3 PyPI version JSON
download
home_pagehttps://trisa.dev
SummaryAn API client for TRISA Envoy nodes that enables travel rule compliance.
upload_time2024-08-15 00:13:45
maintainerRotational Labs
docs_urlNone
authorRotational Labs
requires_python<4,>=3.10
licenseMIT
keywords travel rule trisa envoy api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyEnvoy

**A Python API client for [TRISA Envoy](https://trisa.dev/envoy/index.html) nodes**.

Envoy is a secure messaging tool designed for travel rule data exchanges, ensuring compliance using the [TRISA](https://trisa.io) (Travel Rule Information Sharing Architecture) and [TRP](https://www.openvasp.org/trp) (Travel Rule Protocol) protocols.

Virtual Asset Service Providers (VASPs) can deploy an Envoy node in order to interact with the compliance network using peer-to-peer messaging. The `pyenvoy` package allows VASPs to interact with their Envoy node programatically in Python so that they can:

- Manage users and API keys
- Manage customer accounts and counterparty information
- Create, view, and manage travel rule transactions
- Send and receive secure envelopes with counterparties
- Manage public keys on the node
- Manage the configuration of the node

The API allows users to treat Envoy as their boundary node to compliance networks, and integrate travel rule data exchanges with their transaction processing systems or internal compliance tools.

## Getting Started

You will need to deploy or host an Envoy node at a URL accessible by the client, then generate an API key and save the client ID and secret for the keys.

You can install PyEnvoy as follows:

```
$ pip install -U pyenvoy
```

Set the following environment variables:

1. `$ENVOY_URL`: the url of your Envoy API, e.g. `"https://myenvoy.tr-envoy.com/"`
2. `$ENVOY_CLIENT_ID`: the client ID of your API keys
3. `$ENVOY_CLIENT_SECRET`: the client secret for your API keys

If you're using the `connect()` function, you can also store these variables in a `.env` file in your current working directory.

Create an envoy client:

```python
from envoy import connect

envoy = connect()
```

This will create the client and load the environment variables. You can test your connection to the server:

```python
>>> envoy.status()
{'status': 'ok', 'uptime': '71h33m42.068692289s', 'version': '0.24.0-beta.28 (019fd7e)'}
```

Which should return the status, uptime, and version of your envoy node. Note that the `status` endpoint does not require authentication, so this will not check if your credentials are correct.

## REST Usage

The Envoy API is implemented as a [RESTful](https://en.wikipedia.org/wiki/REST) architecture. To that end, each resource in the API can generally be accessed with `list`, `create`, `detail`, `update`, and `delete` methods and may have other associated actions such as `send` for transactions. For example, to get a list of counterparties from the server you would use:

```python
envoy.counterparties.list()
```

Or to create a customer account you would:

```python
account_data = {...}
envoy.accounts.create(account_data)
```

All resources are named on the `envoy.Client` and are accessed as properties of the client; each of their methods can then be used to interact with the resource.

For advanced usage, note that the client also has `get`, `post`, `put`, and `delete` methods, in which you can directly make requests to the Envoy node.

## Error Handling

Envoy specific errors will be a subclass of `EnvoyError`. An `ServerError` is raised when the Envoy node returns a 500 status code, and a `ClientError` is raised when the node returns a 400 status code. `AuthenticationError` is returned when no api key credentials are specified or the Server returns a 401 or 403 status code.

Note that all API keys have a set of permissions that defines what actions they can take, if your API keys do not have the required permissions for an action, an `AuthenticationError` will be raised.

            

Raw data

            {
    "_id": null,
    "home_page": "https://trisa.dev",
    "name": "pyenvoy",
    "maintainer": "Rotational Labs",
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": "support@rotational.io",
    "keywords": "travel rule, trisa, envoy, api client",
    "author": "Rotational Labs",
    "author_email": "support@rotational.io",
    "download_url": "https://files.pythonhosted.org/packages/61/89/61364e812b5496f448e36b4b1c9556b3f831155f3f26cea4235bbe218267/pyenvoy-0.3.tar.gz",
    "platform": null,
    "description": "# PyEnvoy\n\n**A Python API client for [TRISA Envoy](https://trisa.dev/envoy/index.html) nodes**.\n\nEnvoy is a secure messaging tool designed for travel rule data exchanges, ensuring compliance using the [TRISA](https://trisa.io) (Travel Rule Information Sharing Architecture) and [TRP](https://www.openvasp.org/trp) (Travel Rule Protocol) protocols.\n\nVirtual Asset Service Providers (VASPs) can deploy an Envoy node in order to interact with the compliance network using peer-to-peer messaging. The `pyenvoy` package allows VASPs to interact with their Envoy node programatically in Python so that they can:\n\n- Manage users and API keys\n- Manage customer accounts and counterparty information\n- Create, view, and manage travel rule transactions\n- Send and receive secure envelopes with counterparties\n- Manage public keys on the node\n- Manage the configuration of the node\n\nThe API allows users to treat Envoy as their boundary node to compliance networks, and integrate travel rule data exchanges with their transaction processing systems or internal compliance tools.\n\n## Getting Started\n\nYou will need to deploy or host an Envoy node at a URL accessible by the client, then generate an API key and save the client ID and secret for the keys.\n\nYou can install PyEnvoy as follows:\n\n```\n$ pip install -U pyenvoy\n```\n\nSet the following environment variables:\n\n1. `$ENVOY_URL`: the url of your Envoy API, e.g. `\"https://myenvoy.tr-envoy.com/\"`\n2. `$ENVOY_CLIENT_ID`: the client ID of your API keys\n3. `$ENVOY_CLIENT_SECRET`: the client secret for your API keys\n\nIf you're using the `connect()` function, you can also store these variables in a `.env` file in your current working directory.\n\nCreate an envoy client:\n\n```python\nfrom envoy import connect\n\nenvoy = connect()\n```\n\nThis will create the client and load the environment variables. You can test your connection to the server:\n\n```python\n>>> envoy.status()\n{'status': 'ok', 'uptime': '71h33m42.068692289s', 'version': '0.24.0-beta.28 (019fd7e)'}\n```\n\nWhich should return the status, uptime, and version of your envoy node. Note that the `status` endpoint does not require authentication, so this will not check if your credentials are correct.\n\n## REST Usage\n\nThe Envoy API is implemented as a [RESTful](https://en.wikipedia.org/wiki/REST) architecture. To that end, each resource in the API can generally be accessed with `list`, `create`, `detail`, `update`, and `delete` methods and may have other associated actions such as `send` for transactions. For example, to get a list of counterparties from the server you would use:\n\n```python\nenvoy.counterparties.list()\n```\n\nOr to create a customer account you would:\n\n```python\naccount_data = {...}\nenvoy.accounts.create(account_data)\n```\n\nAll resources are named on the `envoy.Client` and are accessed as properties of the client; each of their methods can then be used to interact with the resource.\n\nFor advanced usage, note that the client also has `get`, `post`, `put`, and `delete` methods, in which you can directly make requests to the Envoy node.\n\n## Error Handling\n\nEnvoy specific errors will be a subclass of `EnvoyError`. An `ServerError` is raised when the Envoy node returns a 500 status code, and a `ClientError` is raised when the node returns a 400 status code. `AuthenticationError` is returned when no api key credentials are specified or the Server returns a 401 or 403 status code.\n\nNote that all API keys have a set of permissions that defines what actions they can take, if your API keys do not have the required permissions for an action, an `AuthenticationError` will be raised.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An API client for TRISA Envoy nodes that enables travel rule compliance.",
    "version": "0.3",
    "project_urls": {
        "Documentation": "https://trisa.dev",
        "Download": "https://github.com/trisacrypto/pyenvoy/tarball/v0.3",
        "Homepage": "https://trisa.dev",
        "Source": "https://github.com/trisacrypto/pyenvoy",
        "Tracker": "https://github.com/trisacrypto/pyenvoy/issues"
    },
    "split_keywords": [
        "travel rule",
        " trisa",
        " envoy",
        " api client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a4832563f2b04176f7426007481377160670a71820cd7d7c4eee2c765b5987e",
                "md5": "190f4345654a6749db9e89c7ee3047f2",
                "sha256": "83d5e3ac7500d545eef05dd380152d60f755ab094e1484b68f118624a205f693"
            },
            "downloads": -1,
            "filename": "pyenvoy-0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "190f4345654a6749db9e89c7ee3047f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.10",
            "size": 16899,
            "upload_time": "2024-08-15T00:13:43",
            "upload_time_iso_8601": "2024-08-15T00:13:43.711287Z",
            "url": "https://files.pythonhosted.org/packages/1a/48/32563f2b04176f7426007481377160670a71820cd7d7c4eee2c765b5987e/pyenvoy-0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "618961364e812b5496f448e36b4b1c9556b3f831155f3f26cea4235bbe218267",
                "md5": "f2cb3a359054ee65c377b784b9d14bd8",
                "sha256": "2bc311fd31b7700530ba68d736f90295f509d0a5363793373eaa0a4b5201ef43"
            },
            "downloads": -1,
            "filename": "pyenvoy-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f2cb3a359054ee65c377b784b9d14bd8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 19881,
            "upload_time": "2024-08-15T00:13:45",
            "upload_time_iso_8601": "2024-08-15T00:13:45.041071Z",
            "url": "https://files.pythonhosted.org/packages/61/89/61364e812b5496f448e36b4b1c9556b3f831155f3f26cea4235bbe218267/pyenvoy-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-15 00:13:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "trisacrypto",
    "github_project": "pyenvoy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pyenvoy"
}
        
Elapsed time: 0.37429s