# Python Quick-Start

* Demos on how to connect a lake, create a table, encrypt data, and insert and query encrypted data.&#x20;
* You can check out [Python API Reference](/mind-lake-sdk/python-api-reference.md) for more advanced functions.

##

## Preparation

If you need to configure Python local environment, please visit our step-by-step tutorial for Python:

{% embed url="<https://github.com/mind-network/mind-lake-sdk-python/blob/main/tutorial/README.md>" %}

## Source Code

```python
'''
Python Quick Start
pip install MindLake
copy env-template.py into env.py and replace with your own details
'''

import env
import mindlakesdk

# 1. connect to MindLake, '5' is example of Goerli Testnet chainID
chainID = '5'
mind = mindlakesdk.connect(env.walletPrivateKeyAlice, env.appKey, chainID)
assert mind, mind.message

# 2. create a table
result = mind.datalake.createTable('test_table_enc',
        [
            mind.datalake.Column('id', mind.DataType.int4, False),
            mind.datalake.Column('token', mind.DataType.text, True)
        ])
assert result, result.message

# 3. encrypt data
result = mind.cryptor.encrypt('USDT','test_table_enc.token')
assert result, result.message
encryptedTokenName = result.data

# 4. insert encrypted data
result = mind.datalake.query(f"""INSERT INTO test_table_enc (id, token) 
VALUES (1, '{encryptedTokenName}')""")
assert result, result.message

# 5. query encrypted data
result = mind.datalake.query("SELECT token FROM test_table_enc")
assert result, result.message
print(result.data['columnList'][0])
for row in result.data['data']:
    result = mind.cryptor.decrypt(row[0])
    assert result, result.message
    print(result.data)
```

## Execution Output

```
token
USDT
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mindnetwork.xyz/mind-lake-sdk/get-started/python-quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
