Skip to main content

Python wrapper around the solc binary

Project description

# 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.


# Quickstart

Installation

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

```python
>>> from solc import compile_source, compile_files
>>> 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',
},
},
}
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-solc-0.1.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distributions

py_solc-0.1.0-py2-none-any.whl (7.6 kB view hashes)

Uploaded Python 2

py-solc-0.1.0.macosx-10.11-x86_64.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page