Skip to main content
# py-solc

[![Build Status](https://travis-ci.org/pipermerriam/py-solc.png)](https://travis-ci.org/pipermerriam/py-solc)
[![PyPi version](https://pypip.in/v/py-solc/badge.png)](https://pypi.python.org/pypi/py-solc)
[![PyPi downloads](https://pypip.in/d/py-solc/badge.png)](https://pypi.python.org/pypi/py-solc)


Python wrapper around the `solc` Solidity compiler.


# Dependency

This library requires the `solc` executable to be present.

solc 0.3.5 or newer is required. [solc installation instructions](http://solidity.readthedocs.io/en/latest/installing-solidity.html)


# Quickstart

Installation

```sh
pip install py-solc
```

```python
>>> from solc import compile_source, compile_files, link_code
>>> compile_source("contract Foo { function Foo() {} }")
{
'Foo': {
'abi': [{'inputs': [], 'type': 'constructor'}],
'code': '0x60606040525b5b600a8060126000396000f360606040526008565b00',
'code_runtime': '0x60606040526008565b00',
'source': None,
'meta': {
'compilerVersion': '0.3.5-9da08ac3',
'language': 'Solidity',
'languageVersion': '0',
},
},
}
>>> compile_files(["/path/to/Foo.sol", "/path/to/Bar.sol"])
{
'Foo': {
'abi': [{'inputs': [], 'type': 'constructor'}],
'code': '0x60606040525b5b600a8060126000396000f360606040526008565b00',
'code_runtime': '0x60606040526008565b00',
'source': None,
'meta': {
'compilerVersion': '0.3.5-9da08ac3',
'language': 'Solidity',
'languageVersion': '0',
},
},
'Bar': {
'abi': [{'inputs': [], 'type': 'constructor'}],
'code': '0x60606040525b5b600a8060126000396000f360606040526008565b00',
'code_runtime': '0x60606040526008565b00',
'source': None,
'meta': {
'compilerVersion': '0.3.5-9da08ac3',
'language': 'Solidity',
'languageVersion': '0',
},
},
}
>>> unlinked_code = "606060405260768060106000396000f3606060405260e060020a6000350463e7f09e058114601a575b005b60187f0c55699c00000000000000000000000000000000000000000000000000000000606090815273__TestA_________________________________90630c55699c906064906000906004818660325a03f41560025750505056"
>>> link_code(unlinked_code, {'TestA': '0xd3cda913deb6f67967b99d67acdfa1712c293601'})
... "606060405260768060106000396000f3606060405260e060020a6000350463e7f09e058114601a575b005b60187f0c55699c00000000000000000000000000000000000000000000000000000000606090815273d3cda913deb6f67967b99d67acdfa1712c29360190630c55699c906064906000906004818660325a03f41560025750505056"
```

Release files for py-solc 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-solc 0.4.0
File Size Uploaded
py-solc-0.4.0.tar.gz 6.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for py-solc 0.4.0
File Interpreter ABI Platform
py_solc-0.4.0-py3-none-any.whl Python 3 none any Details
py-solc-0.4.0.macosx-10.11-x86_64.tar.gz Details

Total release size: 19.3 kB

Release files / py-solc-0.4.0.tar.gz

Download URL py-solc-0.4.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fea47556651bc7dbc8fd405a2bac928072080a1f3b05a568cac066925108c50b
BLAKE2b-256 checksum
How to use checksums
ad3940f59cd88c131ad99bd027be1dd349d909d9327ef9516383feaf7911e533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / py_solc-0.4.0-py3-none-any.whl

Download URL py_solc-0.4.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cc84abab4125b5fcf786b62cc1eba336544da1108355fb7bbd7db1640142d9a
BLAKE2b-256 checksum
How to use checksums
1ee04b18321443f47368d185956cf32e41e8f2488aaa52b7933e4688f55136f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / py-solc-0.4.0.macosx-10.11-x86_64.tar.gz

Download URL py-solc-0.4.0.macosx-10.11-x86_64.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d6b1351f60375887362105c97f51935b1d2965e5a279623051e274127d735de8
BLAKE2b-256 checksum
How to use checksums
6ffef531368c00a6bdcf61f0c0d0d28d3255d1805766a67aef9dd19f89d75d1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

3 release files

This release

0.4.0 This release

3 release files

0.3.0

3 release files

0.2.0

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page