semvec/pypi-packages huggingface dataset:
sberbank-async-cryptography 1.0.0
Python implementation of Sberbank signature verification (using async cryptography).
License: MIT

# Sberbank signature verification using async cryptography

The code of keys generation and message signing and signature verification is universal, 
it is not only Sberbank-compatible. You can use it for your own purposes. 
However there is a `sberbank_tools` module that consist sberbank-specific functions.
 
The repo is open for pull requests. The author will be glad to hear some good feedback from you.
 
## Python version

Python version that has been used while coding is 3.8. Other versions has not been tested but they might work.

## Installation

```bash
pip install -i sberbank_callback_async_cryptography
```

## Flask example

```python
import os
from dotenv import load_dotenv

from flask import request
from flask_restful import Resource
from sb_async_cryptography.sberbank_tools import verify_signature, params_get_checksum
from sb_async_cryptography.signature import public_key_import_from_x509_certificate_file

load_dotenv()
SBERBANK_PUBLIC_KEY_FILE = os.getenv('SBERBANK_PUBLIC_KEY_FILE')
pub_key = public_key_import_from_x509_certificate_file(SBERBANK_PUBLIC_KEY_FILE)


class Notification(Resource):

    def get(self):
        """Status change notification from Sberbank"""
        params = request.args
        signature = params_get_checksum(params)
        if not verify_signature(pub_key, signature, params):
            return {"errors": "Signature verification failed."}, 400
        
        # some other code here
```

## FastAPI example

```python
import os
from dotenv import load_dotenv

from fastapi import Request
from sb_async_cryptography.sberbank_tools import verify_signature, params_get_checksum
from sb_async_cryptography.signature import public_key_import_from_x509_certificate_file
from starlette.responses import JSONResponse

load_dotenv()
SBERBANK_PUBLIC_KEY_FILE = os.getenv('SBERBANK_PUBLIC_KEY_FILE')
pub_key = public_key_import_from_x509_certificate_file(SBERBANK_PUBLIC_KEY_FILE)


async def notification(request: Request):
    """Status change notification from Sberbank"""
    params = dict(request.query_params)
    signature = params_get_checksum(params)
    if not verify_signature(pub_key, signature, params):
        return JSONResponse(status_code=400, content={"errors": "Signature verification failed."})
    
    # some other code here
```
rld 0.1.1
A development tool for evaluation and interpretability of reinforcement learning agents.
License: MIT
Requires Python: >=3.7,<4.0
Keywords: reinforcement learning,development-tools,debugging-tools,interpretability

# ![rld logo](https://imgur.com/XlDt5Hi.png)

![Build and test](https://github.com/iamhatesz/rld/workflows/Build%20and%20test/badge.svg)

A development tool for evaluation and interpretability of reinforcement learning agents.

![rld demo gif](https://imgur.com/hodTIcj.gif)

## Installation

```bash
pip install rld
```

## Usage

Firstly, calculate attributations for your rollout using:

```bash
rld attribute [--rllib] [--out <ROLLOUT>] config.py <INPUT_ROLLOUT>
```

This will take `INPUT_ROLLOUT` (possibly in the Ray RLlib format, if `--rllib` is set)
and calculate attributations for each timestep in each trajectory,
using the configuration stored in `config.py`.
The output file will be stored as `ROLLOUT`.
See the `Config` class for possible configuration.

Once the attributations are calculated, you can visualize them using:

```bash
rld start --viewer <VIEWER_ID> <ROLLOUT>
```

See the [examples](./examples) for reference.

## Description

rld provides a set of tools to evaluate and understand behaviors of reinforcement
learning agents. Under the hood, rld uses [Captum](https://captum.ai/) to calculate
attributations of observation components. rld is also integrated with
[Ray RLlib](https://ray.io/) library and allows to load agents trained in RLlib.

### Current limitations

rld is currently in its early development stage, thus the functionality is very limited.

#### RL algorithms

rld is algorithm-agnostic, but currently it is more suitable for policy-based methods.
This is due to the fact that the `Model` is now expected to output logits for a given
observation. This, however, will change in the future, and rld will support more
algorithms.

#### Viewers

This is the list of viewers, which ship with rld:
* `none`
* `cartpole`
* `atari`

You can easily create your own viewer, for your own environment, but to make it visible
for rld, you have to rebuild the project. This will be improved in the future.

#### Observation and action spaces

The table below presents currently supported observation and action spaces.

<table>
    <tr>
        <td></td>
        <td></td>
        <td colspan="2"><strong>Action space</strong></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td>Discrete</td>
        <td>MultiDiscrete</td>
    </tr>
    <tr>
        <td rowspan="3"><strong>Obs space</strong></td>
        <td>Box</td>
        <td>:heavy_check_mark:</td>
        <td>:heavy_check_mark:</td>
    </tr>
    <tr>
        <td>Dict</td>
        <td>:heavy_check_mark:</td>
        <td>:heavy_check_mark:</td>
    </tr>
</table>

## Roadmap

See the [issues](https://github.com/iamhatesz/rld/issues) page to see the list of
features planned for the future releases. If you have your own ideas,
you are encouraged to post them there.