semvec/pypi-packages huggingface dataset:
sqlite2rest 1.5.0
A Python library for creating a RESTful API from an SQLite database using Flask.
Requires Python: >=3.6

# SQLite2REST

SQLite2REST is a Python library that simplifies the process of creating a RESTful API from an SQLite database using the Flask web framework. It automatically reads the schema of an SQLite database and generates endpoints for each table, allowing for Create, Read, Update, and Delete (CRUD) operations. The library also generates an OpenAPI specification for the API.

![Test status](https://img.shields.io/github/actions/workflow/status/nside/sqlite2rest/test.yaml)
[![Documentation Status](https://readthedocs.org/projects/sqlite2rest/badge/?version=latest)](https://sqlite2rest.readthedocs.io/?badge=latest)

## Installation

You can install SQLite2REST using pip:

```
pip install sqlite2rest
```


## Usage

You can use SQLite2REST from the command line by providing the path to your SQLite database:

```
sqlite2rest serve /path/to/database.db
```


This will start a Flask server with endpoints for each table in the database. For example, if your database has a table named `users`, you can access the records in this table at the `/users` endpoint.

You can also use the `/openapi.yaml` endpoint to get the OpenAPI specification for the API.

## Endpoints

For each table in the database, the following endpoints are available:

- `GET /<table>`: Get all records from the table.
- `GET /<table>/<id>`: Returns the record with the given ID from the table.
- `POST /<table>`: Create a new record in the table. The data for the record should be provided as JSON in the request body.
- `PUT /<table>/<id>`: Update an existing record in the table. The data for the record should be provided as JSON in the request body.
- `DELETE /<table>/<id>`: Delete an existing record from the table.

You can also generate an OpenAPI specification from an SQLite database:

```
sqlite2rest spec /path/to/database.db
```

## Contributing

Contributions are welcome! Please feel free to submit a pull request.

## License

SQLite2REST is licensed under the MIT license. See the LICENSE file for more details.
numba-inspector 0.0.5
Visualize and Debug Numba compiled code in Jupyter
Requires Python: >=3.10,<4.0

# numba-inspector
Visualize and Debug Numba compiled code in Jupyter

## Quickstart

### Installation

Install the package:
```console
pip install numba-inspector
```

### %%numba magic command

```python
%load_ext numba_inspector
```

```python
%%numba --bytecode

from numba import njit

@njit
def func(x,y):
    if x:
        x=x+1
        if y:
            y=y+1
        else:
            y=y-1
    else:
        x=x-1
        if y:
            y=y+1
        else:
            y=y-1
    return x+y

func(1,2)
```
![View the bytecode of a jitted function (CPUDispatcher object)](https://raw.githubusercontent.com/Matt711/numba-inspector/main/examples/cpu_dispatcher_control_flow.png)


Install the cudatoolkit:
```console
conda install cudatoolkit
```

```python
%%numba --ptx

from numba import cuda
import numpy as np

@cuda.jit(lineinfo=True)
def increment_by_one(an_array):
    # Thread id in a 1D block
    tx = cuda.threadIdx.x
    # Block id in a 1D grid
    ty = cuda.blockIdx.x
    # Block width, i.e. number of threads per block
    bw = cuda.blockDim.x
    # Compute flattened index inside the array
    pos = tx + ty * bw
    if pos < an_array.size:  # Check array boundaries
        an_array[pos] += 1
        
a = np.arange(4096,dtype=np.float32)
d_a = cuda.to_device(a)
blocks = 32
threads = 128
increment_by_one[blocks, threads](d_a)
cuda.synchronize()
d_a.copy_to_host()
```
![View the PTX of CUDA kernel (CPUDispatcher object example)](https://raw.githubusercontent.com/Matt711/numba-inspector/main/examples/cuda_dispatcher.png)