Member-only story
Deploy a Smart Contract using Python: How-to
Python has numerous tools including brownie and web3.py that allow users to become a blockchain engineer.

In this article, we are going to deploy smart contracts using Python. This means that, if you know some Python, this could be your transition into smart contract and blockchain development!
Introduction
I love Python, it has such an amazing developer experience. There is something so sweet about being able to just write print("hi")
and not having to do anything verbose like System.out.println("hi")
. This sentiment is shared by many, including those in the fintech world. Many of the hedge funds I’ve worked with (and worked at) have used Python as their main language.
I wish I could take Python with me everywhere. And even though Solidity (Ethereum’s native smart contract language) isn’t Python, it has a lot of nice features, and can still be deployed with Python. When I first started working with Solidity, I used Remix, a strong web IDE that allows you to visualize your smart contracts. Remix is great and I still use it, but a lot of productivity can be accomplished outside of a single IDE. This was when I started to learn about Truffle and HardHat, which are Nodejs frameworks for deploying smart contracts.
These are the dominant frameworks I’ve seen by far, and this is all great but we don’t like Javascript, we like Python. So I was excited to find Brownie and web3.py; a Python framework to deploy smart contracts and an open-sourced repo for working with blockchains. We will be looking at both Brownie and Web3.py in this article.
Why Python?
There is a reason why so many data scientists, academics, and fintech institutions use Python. It’s such a versatile language, has an easy developer experience, and is jam-packed with packages to make life easier. Top defi projects are starting to realize this, with projects like yearn.finance using python to deploy all their production code. Yearn.finance is run by a group of really talented fintech engineers turned blockchain, and they took with them the tool that they know and love, Python. Also it doesn’t touch npm, but I’ll leave my distaste for javascript package…