semvec/pypi-packages huggingface dataset:
gunicorn-torify 19.12.2710
Turn any Gunicorn application into a Tor Onion Service
Requires Python: >=3.5

# Gunicorn Torify

Turn any Gunicorn server into a Tor Onion Service

## Installation

It's available on [PyPI](https://pypi.org/project/gunicorn-torify/)! Just use pip to install

```bash
$ pip install gunicorn-torify
```

You must have [Tor](https://2019.www.torproject.org/docs/debian.html.en) installed to use gunicorn-torify.
This might look like

```bash
$ pacman -S tor    # Arch
$ apt install tor  # Debian/Ubuntu
$ apk add tor      # Alpine
```

## Usage

Just add these imports to your [Gunicorn config file](https://docs.gunicorn.org/en/stable/settings.html#config-file) (or create some python file such as `./gunicorn-conf.py` with the line):

```python
from gunicorn_torify import on_starting, on_exit
```

When starting Gunicorn, be sure to include the `--config ./gunicorn-conf.py` flag.

### Persistence

By default, the Onion Service will store its secret keys in `./secrets/tor`.
To override this you can set the `TOR_SERVICE_DIR` environment variable before running for the first time.
According to the [tor docs](https://2019.www.torproject.org/docs/tor-onion-service.html.en#two) this directory contains private keys and should be treated carefully.

If deploying in Docker, it's important to persist this directory (otherwise your onion address could change) either with a named volume or a mapped directory.
An example deployment could be done with

```bash
$ docker volume create my-onion-service
$ docker run -v my-onion-service:/app/secrets/tor afiorillo/gunicorn-torify:flask
```

## Contributing

To setup the development environment, it's convenient to use [pyenv](https://github.com/pyenv/pyenv) and the [pyenv virtualenv](https://github.com/pyenv/pyenv-virtualenv) plugin.
For example

```bash
$ pyenv virtualenv 3.8.1 gunicorn-torify-3.8
$ pyenv activate gunicorn-torify-3.8
$ pip install -r requirements_dev.txt
```
fastweb 1.6.0.20
fastweb is a web-server integration solution. It based on tornado, celery, thrift.

<p align="center">
  <img width="320" src="/assets/logo/logo.png">
</p>

<p align="center">
    <a href="https://github.com/tornadoweb/tornado">
        <img src="https://img.shields.io/badge/tornado-5.0.2-brightgreen.svg" alt="tornado">
    </a>
    <a href="https://github.com/celery/celery">
        <img src="https://img.shields.io/badge/celery-4.2.0-brightgreen.svg" alt="celery">
    </a>
    <a href="https://github.com/apache/thrift">
        <img src="https://img.shields.io/badge/thrifit-0.11.0-brightgreen.svg" alt="thrift">
    </a>
    <a href="https://github.com/BSlience/fastweb">
        <img src="https://travis-ci.org/BSlience/fastweb.svg?branch=master" alt="fastweb">
    </a>
    <a href="LICENSE">
        <img src="https://img.shields.io/badge/Apache%202-license-blue.svg" alt="license">
    </a>

</p>

English | [简体中文](./README.zh-CN.md)

## Introduction

[fastweb](https://github.com/BSlience/fastweb) is a web-server integration solution. It based on [tornado](https://github.com/tornadoweb/tornado), [celery](https://github.com/celery/celery), [thrift](https://github.com/apache/thrift).

- [Documentation]()

- [Examples](examples/)

It is a charming web-server framework based on the effective technique and organized into component. The components could be used with only several config and code. It is always so easy to make a new component.It also provides many scenes to construct your apis, pages, rpc functions, tasks and so on efficiently.

## Features

<p align="center">
  <img width="600" src="/assets/features/features.png">
</p>

```
    - Configuration
        - ini

    - Web
        - api
        - page render

    - Task
        - distributed task
        - periodic task
        - touting task

    - Rpc
        - thrift

    - Component
        - mysql
        - redis
        - mongo
        - http
        - soap

    - Manager
        - pool
```

## Getting Started

```bash
pip install fastweb
```

## Examples

Many useful examples are [here](examples/).

## Changelog

Detail changes for each releases are documented in the [release notes](CHANGELOG.md).

## License

[Apache License](LICENSE.md)

Copyright on (c) 2018-present bslience
categorical-embedder 0.1
Categorical Embedder is a python package that let's you convert your categorical variables into numeric via Neural Networks

# Categorical Embedder

 **Categorical Embedder** is a python package that let's you convert your categorical variables into numeric via Neural Networks

## Installation

`pip install categorical_embedder`

## Example
```py
import categorical_embedder as ce
from sklearn.model_selection import train_test_split

df = pd.read_csv('HR_Attrition_Data.csv')
X = df.drop(['employee_id', 'is_promoted'], axis=1)
y = df['is_promoted']

embedding_info = ce.get_embedding_info(X)
X_encoded,encoders = ce.get_label_encoded_data(X)

X_train, X_test, y_train, y_test = train_test_split(X_encoded,y)

embeddings = ce.get_embeddings(X_train, y_train, categorical_embedding_info=embedding_info, 
                            is_classification=True, epochs=100,batch_size=256)
```
A more detailed [Jupyter Notebook](http://www.github.com ) can be found here

> What's inside **Categorical Embedder** ?
* `ce.get_embedding_info(data,categorical_variables=None)`: This function identifies all categorical variables in the data, determines its embedding size. Embedding size of the categorical variables are determined by minimum of 50 or half of the no. of its unique values i.e. embedding size of a column  = Min(50, # unique values in that column)
One can pass explicit list of categorical variables in `categorical_variables` parameter. If `None`, this function automatically takes all the variables with data type `object`
* `ce.get_label_encoded_data(data, categorical_variables=None)`: This function label encodes (integer encoding) all the categorical variables using sklearn.preprocessing.LabelEncoder and returns a label encoded dataframe for training. Keras/tensorflow or any other deep learning library would expect the data to be in this format.
* `ce.get_embeddings(X_train, y_train, categorical_embedding_info=embedding_info, is_classification=True,                          epochs=100,batch_size=256)`: This function trains a shallow neural networks and returns embeddings of categorical variables. Under the hood, It is a 2 layer neural network architecture with 1000 and 500 neurons with 'ReLU' activation. It takes 4 required inputs -  `X_train`, `y_train`, `categorical_embedding_info`:output of get_embedding_info function and `is_classification`: `True` for classification tasks; `False` for regression tasks.

For classification: `loss = 'binary_crossentropy'; metrics = 'accuracy'` and for regression: `loss = 'mean_squared_error'; metrics = 'r2'`

## Dependencies
```numpy
pandas
scikit-learn
tensorflow
keras
tqdm
keras-tqdm
```