semvec/pypi-packages huggingface dataset:
fastapi-spa-kit 0.0.4
Kit for developing SPA with FastAPI.

# fastapi-spa-kit
Kit for developing SPA with FastAPI.

## Install
```shell
pip install fastapi-spa-kit
```

## Features
* Handler for static files and HTML file.
  Typically, static files are handled by [Nginx](https://www.nginx.com/) or something like that. 
  But for development mode it can take a long time to set up a separate config file.
  `add_dev_spa_static_handler` function mounts [`StaticFiles`](https://fastapi.tiangolo.com/tutorial/static-files/#use-staticfiles)
  class to FastAPI `app` and adds route that handles getting HTML file.
  ### Example
  ```python
  from fastapi import FastAPI
  from fastapi_spa_kit import add_dev_spa_static_handler
  
  # config module contains project configuration.
  # IS_DEV_MODE is state of current environment.
  from .config import IS_DEV_MODE
  
  app = FastAPI()
  
  # add some handlers...
  
  # finally, add route '/static' and HTML file handler
  if IS_DEV_MODE:
      add_dev_spa_static_handler(
          app, 
          'path/to/static',
          'path/to/index.html'
      )
  ```

## Documentation
This repository contains [documentation](https://fastapi-spa-kit.readthedocs.io).

## TODO
* Add tests
fast-query-store 0.0.7.dev0
A Fast Backend API for database queries
Requires Python: >=3.8

# Fast Query Store :zap:

## Running locally
You need `python`, `git`, `docker` and `docker-compose` to run this project.

### Setup
```
git clone <repository-url>
cd fast-query-store
cp env.example .env
source .env
```
#### Install dependencies
```
python -m venv env
source env/bin/activate

pip install -r requirements.txt
```

#### Export config variables
**fast-query-store** will look for a `.json` file containing the queries information. The environment variable `queries_file_path` tells where this file is located.
```
export queries_file_path=/path/to/queries.json
```

Example of **queries.json** file
```json
{
    "slug-1": {
        "query": "SELECT * FROM table_1",
        "db_url": "postgresql:///..."
    },
    "slug-2": {
        "query": "SELECT COUNT(1) FROM table_1",
        "db_url": "sqlite:///..."
    },
    "slug-3": {
        "query": "SELECT * FROM table_3",
        "db_url": "${DATABASE_URL}"
    }
}
```
**Note:** It is also possible to set the `db_url` with a enviroment variable.

#### Running it
```
export queries_file_path=queries.json
uvicorn app.main:app --workers 2 --host 0.0.0.0 --port 8000
```

### Getting available query slugs
```
GET http://localhost:8000/
```

```http
HTTP/1.1 200 OK
content-length: 73
content-type: application/json
date: Fri, 14 May 2021 12:47:37 GMT
server: uvicorn

{
    "slugs": [
        "slug-1",
        "slug-2",
        "slug-3"
    ]
}
```

### Executing a query

```
GET http://localhost:8000/query/slug-1
```

```http
HTTP/1.1 200 OK
content-length: 151
content-type: application/json
date: Fri, 14 May 2021 12:53:09 GMT
server: uvicorn

{
    "result_set": [
        {
            "name": "Cheese",
            "price": 9.99,
            "product_no": 1
        },
        {
            "name": "Bread",
            "price": 1.99,
            "product_no": 2
        },
        {
            "name": "Milk",
            "price": 2.99,
            "product_no": 3
        }
    ]
}
```

## Running the tests
```
pip install -r requirements-development.txt
source .env
docker-compose f docker-compose.yml up -d
pytest -v
```
NNeuralNet 1.0
Implementation of a Feed Forward Neural Network
Requires Python: >=3.6

# NeuralNet
## Table of Contents
1. [Introduction](https://github.com/dl-thops/NeuralNet#introduction)
2. [Download](https://github.com/dl-thops/NeuralNet#download)
3. [Quick Start](https://github.com/dl-thops/NeuralNet#quick-start)
4. [Features](https://github.com/dl-thops/NeuralNet#features)
5. [Project Report](https://github.com/dl-thops/NeuralNet#project-report)

## Introduction
This repository contains an implementation of a Feed Forward Neural Network from scratch using numpy libraries. We have achieved a testing accuracy of 97.45% on MNIST Dataset and a 88.80.% testing accuracy on Fashion-MNIST Dataset.

You can also find a GPU version of the class NeuralNet in [ctrain<span>.py</span>](https://github.com/dl-thops/NeuralNet/blob/master/ctrain.py) (Uses cupy instead of numpy(CuDa compatible)). We have found about 50~100 x speed boost in training time. We will release the cupy version module soon.

## Download
You can view the source code for the NeuralNet class implementation from this [page](https://github.com/dl-thops/NeuralNet/blob/master/neuralnet.py).

`pip install NNeuralNet`


## Quick Start
#### Training
```
from NNeuralNet.NeuralNet import NeuralNet
from keras.datasets import mnist

# Import and Preprocess Data
( X_train, Y_train), ( X_test, Y_test) = mnist.load_data()
X_train = X_train.reshape(X_train.shape[0],-1).T
X_test = X_test.reshape(X_test.shape[0],-1).T

nn = NeuralNet( input_size = 784, output_size = 10)
nn.addlayer(128)
nn.addlayer(64)
nn.train( X_train, Y_train, numepochs = 10, learning_rate = 0.001)
```
#### Prediction
```
nn.predict( X_test, returnclass = 1)
# Set returnclass = 0 for class probabilities
```
#### Saving a Model
```
nn.save_model( "my_model.bin")
```
#### Loading a Saved Model
```
nn = NeuralNet.load_model( "my_model.bin")
```

## Features
The NeuralNet class has support for the following features/parameters support:
- Activation Type
	- [Tanh](https://mathworld.wolfram.com/HyperbolicTangent.html)
	- [Relu](https://en.wikipedia.org/wiki/Rectifier_(neural_networks))
	- [Sigmoid](https://en.wikipedia.org/wiki/Sigmoid_function)
- Optimisers
	- [Nadam](https://openreview.net/pdf?id=OM0jvwB8jIp57ZJjtNEZ)
	- [Rmsprop]()
	- [Adam](https://arxiv.org/abs/1412.6980)
	- [Nesterov](https://paperswithcode.com/method/nesterov-accelerated-gradient)
	- [Momentum](https://en.wikipedia.org/wiki/Stochastic_gradient_descent#Momentum)
	- [SGD](https://en.wikipedia.org/wiki/Gradient_descent)
- Variable batch sizes ( Batch Gradient Descent )
- Train - Cross Validation split
- L2 Regularisation / Weight Decay