OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Py Solc

Py Solc is a Python library that wraps the solc Solidity compiler, letting Python programs invoke compilation and related compiler functions. It provides interfaces for compiling source strings, files and standard JSON input, as well as linking compiled code. The solc executable must be installed separately unless using the library's experimental installer for listed older versions.

Independent OpenViST project profile, based on linked sources.

Py Solc — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Py Solc when a Python workflow needs to invoke solc for Solidity compilation, including source-string, file-based or standard JSON compilation.

Who it is for

  • Python developers building tools or scripts for Solidity projects.
  • Teams that want to include Solidity compilation in local Python development workflows.

Documented uses

  • Compile Solidity source text from a Python program.
  • Compile one or more Solidity files from a script.
  • Submit standard JSON compilation input and handle the returned compiler output.
  • Link compiled bytecode by replacing a library placeholder.
Before you choose

Requirements & limits

  • The solc executable is a separate required dependency; set SOLC_BINARY to specify its path.
  • The project supports and tests solc versions 0.4.2 and later, while noting other versions may work.
  • The documented installer for specific older solc versions is experimental and subject to breaking changes.
  • The repository metadata specifies an MIT license.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Py Solc for a Python project

Install the Python wrapper and prepare its separately installed Solidity compiler dependency.

Before you start

  • Python package installer, pip
  • The solc executable; the project documents supported and tested versions 0.4.2 and later

Steps

  1. Install the wrapper with the command below.

    Documented command
    pip install py-solc
  2. Install the solc executable separately, following the Solidity installation instructions linked by the project.

  3. If needed, point Py Solc to the compiler binary by setting the SOLC_BINARY environment variable.

Expected outcome

The Python package is installed and configured to use a solc executable for compiler calls.

Guide limitations

  • Compiler versions 0.4.2 and later are the versions the project says it supports and tests; other versions may work.
  • The package's optional compiler installer is experimental and subject to breaking changes.
Source-based practical guide

Compile Solidity through Python

Call the documented Py Solc compilation functions with Solidity source or standard JSON input.

Before you start

  • Py Solc installed
  • A solc executable available to Py Solc

Steps

  1. Import compile_source or compile_files from solc for legacy combined JSON compilation, or import compile_standard for standard JSON compilation.

  2. Pass Solidity source text to compile_source, file paths to compile_files, or a standard JSON input object to compile_standard.

  3. For file-based standard JSON input that uses source URLs, pass the documented allow_paths argument for the source directory.

Expected outcome

The Python call returns compiler output containing contract, source and error information, as shown in the project's examples.

Guide limitations

  • The examples document compiler invocation and output, not deployment or on-chain execution.
  • The compiler executable is a separate dependency.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
ethereum/py-solc · Official homepage title · retained in its source language