> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mantlebio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Getting Mantle SDK set up

## Requirements

* Python 3.6+
* Mantle account with username and password
* GitHub account

## Set up SSH key for GitHub account

In order to pip install the Mantle SDK package using SSH, you need to set up an SSH key for your GitHub account.
If you already have one, you can move on to the [Install with pip](##install-with-pip) section.

### Prerequisites

* GitHub account
* Read access to the `mantle-sdk` GitHub repository

### Steps

#### Check for existing SSH keys on your system

1. Open your prefered terminal application.
2. Run the following command to check for existing SSH keys on your system.

```bash theme={"system"}
ls -al ~/.ssh
```

3. Check the output to see if you have any existing SSH keys. The output should look something like this:

```bash theme={"system"}
total 32
drwx------  5 username username 4096 Jan 29 10:20 .
drwxr-xr-x 35 username username 4096 Feb 24 09:00 ..
-rw-r--r--  1 username username  421 Jan 29 10:20 config
-rw-------  1 username username 1679 Jan 12 08:14 id_rsa
-rw-r--r--  1 username username  399 Jan 12 08:14 id_rsa.pub
-rw-r--r--  1 username username 4444 Jan 18 11:30 known_hosts
```

If your output contains `id_rsa` and `id_rsa.pub`, then you have an existing SSH key and can skip to the section titled ["Adding a new SSH key to your GitHub account."](#adding-a-new-ssh-key-to-your-github-account)

#### Generating a new SSH key and adding it to the ssh-agent

1. Open your prefered terminal application.
2. Run the following command to generate a new SSH key:

```bash theme={"system"}
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```

3. When prompted to "Enter a file in which to save the key," press enter to save the key in the default location.
4. When prompted to "Enter a passphrase," you can either enter a passphrase or press enter to leave it blank.
   Note that if you chose to enter a passphrase, you will be prompted to enter it every time you use the key.
   For more information on passphrases, see [https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases).
5. Run the following command to add your SSH key to the ssh-agent:

```bash theme={"system"}
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
```

#### Adding a new SSH key to your GitHub account

1. Open your prefered terminal application.
2. Run the following command to copy your SSH key to your clipboard:

```bash theme={"system"}
cat ~/.ssh/id_rsa.pub | pbcopy
```

3. Go to your GitHub account settings and click on "SSH and GPG keys" in the left hand menu.
4. Click on "New SSH key" in the top right hand corner.
5. In the "Title" field add a descriptive title for your SSH key.
6. In the "Key" field paste your public SSH key.
7. Click "Add SSH key."

#### Testing your SSH connection

1. Open your preferred terminal application.
2. Run the following command to test your SSH connection:

```bash theme={"system"}
$ ssh -T git@github.com
# Attempts to SSH to GitHub
```

3. When you run the command, you may see a message like the following:

```bash theme={"system"}
> The authenticity of host 'github.com (IP ADDRESS)' can't be established.
> ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
> Are you sure you want to continue connecting (yes/no)?
```

4. Validate the displayed fingerprint: [https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints)
5. If the fingerprint is correct type `yes` and press enter
6. You should see a message like the following

```bash theme={"system"}
> Hi username! You've successfully authenticated, but GitHub does not provide shell access.
```

#### Troubleshooting

If you have any issues with the above steps please refer to the following documentation for more information: [https://docs.github.com/en/authentication/troubleshooting-ssh](https://docs.github.com/en/authentication/troubleshooting-ssh).

## Install with pip

To install the Mantle SDK package using pip, use the following command:

```bash theme={"system"}
pip install git+ssh://git@github.com/mantlebio/mantle-sdk.git@latest
```

When including the package as a requirement in a `requirements.txt` file, use the following:

```
git+ssh://git@github.com:mantlebio/mantle-sdk.git@latest
```

<Tip>Adding `@latest` to the pip install command ensures you are pulling the latest version of the Mantle SDK. To pin to a specific release or branch of the sdk you can use `@release_tag` or `@branch_name`</Tip>

## Usage

To use the Mantle SDK in your python code, you can import the `mantlebio` package and create a new `MantleClient` instance:

```python theme={"system"}
import mantlebio

# Create a new Mantle SDK client
mantle = mantlebio.MantleClient()
```
