semvec/pypi-packages huggingface dataset:
fastapi-healthcheck-sqlalchemy 0.1.0
A service to check the health of your applications SQLAlchemy connection.
Requires Python: >=3.9,<4.0

# fastapi-healthcheck-sqlalchemy

A module built on top of fastapi_healthcheck to check the status of your SQLAlchemy connection.  This requires a Table given to the health check so it can run a count of rows against it.  As long as it returns a value, the connection is alive.

## Install

`pip install fastapi-healthcheck-sqlalchemy` or `poetry add fastapi-healthcheck-sqlalchemy`

## How to use

This module just exposes the service layer that will be used to parse your middleware connection to your database.  

```python
from fastapi import FastAPI
from fastapi_sqlalchemy import DBSessionMiddleware
from fastapi_healthcheck import HealthCheckFactory, healthCheckRoute
from fastapi_healthcheck_sqlalchemy import HealthCheckSQLAlchemy


app = FastAPI()

# Bring SQLAlchemy online first.
app.add_middleware(DBSessionMiddleware, db_url=cs.value)

_healthChecks = HealthCheckFactory()
_healthChecks.add(
    HealthCheckSQLAlchemy(
        # The name of the object for your reference
        alias='postgres db',  

        # The Table that we will run a count method against.
        table=SmtpContactsSqlModel, 

        tags=('postgres', 'db', 'sql01')
    )
)

app.add_api_route('/health', endpoint=healthCheckRoute(factory=_healthChecks))
```
dis-magic 1.0.0
IPython extension allowing visualizing bytecode of cell using magic
Requires Python: >=3.6

This allows you to visualize the bytecode of a cell in IPython upon running it.

## Installation

    pip3 install dis-magic

To manually load, run the following in your IPython prompt:
    
    %load_ext dis_magic

To automatically load, add the following to your [IPython configuration file](https://ipython.org/ipython-doc/3/config/intro.html):
    
    c = get_config()
    c.InteractiveShellApp.extensions.append('dis_magic')
    
## Usage

Verifying Python follows PEMDAS:

    In [6]: %dis foo = 6 ** 2 + 6
      1           0 LOAD_CONST               0 (42)
                  2 STORE_NAME               0 (foo)
                  4 LOAD_CONST               1 (None)
                  6 RETURN_VALUE
        
You can use it in a cell too:

    In [4]: %%dis
       ...:
       ...: def fibonacci(n: int) -> int:
       ...:     if n <= 1: return 1
       ...:     return fibonacci(n - 2) + fibonacci(n - 1)
       ...:
      2           0 LOAD_NAME                0 (int)
                  2 LOAD_NAME                0 (int)
                  4 LOAD_CONST               0 (('n', 'return'))
                  6 BUILD_CONST_KEY_MAP      2
                  8 LOAD_CONST               1 (<code object fibonacci at 0x111457b30, file "<dis>", line 2>)
                 10 LOAD_CONST               2 ('fibonacci')
                 12 MAKE_FUNCTION            4 (annotations)
                 14 STORE_NAME               1 (fibonacci)
                 16 LOAD_CONST               3 (None)
                 18 RETURN_VALUE
    
    Disassembly of <code object fibonacci at 0x111457b30, file "<dis>", line 2>:
      3           0 LOAD_FAST                0 (n)
                  2 LOAD_CONST               1 (1)
                  4 COMPARE_OP               1 (<=)
                  6 POP_JUMP_IF_FALSE       12
                  8 LOAD_CONST               1 (1)
                 10 RETURN_VALUE
    
      4     >>   12 LOAD_GLOBAL              0 (fibonacci)
                 14 LOAD_FAST                0 (n)
                 16 LOAD_CONST               2 (2)
                 18 BINARY_SUBTRACT
                 20 CALL_FUNCTION            1
                 22 LOAD_GLOBAL              0 (fibonacci)
                 24 LOAD_FAST                0 (n)
                 26 LOAD_CONST               1 (1)
                 28 BINARY_SUBTRACT
                 30 CALL_FUNCTION            1
                 32 BINARY_ADD
                 34 RETURN_VALUE