Skip to content

magiclabs/magic-flow-python

 
 

Repository files navigation

Magic Flow Python SDK

A comprehensive Python SDK for building applications that interact with the Flow blockchain network. This SDK provides a complete set of tools for developers to query, transact, and build on Flow.

PyPI codecov Python License

Features

  • 🔗 Complete Flow Integration - Full support for Flow blockchain operations
  • 🚀 Async/Await Support - Modern Python async programming patterns
  • 🔐 Advanced Signing - Support for complex transaction signing scenarios
  • 📊 Query Capabilities - Query blocks, accounts, events, and transactions
  • 🛠️ Script Execution - Execute Cadence scripts on the Flow network
  • 🏗️ Account Management - Create and manage Flow accounts
  • 📝 Contract Deployment - Deploy, update, and manage smart contracts
  • 🧪 Emulator Compatible - Works with Flow Emulator for local development

Quick Start

Installation

Requires Python 3.10 or higher.

pip install magic-flow

Or with Poetry:

poetry add magic-flow

Basic Usage

import asyncio
from magic_flow.client import flow_client

async def main():
    async with flow_client(host="127.0.0.1", port=3569) as client:
        # Get the latest block
        block = await client.get_latest_block()
        print(f"Latest block height: {block.height}")

        # Get account information
        account = await client.get_account(address="0x01")
        print(f"Account balance: {account.balance}")

if __name__ == "__main__":
    asyncio.run(main())

Documentation

Development

This SDK is fully compatible with the Flow Emulator and can be used for local development.

Requirements

  • Python 3.10+
  • Flow Emulator (for local development)

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributors

Made with contrib.rocks.

About

Python SDK for Flow with updated dependencies and Python 3.13 support.

Resources

License

Contributing

Stars

Watchers

Forks

Languages

  • Python 99.9%
  • Makefile 0.1%