py-solc-x
Python wrapper and version management tool for the solc Solidity compiler.
What it is and what it does
py-solc-x is a Python wrapper around the Solidity compiler that handles both installation and invocation of solc. It lets you install and manage multiple versions of the compiler on your system, then call them from Python code to compile Solidity smart contracts. The package abstracts away platform-specific compiler setup—handling downloads and builds for Linux, macOS, and Windows—so you can focus on compilation logic rather than toolchain management.
The package is commonly used in Ethereum development workflows where Python tools need to compile Solidity code as part of a build or test pipeline. It depends on requests and packaging for downloading compiler binaries and version parsing, keeping the dependency footprint minimal. The project is actively maintained and supports Python 3.8, 3.9, 3.10, and 3.11.
Use it for:
- Compile Solidity smart contracts from within a Python test suite or build script without manual compiler installation.
- Manage multiple Solidity compiler versions in a single development environment for testing contract compatibility.
- Automate Solidity compilation as part of a Python-based Ethereum development framework or CI/CD pipeline.
- Build Python tools for Ethereum that need to compile contracts on-the-fly without requiring users to install solc separately.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Manages installation and version control of the Solidity compiler (solc) for Python, allowing you to work with multiple solc versions.
Yes. Low install friction, active maintenance, no known vulnerabilities, and permissive MIT licensing make this a straightforward choice for Python projects that need Solidity compilation. Install it if you're building Ethereum tooling in Python and need compiler version flexibility.
Install
py-solc-x on PyPI
pip
pip install py-solc-xuv
uv add py-solc-xpoetry
poetry add py-solc-xInstalling py-solc-x
Before you install
Low friction install with only two lightweight runtime dependencies (requests and packaging). Actively maintained with stable production status.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install py-solc-x
from py_solc_x import compile_standard
compile_standard({"language": "Solidity", "sources": {...}})
Compiling from source requires system-level solc build dependencies; prebuilt binaries are available for Linux, macOS, and Windows.
Verify before relying
- Whether prebuilt solc binaries are automatically downloaded or require manual setup.
- Performance characteristics when switching between multiple installed solc versions.
- Specific Solidity versions beyond >=0.4.11 that are actively tested and supported.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — requests, packaging |
| Maintenance | actively maintained — 247 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 222,485/month — #9,263 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_solc_x-2.0.5-py3-none-any.whl
Keywords: ethereum, solidity, solc
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
solc-selectManages installation and switching between…
agpl · top 15,000 on PyPI
crytic-compileCrytic-compile abstracts smart contract…
agpl · top 15,000 on PyPI
eth-brownieBrownie is a Python framework for developing,…
permissive · top 15,000 on PyPI
py-evmPy-EVM is a Python implementation of the…
permissive · top 15,000 on PyPI
pccmPCCM manages Python-to-C++ code generation and…
permissive · top 15,000 on PyPI
eth-typingProvides standardized type annotations for…
permissive · top 5,000 on PyPI
pbs-installerDownloads and installs python-build-standalone…
permissive · top 1,000 on PyPI
ssh-pythonPython bindings to the libssh C library for SSH…
copyleft · top 15,000 on PyPI
nvidia-cuda-nvcc-cu12Provides the NVIDIA CUDA nvcc compiler for…
unclear · top 5,000 on PyPI