SecretFlow is a unified framework for privacy-preserving data intelligence and machine learning. To achieve this goal, it provides:
For users who want to try SecretFlow, you can install the current release from pypi. Note that it requires python version == 3.8, you can create a virtual environment with conda if not satisfied.
pip install -U secretflow
Try you first SecretFlow program
>>> import secretflow as sf
>>> sf.init(['alice', 'bob', 'carol'], num_cpus=8, log_to_driver=True)
>>> dev = sf.PYU('alice')
>>> import numpy as np
>>> data = dev(np.random.rand)(3, 4)
>>> data
<secretflow.device.device.pyu.PYUObject object at 0x7fdec24a15b0>
For developers who want to contribute to SecretFlow, you can set up an environment with the following instruction.
git clone https://github.com/secretflow/secretflow.git
# optional
git lfs install
conda create -n secretflow python=3.8
conda activate secretflow
pip install -r dev-requirements.txt -r requirements.txt
We prefer black as our code formatter. For various editor users, please refer to editor integration. Pass -S, --skip-string-normalization
to black to avoid string quotes or prefixes normalization.
Non-release versions of SecretFlow are prohibited to use in any production environment due to possible bugs, glitches, lack of functionality, security issues or other problems.
Click to Open Code Editor