semvec/pypi-packages huggingface dataset:
srelogging 0.0.3
Common logging functions for SRE python scripts.
Requires Python: >=3.6
Keywords: sre logging



<div align="center" style="text-align:center">

# SRE Logging

Common logging setup package for SRE python programs.

If you have a Python
program that's gonna be anywhere near production, or is in any way
'mission critical', it should use this package so that it can plug into
our DataDog log analysis very easily.

<img align="center" src="https://img.shields.io/github/workflow/status/glasswall-sre/sre-logging/CI">
<img align="center" src="https://img.shields.io/codecov/c/github/glasswall-sre/sre-logging">
<img align="center" src="https://sonarcloud.io/api/project_badges/measure?project=sre-loggin&metric=alert_status">

</div>



## Installation
```bash
pip install srelogging
```

## Usage
In your program, as soon as the application starts, you'll want to call
`srelogging.configure_logging()`:
```python
import srelogging

# ...

srelogging.configure_logging()
```

Additionally, if you want to specify any custom logging
config (in Python logging [dictConfig format](https://docs.python.org/3.7/library/logging.config.html#logging-config-dictschema))
then you can specify a file path in the arguments to `configure_logging()`:

```python
srelogging.configure_logging("logging_config.yml")
```

```yaml
# contents of logging_config.yml
version: 1
formatters:
  default:
    class: srelogging.UTCFormatter
    format: "%(asctime)s.%(msecs)03dZ [%(levelname)s] <%(module)s.py:%(lineno)d> %(message)s"
    datefmt: "%Y-%m-%d %H:%M:%S"
handlers:
  console:
    class: logging.StreamHandler
    level: DEBUG
    formatter: default
    stream: ext://sys.stdout
root:
  level: WARNING
  handlers: [console]

```
czech-eet 1.0.5
API for EET
Requires Python: >=3.6

# Python EET API
Simple to use and mostly secure (mainly pedantic) API for Czech EET Gate.

![PyPI - License](https://img.shields.io/pypi/l/czech-eet)
![PyPI](https://img.shields.io/pypi/v/czech-eet)
[![Downloads](https://pepy.tech/badge/czech-eet)](https://pepy.tech/project/czech-eet)

## Installation
```
pip install czech-eet
```

## Usage

### Basic usage with single request
```python
from eet import invoices, helpers

cert_text = b'''
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
'''

key_text = b'''
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
'''

# prepare certificate and private key
cert = helpers.parse_cert(cert_text)
pk   = helpers.parse_key(key_text)

# create config
config = invoices.Config(cert, pk, 141, "1patro-vpravo")

# create factory using config
factory = invoices.Factory(config)

# build new invoice & send
invoice = factory.new("141-18543-05", 236.00, zakl_dan1=100.0, dan1=21.0)
response = invoice.send()
# note: if resending, you should set `eet.invoice.Hlavicka["prvni_zaslani"] = eet.types.boolean(False)`
#       or use scheduler ;-)

# now validate response and get fik
codes = response.codes()
if response:
    print("BKP: {0}\nFIK: {1}".format(codes.bkp, codes.fik))
else:
    print("BKP: {0}\nPKP: {1}".format(codes.bkp, codes.pkp))
    print("Errors:", response.Chyba, response.Varovani)

```

### Example of scheduler
```python
from eet import invoices, helpers, remote

... # prepare invoice as before

# create instance of scheduler
scheduler = remote.Scheduler()

# same as before but now you can resend invoices
response = scheduler.process(invoice)

# call dispatch is reasonable time interval from your mainloop

import time
while True:
    scheduler.dispatch()

    time.sleep(60)

```