← Back to docs
On this page
Getting started
Once you have deployed a Python language Shaip, you can access the code in the source repository and can pull it to a folder to run on your machine, check out this link for a refresher on accessing the source cloud repository. The next step is to start developing your algorithm. The following provides details on using RStudio to develop and commit your R code as well as providing details on how to manage the environment and test your code.
Using Positron to manage and develop your Python Shaip code
- Download and install the Positron IDE from https://positron.posit.co/. Positron is very similar to VSCode but aligned to R and Python languages.
- Open Positron studio and then access the local folder you pulled from your Shaip repository and providing access to your code using the ‘Open Folder ….’ button.

- When you open the folder Positron will automatically recognise that the folder is linked to a source repository and provide the options to manage your code using Git for example to commit, push and pull your code.

Package management using uv
- In your project you will see a number of files and folders. The Shaip uses uv to manage any packages that you need for your model. Details on what uv is and does can be found on the uv site see details below.
https://docs.astral.sh/uv/
- The uv package management tool is installed and ready to go and ensures the packages, virtual environment and Python version you use when developing locally are available when your Shaip is deployed and available publicly. The code is already to go and uv is initialised all you need to do is make sure the packages are installed locally. The deployment comes with the packages for fastapi and numpy already installed. The uv package can be used to run your code. In the Positron terminal in the directory with your Shaip code navigate to the pythonAlgoAPI folder and then run the code using the uv command, the two command should:
#Navigate to Shaip project directory
cd pythonAlgoAPI
#Create a virtual environment and run the code
uv run fastapi dev
- This command runs very quickly and will create a locally running version of your Python Shaip that will update as you develop the code and save the file. Your Shaip can be accessed using Postman (see details below). :
- When you push your code, if you have run these commands the cloud build out is taken care of all the updates automatically.
- When you start working on the code it is worth making sure both your code is up to date and the packages are also up to date. To get the latest code from the repository you can run the following from the command line:
git pull
- Once this is done you are ready to get coding. To add or remove a package dependency e.g. ‘httpx’ dependency:
#Add dependency
uv add httpx
#Remove dependency
uv remove httpx
Developing and testing the API using FastAPI
Setting up and running fastAPI
- The development environment for Python based algorithms uses the fastapi package. This allows Python code to be accessed via a web API. Details on plumber can be found at:
https://fastapi.tiangolo.com/
- The starting point for your Python code is the file named main.py this sits under the pythonAlgoAPI/app/ folder.

- The starting function provides a simple number adder, taking two number and adding them together. The input is a json formatted as below:
[
{
"number2": 324,
"number1": 122
}
]
- When the code is run using FastAPI is clicked it runs the Python code on the local host and assigns a port in the above example it is port 8000 and local host is assigned to http://127.0.0.1, in addition the plumber code assigns /shaip as the endpoint and nominates that it is a POST command i.e. it will expect data in the body. All Shaip endpoints require data even if it is only to trigger a simulation. The console also shows that FastAPI is running and provides an option to stop when local testing is finished.
Testing the API using Postman
- Postman provides a useful tool for testing API integration and can be run as a standalone application or through a web browser. Most importantly it allows you to quickly and easily test your R code. We’ll be providing more detailed tutorials on the application of APIs, including how to use Postman to test your cloud based Shaip. In the meantime the following provides an overview of running Postman to test your local code, you will need to make sure you are either running the local app version of Postman or install the Postman agent to allow Postman to interact with your the local plumber host:
Postman documentation overview | Postman Learning Center
- To start with we will provide a quick overview of using Postman to interact with your R plumber API. Once signed up for Postman you will be able to access your workspace and select to make an API request:

- The starting framework allows you to develop, run and test your Python code locally. The FastAPI environment provides a wrapper for your code to be accessed using a standard restful API environment. When your Python code is ready and you push your Shaip to the Shaipup dashboard it can be accessed by any language and you will be able to control who accesses it. It is important to note that the local development doesn’t include any of the Shaipup security wrappers. Once you push your code to the cloud this get’s automatically implemented and includes developing your data input schema to ensure all data is checked before being passed to your Shaip.
Summary
- Pull your code from your source repository to a local folder.
- Open the folder as a project in Positron, make sure the Git option is available in Positron.
- Setup uv to manage packages.
- Open the file ./pythonAlgoAPI/app/main.py and run the code making sure to note the port number allocated to the local host API.
- Use Postman either via the web app with the downloaded agent or a local downloaded app to connect and run your API.
- You are now ready to start developing and testing a local version of your Python Shaip.