Skip to content

Commit

Permalink
getting started with python sdk documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kpandl committed Oct 5, 2023
1 parent 8aaf0d3 commit 26d863c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
13 changes: 12 additions & 1 deletion documentation/00_sdk_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The Aleo SDK is divided into three Typescript/Javascript packages
<a href="https://www.npmjs.com/package/@aleohq/sdk"> <img alt="Aleo SDK" src="https://img.shields.io/npm/l/%40aleohq%2Fsdk?label=NPM%20-%20Aleo%20SDK&labelColor=green&color=blue" /></a>


The official Aleo SDK providing Javascript/Typescript tools for creating zero knowledge app.
The official Aleo SDK providing Javascript/Typescript tools for creating zero knowledge apps.

### ⚡ Build your own app

Expand Down Expand Up @@ -69,6 +69,17 @@ NodeJS is functional.

Source: [`sdk/wasm`](https://github.com/AleoHQ/sdk/tree/testnet3/wasm)

## 4. [Aleo Python SDK]() - Zero Knowledge Algorithms in Python and Zero Knowledge Machine Learning

The official Aleo Python SDK providing tools for creating zero knowledge apps. It consists of two separate libraries:

* The **aleo** library, which uses foreign function interfaces to bring snarkVM functionalities to Python.
* The **zkml** library, which transpiles scikit-learn machine learning models into Leo programs for inference.

Both libraries are in an early development stage. They can be installed through `pip install aleo` respectively `pip install zkml`.

Source: [`python-sdk`](https://github.com/AleoHQ/python-sdk)

## 📚 Documentation

#### [API Documentation](https://developer.aleo.org)
Expand Down
59 changes: 59 additions & 0 deletions documentation/sdk/python/00_aleo_sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
id: aleo-sdk
title: Aleo SDK
sidebar_label: Aleo SDK
---

<!-- markdown-link-check-disable -->
[![github]](https://github.com/AleoHQ/python-sdk/tree/master/sdk)
<!-- markdown-link-check-enable -->

[github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github

[**aleo on PyPI**](https://pypi.org/project/aleo/)

Aleo Python bindings for building zero-knowledge applications.

This project uses `PyO3` and `Maturin` to provide a Python library named `aleo` that binds to snarkVM `Rust` functionalities. The resulting `aleo` library can be easily installed and used within Python. The project is at an early stage. At the moment, only Mac OS 11 or newer on Apple Silicon is supported - support for other operating systems will follow. If you are using another operating system, you may be able to build the library yourself following the instructions below.

Supported functionalities currently include:
* Private key generation

<!-- markdown-link-check-disable -->
## Usage
The `aleo` Python library is available on [PyPI](https://pypi.org/project/aleo/) for installation.

#### Installation
Ensure you have Python 3.11 or newer installed. If your operating system is supported, you can install the library from pip:

```bash
pip3 install aleo
```

Alternatively, you can also install from a `.whl` file, either from the [GitHub repository](https://github.com/AleoHQ/python-sdk/tree/master/sdk/target/wheels), or by building it yourself. For the installation, use a command like this:

```bash
pip3 install aleo-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
```

Note: On some systems, you may need to use `pip` instead of `pip3`.

### Actual usage
You can import the library, generate a private key object, and print it as a string as in the following example:
```Python
import aleo
private_key = aleo.PrivateKey()
print(private_key.to_string())
```

#### Build Instructions
To build it, first clone the [GitHub repository](https://github.com/AleoHQ/python-sdk/tree/master/sdk). Then, run the following command:
```bash
bash build.sh
```

After successful building, you will find a new `.whl` file in the `target/wheels` directory that you can install using the command from above.

## Building Python Apps

Further documentation and tutorials as to how to use the `aleo` Python library.

0 comments on commit 26d863c

Please sign in to comment.