semvec/pypi-packages huggingface dataset:
sdk-cloud-dfe 1.1.2
SDK para comunicar com API Integra Notas.
Requires Python: >=3.6

# SDK em Python para API Integra Notas

Este SDK visa simplificar a integração do seu sistema com a nossa API, oferecendo classes com funções pré-definidas para acessar as rotas da API. Isso elimina a necessidade de desenvolver uma aplicação para se comunicar diretamente com a nossa API, tornando o processo mais eficiente e direto.

*Nota: Utilizamos a biblioteca request para fazer as requisições de nossa API.*

## Forma de instalação de nosso SDK:

```
pip install sdk-cloud-dfe
```

## Forma de uso:

```py
from sdk_cloud_dfe import Nfe, ConfigBase, AMBIENTE_HOMOLOGACAO

try:
    config = ConfigBase(
        ambiente=AMBIENTE_HOMOLOGACAO,
        token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbXAiOiJ0b2tlbl9leGVtcGxvIiwidXNyIjoidGsiLCJ0cCI6InRrIn0.Tva_viCMCeG3nkRYmi_RcJ6BtSzui60kdzIsuq5X-sQ",
        timeout=60,
        port=443
    )

    nfe = Nfe(config)

    resp = nfe.status()

    print(resp)

except Exception as error:
    print("Ocorreu um erro", error)
```

### Sobre dados de envio e retornos

Para saber os detalhes referente ao dados de envio e os retornos consulte nossa documentação [IntegraNotas Documentação](https://integranotas.com.br/doc).

### Veja alguns exemplos de consumi de nossa API nos link abaixo:

[Pasta de Exemplos](https://github.com/cloud-dfe/sdk-python/tree/master/examples)

[Utilitários](https://github.com/cloud-dfe/sdk-python/tree/master/examples/utils)

[Averbação](https://github.com/cloud-dfe/sdk-python/tree/master/examples/averbacao)

[Certificado Digital](https://github.com/cloud-dfe/sdk-python/tree/master/examples/certificado)

[CT-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/cte)

[CT-e OS](https://github.com/cloud-dfe/sdk-python/tree/master/examples/cteos)

[DF-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/dfe)

[Emitente](https://github.com/cloud-dfe/sdk-python/tree/master/examples/emitente)

[GNR-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/gnre)

[MDF-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/mdfe)

[NFC-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/nfce)

[NFCom](https://github.com/cloud-dfe/sdk-python/tree/master/examples/nfcom)

[NF-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/nfe)

[NFS-e](https://github.com/cloud-dfe/sdk-python/tree/master/examples/nfse)

[Softhouse](https://github.com/cloud-dfe/sdk-python/tree/master/examples/softhouse)

[Webhook](https://github.com/cloud-dfe/sdk-python/tree/master/examples/webhook)
tfhealthchecks 1.0.3
Library of health checks

# tfhealthcheck-py

This library provides set of ready to use health check implementations and provides 
basic abstractions for creating health checks with custom logic.

### Pipeline

To get to the azure pipeline go to
https://dev.azure.com/takeofftech/SE/_build?definitionId=264&_a=summary.

### Installation

```
pip install --extra-index-url <url_to_azure_pypi> tfhealthchecks==0.1.4
```

### Usage

```python
# 1. Registering set of checks 

from tfhealthchecks.library import ElasticHealth, CeleryHealth, TomApiProbe, IMSProbe, OMSProbe

checks = [
            ElasticHealth(ELASTICSEARCH_URL),
            CeleryHealth(celery.app),
            TomApiProbe(TOM_API_URL),
            IMSProbe(IMS_URL),
            OMSProbe(CUSTOMER_ORDER_URL)
        ]

# 2. Run checks and obtain result:

from tfhealthchecks.healthcheck import report

status_code, result = report(checks) # status_code (int) - http staus code to return, result - json serializable
                                     # object which contains result of checks execution

# 3. Return http response:
from django.http import JsonResponse

return JsonResponse(result, status=status_code, safe=False, json_dumps_params={"indent": 4})
    
```

### Implementing own health check

Health check consist of two parts - health check runner (all runners should be inherited from `HttpCheckRunner`)
and check description (should be inherited from `BaseHealthCheck`).

Implementation of new check:

```python

from tfhealthchecks.healthcheck import BaseHealthCheck


class MyNewHealthCheck(BaseBaseHealthCheck):
    def __init__(self, url):
        runner = HttpCheckRunner(url)
        super().__init__()
    
    def name(self):
        return "Human readable health check name"

    def description(self):
        return "Long description"
    
    def is_optional(self):
        '''Indicates that service can function when this check returns false'''
        return False

```

Implementation of custom HC logic:

```python

from tfhealthchecks.healthcheck import HealthCheckRunner, CheckResult
import datetime

class MyHealthCheckRunner(HealthCheckRunner):
    
    """Action to execute to get health response"""
    def run_check(self) -> CheckResult:
       # execution logic
       return CheckResult(False, datetime.datetime.now, 0, [NotImplementedError()])

```