semvec/pypi-packages huggingface dataset:
flaskriver 0.0.4
This is a package which aims to combine the lighweight web-framework flask

<p align="center">
    <img src="docs/img/text.png" alt="logo">
</p>

<p align="center">
    This is a repository for the open-source project Flaskriver. It combines the lightweight web-framework <a href="https://flask.palletsprojects.com/en/2.2.x/">Flask</a> with the online-ML library <a href="https://github.com/online-ml/river">River</a> to make deploying online-ML models to web web easier. For more info on online-ML check out the river repository or the official website.
</p>

## Introduction

First you will have to install the package via pip:

```sh
pip install flaskriver
```

The following code will spin up a developement server which is providing a logistic regression model. You can reach it's endpoints at:
- http://localhost/predict:5000
- http://localhost/train:5000
- http://localhost/metric:5000

```python
from flaskriver import ClassificationInterface
from flask import Flask
from river import linear_model, metrics

model = linear_model.LogisticRegression()

mae = metrics.MAE()
accuracy = metrics.Accuracy()
metrics = [mae, accuracy]

interface = ClassificationInterface(model, metrics)

app = Flask(__name__)
interface.registerToApp(app)

if __name__ == "__main__":
    app.run(host="localhost", debug=True)
```

At these endpoints the app will await the training data as JSON (since river models work with dictionaries). A JSON body for training the model could look something like this:

```json
{
    "features":{
        "x1":300,
        "x2":210
    },
    "target":false
}
```

And the JSON body for predicting a value would then look like this:

```json
{
    "x1":100,
    "x2":150
}
```

With the following code you can set up a small client which goes through an entire dataset (the "Phising" dataset which comes with River) and incrementally trains the model and evaluates it's metrics.

```python
import requests
from river import datasets

dataset = datasets.Phishing()

train_url = f"http://localhost:5000/train"
metric_url = f"http://localhost:5000/metric"


for x, y in dataset:
    payload = {"features": x, "target": y}
    response = requests.post(train_url, json=payload)

    response = requests.get(metric_url)
    print(response.json())
```

## Documentation
You can find more detailed documentation for Flaskriver at <a href="https://flaskriver.ml">flaskriver.ml</a>

## Contributing
If you would like to contribute something to the project fell free to share your ideas in form of an issue. You can also reach out to me directly via e-mail.
filerecords 0.0.1
A command-line toolbox to keep file metadata in an organized and easily accessible way through comments and flags.
Requires Python: >=3.6


![](docs/source/logo_black.png)

[![CodeFactor](https://www.codefactor.io/repository/github/noahhenrikkleinschmidt/filerecords/badge)](https://www.codefactor.io/repository/github/noahhenrikkleinschmidt/filerecords)
[![Documentation Status](https://readthedocs.org/projects/filerecords/badge/?version=latest)](https://filerecords.readthedocs.io/en/latest/?badge=latest)

`filerecords` is a python command line tool to better keep track of files and directories for data science projects (or any kind of big directory structure). 
It works similar to GIT but instead of keeping track of the actual file contents it keeps a registry of comments and flags. This allows users to comment their important files and directories to add more detailed descriptions than just a good file name or directory name. 

![example](https://user-images.githubusercontent.com/89252165/188868989-3d9b0682-c455-4ff2-a36e-0113d7049c3a.gif)

## Short overview

This is a brief listing of all commands. More details on their use can be found in the [documentation on readthedocs](https://filerecords.readthedocs.io/en/latest/).

To create a new registry within a directory use:

```
records init 
```

To add a comment about a file or directory use:
This will add *new* comments to file entries while preserving the old ones.

```
records comment the_file -c "the comment" -f flag1 flag2 ...
```

To remove a file or directory from the registry use:
(by default this will also remove the file in the filesystem!)

```
records rm the_file
```

To move a file or directory while keeping the records use:
(by default this will also move the file in the filesystem!)

```
records mv the_current_path the_new_path
```

To remove/undo the last comment from a file or directory use:

```
records undo the_file
```

This also works for flags:

```
records undo the_file -f the_flag_to_remove 
```

To get a file's records use:

```
records lookup the_file
```

this will print the latest comment to the terminal.

To read the entire records of a file use:

```
record read the_file
```

To search for files and directories based on flags or regex patterns use:

```
records list -f flag1 -e the_regex_pattern
```

This can be restricted to files in the current working directory by:

```
records ls 
```

instead of the full `list` command.

To only add a flag (but no comment) to a file use:

```
records flag the_file -f flag1 
```

> This could also be achieved using
>
> ```
> records comment the_file -f flag1 
> ```

To define new flag groups to the registry use:

```
records flag -g group1 : flag1 flag2 -g group2 : flag3 flag4
```

To remove all file records from the registry use:

```
records clear
```

To completely remove a registry use:

```
records destroy
```

To export the registry either in YAML or markdown format use:

```
records export yaml|md|both
```