XUMM PYTHON SDK: 2. Prepare your project and start coding 🔨
Tags: xrpl, xrp, xumm, sdk
Published: 2022-01-26 22:33:05

Previous: [1. Get your XUMM API credentials 🔑](https://dev.to/dangell7/xumm-python-sdk-1-get-your-xumm-api-credentials-5afo)

For this example we will use a Python (pip) environment.

1. Open Visual Studio Code, or your prefrred code editor, and create a new file - **File » New file**
2. Save your new file - **File » Save** in a new folder for your project e.g., `xumm-sdk-tutorial` and in this folder were using **`playground.py`**
3. Make a new virtual environment to manage your project. `mkvirtualenv xumm-sdk-tutorial`. If you don't have `virtualenv` installed please visit the [Get Started Tutorial](https://virtualenvwrapper.readthedocs.io/en/latest/)
3. **Install the XUMM SDK (PY)** in your project using the _'pip package manager'_. Open the terminal - **Terminal » New terminal** and at the prompt enter `pip install -i https://test.pypi.org/simple/ xumm-sdk-py-dangell7`
4. **Copy then paste** the following boilerplate code into your `playground.py` file:

```python
import xumm

sdk = xumm.XummSdk('Your-API-Id', 'Your-API-Secret')

def main():
  print("Hi! This is where we'll be writing some code")

main()
```
**Please replace `Your-API-Id` and `Your-API-Secret` in the code with the credentials obtained from the XUMM Developer Console when you registered your app.**

What does this code actually do?

- First, we 'import' the XUMM SDK that we installed using pip into our code - step 3 above. We are using the `xumm` package, and we are calling it `XummSdk` in our code.
- We then initialize a new instance of the SDK, which we call `sdk`. We will use this one later in the project as we don't interact with the XUMM SDK just yet. While not needed yet in the project the dummy API Key and API Secret need to be inserted here.
- In the function we have just created, we then tell the code to output a message to the terminal, using the `print` method.
- Lastly, we call our `main` function so the code will actually run.

Now let's run this code. In the terminal panel, type:

```
python3 playground.py
```
This will tell `python` to run all code in your `playground.py` file. You should receive the message `Hi! This is where we'll be writing some code` in your terminal and be back at the prompt awaiting further instruction.


![Blog.2.1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2vdgfe9zm6lge2q8nsv.gif)

If you have your API Key and API Secret in place (see placeholder values in code above) you can check if everything is working by asking the XUMM Platform to return your registered XUMM app name.

Replace the line of code containing `print(...)` with a `ping` request to the XUMM platform:

```
app_info = sdk.ping()
```
This line of code calls the `ping` method of the XUMM SDK. We `await` the results, as it may take a brief moment to connect to the XUMM platform and get a response. When we get a response, we are making the results accessible under the name `app_info`.

Now let us return the application name we retrieved from the XUMM platform to the console by using `print` once again. When you start typing, Visual Studio Code will suggest available properties:

Code autocomplete

Our `main` code should now look like this:

```
def main():
  app_info = sdk.ping()
  print(app_info.application.name)
```
Let's test the code:



![Blog.2.2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xerm19bq8k653ok4ex2t.gif)

It looks like we are able to reach the XUMM platform 🎉 😎

**Next:**

**[3. Your first payload 🔔](https://dev.to/dangell7/xumm-python-sdk-3-your-first-payload-56if)**
[4. Verify the results ⛑ and push 🚀](https://dev.to/dangell7/xumm-python-sdk-4-verify-the-results-and-push-47nd)
[5. Security & finishing touch 🎉](https://dev.to/dangell7/xumm-python-sdk-5-security-finishing-touch-5gd2)

## Resources 📚
If you want to learn more about the XUMM SDK PY, platform, documentation, etc., make sure to check out:

The XUMM SDK (PY) [readme](https://test.pypi.org/project/xumm-sdk-py-dangell7)
The XUMM SDK (PY) [source code](https://github.com/XRPL-Labs/xumm-sdk-py)
The XUMM API [documentation](https://xumm.readme.io/docs) & API [reference](https://xumm.readme.io/reference/about)
XUMM (end user) [support docs](https://support.xumm.app/hc/en-us)
In case of questions: support@xumm.app