Skip to content

Latest commit

 

History

History
122 lines (100 loc) · 4.58 KB

README.md

File metadata and controls

122 lines (100 loc) · 4.58 KB
logo

MindLake Tutorial: Python SDK

A step-by-step cookbook for beginner to access Mind Lake !

📔 Table of Contents

🌟 0. Other Programming Languages

🌟 1. Install Or Upgrade Python If Needed

🌟 2. Install MindLakeSDK

  1. Open Terminal and Enter the install command:
pip install mindlakesdk

The required package will be automatically installed as a dependency, and get the following output in the end:

Installing collected packages: mindlakesdk
Successfully installed mindlakesdk-1.0.1
  1. Validate the installation in Terminal
$ pip show mindlakesdk
Name: mindlakesdk
Version: 1.0.1
Summary: A Python SDK to connect to Mind Lake
Home-page:
Author:
Author-email: Mind Labs <biz@mindnetwork.xyz>
License:
Location: /Users/xxx/.pyenv/versions/3.10.11/lib/python3.10/site-packages
Requires: eth-account, pynacl, web3
Required-by:
  1. You can also validate in IDLE
$ python3
Python 3.10.11 (main, May  1 2023, 01:38:51) [Clang 16.0.2 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mindlakesdk
>>>

🌟 3. Get Examples

  1. Enter the following command in the terminal window to fetch the example code from github:
git clone https://github.com/mind-network/mind-lake-sdk-python.git
  1. Enter the path of example code:
cd mind-lake-sdk-python/examples

🌟 4. Prepare env.py If Needed

  1. env.py contains the settings of parameters used in examples and use cases, you can copy env_template.py to the name env.py and modify it as per your requirement.

env_template

  1. env.py will need walletAddress, walletPrivateKey and appKey.
  1. If you want to run the examples of QuickStart, Use Case 1 and Use Case 2, you only need to fill out walletAddressAlice, walletPrivateKeyAlice and appKey.
  2. If you want to run Use Case 3, you need to fill out the walltes info for all of Alice, Bob and Charlie.

env

🌟 5. Execute the examples

You can execute the following commands to run the quickstart and use cases.

🎨 5.1 QuickStart

python quickstart.py

QuickStart

🎨 5.2 Use Case 1: Single User with Structured Data

python use_case_1.py

Use Case 1

🎨 5.3 Use Case 2: Single User with Unstructured Data

python use_case_2.py

You can also check the result by opening these two picture files. Use Case 2

🎨 5.4 Use Case 3: Multi Users with Permission Sharing

python use_case_3.py

Use Case 3