semvec/pypi-packages huggingface dataset:
django-release-tracker 0.2.0
Django app for syncing Heroku and Github releases.
License: MIT
Requires Python: >=3.10,<4.0

# Django Heroku Github Sync

Django app for syncing Heroku and Github releases.

## Version support

This app support Django 3.2+ and Python 3.10+.

## Background

If you deploy your application to Heroku, and you store your code in
Github, you can create automated Release notes in GH each time a release
is deployed to Heroku.

This uses Github's "[automatically generated release
notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)"
feature.

## How it works

The underlying principle is simple - it uses Github's REST API to create
a new repo release (with associated tag) for a specific commit as
identified by the Heroku API, using the Heroku release version number as
the tag.

The app uses Heroku's [App
Webhooks](https://devcenter.heroku.com/articles/app-webhooks)
`api:release` webhook, which receives updates each time a release is
created, or its status is updated. (The updates are important as a
release goes through various states, and is not released until the state
reaches `succeeded`). You can read more about the release webhook
payload
[here](https://devcenter.heroku.com/articles/app-webhooks#subscribing-to-webhooks-via-the-heroku-cli).

## Configuration

### Django

1. Add to `INSTALLED_APPS`
2. ...

### Heroku

You must create a new webhook subscription point at this app (wherever
you have it deployed).

### Github

You don't need to do anything to configure Github, but you do need to
give access to the API.

## Tests

#### Running tests

The tests themselves use `pytest` as the test runner. If you have
installed the `poetry` evironment, you can run them thus:

```
$ poetry run pytest
```

or

```
$ poetry shell
(release_tracker) $ pytest
```

The full suite is controlled by `tox`, which contains a set of
environments that will format, lint, and test against all support Python
+ Django version combinations.

```
$ tox
...
______________________ summary __________________________
  fmt: commands succeeded
  lint: commands succeeded
  mypy: commands succeeded
  py37-django22: commands succeeded
  py37-django32: commands succeeded
  py37-djangomain: commands succeeded
  py38-django22: commands succeeded
  py38-django32: commands succeeded
  py38-djangomain: commands succeeded
  py39-django22: commands succeeded
  py39-django32: commands succeeded
  py39-djangomain: commands succeeded
```

#### CI

There is a `.github/workflows/tox.yml` file that can be used as a
baseline to run all of the tests on Github.


### Heroku

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
csobclient 0.4.1
Library for communication with ČSOB API
License: MIT
Requires Python: >=3.7,<3.12

# CSOB client
Python library for communicating with ČSOB (<https://platbakartou.csob.cz/>) payment gateway API. The API is described here: <https://github.com/csob/paymentgateway>.

The library focuses on the v.1.9 but it is designed for extensibility.


## Installation
```bash
pip install csobclient
```

## Basic usage

### Client initialization
```python
from csobclient.v19 import Client

client = Client("merchantId", "merch_private.key", "csob.pub")
```

### Payment initialization
```python
from csobclient.v19 import Cart, CartItem

response = client.init_payment(
    order_no="2233823251",
    total_amount=100,
    return_url="http://127.0.0.1:5000/",
    cart=Cart([CartItem("Apples", 1, 100)]),
    merchant_data=b"Hello, World!",
)
```

### Get payment URL
```python
url = client.get_payment_process_url(pay_id)
```

### Process the gateway redirect
```python
payment_info = client.process_gateway_return(data_dict)
```

### Get payment status
```python
payment_info = client.get_payment_status(pay_id)
```

### Reverse payment
```python
response = client.reverse_payment(pay_id)
```

### Refund payment
```python
response = client.refund_payment(pay_id, amount=100)
```

### Exceptions handling
```python
from csobclient.v19 import APIError, HTTPRequestError

try:
    response = client.operation(...)
    response.raise_for_result_code()
except APIError as exc:
    # handle API error
except HTTPRequestError as exc:
    # handle HTTP error
except ValueError as exc:  # invalid params passed. Development error!
    # handle value error
```

It is also possible to check whether the API response is successful by checking the response.ok field:
```python
response = client.operation(...)
if not response.ok:
    # handle
```

### RSA keys management
The simples way to pass RSA keys is to pass their file paths:

```python
from csobclient.v19 import Client

client = Client("merchantId", "merch_private.key", "csob.pub")
```

The library will read the private key from the file when needed. The public key will be cached into the RAM.

If you want to change it, use special classes:

```python
from csobclient.v19 import Client, FileRSAKey, CachedRSAKey

client = Client("merchantId", FileRSAKey("merch_private.key"), FileRSAKey("csob.pub"))
```

You may also override the base RSAKey class to define your own key access strategy:

```python
from csobclient.v19 import RSAKey

class MyRSAKey(RSAKey):

    def __str__(self) -> str:
        return "my key"
```