<commit_before># Syft

[![Chat on Slack](https://img.shields.io/badge/chat-on%20slack-7A5979.svg)](https://openmined.slack.com/messages/team_pysyft)
[![Build Status](https://travis-ci.org/OpenMined/PySyft.svg?branch=master)](https://travis-ci.org/OpenMined/PySyft)

> Homomorphically Encrypted Deep Learning Library

The goal of this library is to give the user the ability to efficiently train Deep Learning models in a homomorphically encrypted state without needing to be an expert in either. Furthermore, by understanding the characteristics of both Deep Learning and Homomorphic Encryption, we hope to find very performant combinations of the two.  See [notebooks](./notebooks) folder for tutorials on how to use the library.

- [Setup](#setup-install-instructions)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
  - [Start](#start)
  - [Tests](#tests)
- [For Contributors](#for-contributors)
- [Relevant Literature](#relevant-literature)
- [License](#license)

## Setup

### Prerequisites

- PySyft is based on Python 3.X.
- Install base libraries first - https://github.com/OpenMined/PySonar/blob/master/README.md#base-libraries
- You need to install this library locally before running any of the notebooks this repository or the [main demonstration](https://github.com/OpenMined/sonar):

```sh
# Get dependencies ready
pip install -r requirements.txt
# install the lib locally
python setup.py install
```

### Installation

The recommended method is using Docker (works on all major operating systems).

#### For Docker Users

Install Docker from [its website](https://www.docker.com/).
For macOS users with [Homebrew](https://brew.sh/) installed, use `brew cask install docker`.

#### For Anaconda Users

```
bash install_for_anaconda_users.sh
```

##### Windows

```sh
conda install -c conda-forge gmpy2
pip install -r requirements.txt
python setup.py install
```

## Usage

### Start

Then, run:

```sh
git clone https://github.com/OpenMined/PySyft.git
cd PySyft
make run
```

If you want create a local Docker with Jupyter:
```sh
docker build -f Development-Dockerfile -t "pysyft" .
make custom docker=pysyft
```

### Tests

```sh<commit_msg>Adds patch to resolve syft import issue.<commit_after># Syft

[![Chat on Slack](https://img.shields.io/badge/chat-on%20slack-7A5979.svg)](https://openmined.slack.com/messages/team_pysyft)
[![Build Status](https://travis-ci.org/OpenMined/PySyft.svg?branch=master)](https://travis-ci.org/OpenMined/PySyft)

> Homomorphically Encrypted Deep Learning Library

The goal of this library is to give the user the ability to efficiently train Deep Learning models in a homomorphically encrypted state without needing to be an expert in either. Furthermore, by understanding the characteristics of both Deep Learning and Homomorphic Encryption, we hope to find very performant combinations of the two.  See [notebooks](./notebooks) folder for tutorials on how to use the library.

- [Setup](#setup-install-instructions)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
  - [Start](#start)
  - [Tests](#tests)
- [For Contributors](#for-contributors)
- [Relevant Literature](#relevant-literature)
- [License](#license)

## Setup

### Prerequisites

- PySyft is based on Python 3.X.
- Install base libraries first - https://github.com/OpenMined/PySonar/blob/master/README.md#base-libraries
- You need to install this library locally before running any of the notebooks this repository or the [main demonstration](https://github.com/OpenMined/sonar):

```sh
# Get dependencies ready
pip install -r requirements.txt
# install the lib locally
python setup.py install
```

### Installation

The recommended method is using Docker (works on all major operating systems).

#### For Docker Users

Install Docker from [its website](https://www.docker.com/).
For macOS users with [Homebrew](https://brew.sh/) installed, use `brew cask install docker`.

#### For Anaconda Users

```
bash install_for_anaconda_users.sh
```

Note: If you are having trouble with installation, after you run the above script, while you try to import Syft in your Jupyter notebook, try this: 

```
source activate openmined  # activate your env, if you haven't already
pip install ipykernel
python -m ipykernel install --user --name=openmined
```

##### Windows

```sh
conda install -c conda-forge gmpy2
pip install -r requirements.txt
python setup.py install
```

## Usage

### Start

Then, run:

```sh
git clone https://github.com/OpenMined/PySyft.git
cd PySyft
make run
```

If you want create a local Docker with Jupyter:
```sh
docker build -f Development-Dockerfile -t "pysyft" .
make custom docker=pysyft
```

### Tests

```sh
{'fraction_non_alphanumeric': 0.12005081515985602, 'fraction_numerical': 0.0038111369892017783, 'mean_word_length': 4.739975698663426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 18, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4273888', 'n_tokens_mistral': 1523, 'n_tokens_neox': 1417, 'n_words': 486}