Algokit Examples Gallery

Python Hello World

Codespace

Creator Algorand Foundation

Source

python

smart-contract

Install with AlgoKit CLI

    algokit init example python-smart-contract

This template provides a beta template for developing and deploying Algorand Python smart contracts.

Features

Smart Contract Example

Welcome to your new AlgoKit project! This is an example of a Smart Contract.

Pre-requisites

These pre-requisites already come configured in the Github codespace, but you must have a github account to launch a codespace.

Initial Setup

  1. Open the example in a Github Codespace
    Click the CodeSpace button above to launch the project in a Codespace. This will launch a VM using your Github profile. This will automatically install the latest Algokit and run Localnet. The example comes pre-configured with a .env file that points to Localnet.

  2. Bootstrap Environment
    You needs to install all the dependencies in order to launch the example. The Algokit CLI comes equipped with a command that installs the dependencies in each of your projects.

# Install dependencies for contracts and frontend projects
algokit project bootstrap all
# Install dependencies for projects that use npm
algokit project bootstrap npm
# Install dependencies for projects that use python via poetry
algokit project bootstrap poetry

Development Workflow

Command Line

Project Features

Smart Contract Generation

Debugging Support

Tools & Technologies

Project Structure

The workspace uses a projects directory as the default location for new projects. Each sub-project contains its own README with specific setup instructions.

Additional Resources

# pyright: reportMissingModuleSource=false
from algopy import ARC4Contract, String
from algopy.arc4 import abimethod

class HelloWorld(ARC4Contract):
    @abimethod()
    def hello(self, name: String) -> String:
        return "Hello, " + name