Skip to main content

Quick Start

Ape compiler plugin around VVM

Dependencies

Installation

via pip

You can install the latest release via pip:

pip install ape-vyper

via source

You can clone the repository and install for development:

git clone https://github.com/ApeWorX/ape-vyper.git
cd ape-vyper
uv sync --group dev
uv run prek install

Quick Usage

First, place Vyper contract source files (files with extension .vy) in your Ape project's contracts folder. An example Vyper contract can be found here. Then, from your root Ape project folder, run the command:

ape compile

The .vy files in your project will compile into ContractTypes that you can deploy and interact with in Ape.

Contract Flattening

For ease of publishing, validation, and some other cases it's sometimes useful to "flatten" your contract into a single file. This combines your contract and any imported interfaces together in a way the compiler can understand. You can do so with a command like this:

ape vyper flatten contracts/MyContract.vy build/MyContractFlattened.vy

Compiler Version

By default, the ape-vyper plugin uses version pragma for version specification. However, you can also configure the version directly in your pyproject.toml file:

[tool.vyper.version]
version = "0.3.7"

EVM Versioning

By default, ape-vyper will use whatever version of EVM rules are set as default in the compiler version that gets used, or based on what the #pragma evm-version ... pragma comment specifies (available post-v0.3.10). Sometimes, you might want to use a different version, such as deploying on Arbitrum or Optimism where new opcodes are not supported yet. If you want to require a different version of EVM rules to use in the configuration of the compiler, set it in your ape-config.yaml like this:

[tool.ape.vyper]
evm_version = "paris"

NOTE: The config value chosen will not override if a pragma is set in a contract.

Interfaces

You can not compile interface source files directly. Thus, you must place interface files in a directory named interfaces in your contracts_folder e.g. contracts/interfaces/IFace.vy. Then, these files can be imported in other .vy sources files via:

import interfaces.IFace as IFace

Alternatively, use JSON interfaces from dependency contract types by listing them under the import_remapping key:

[[tool.ape.dependencies]]
name = "VyperVoting"
github = "vyperlang/vyper"
contracts_folder = "examples/voting/"
version = "v0.3.8"

[tool.ape.vyper]
import_remapping = ["voting=VyperVoting@v0.3.8"]

Import the voting contract types like this:

# @version 0.3.10

import voting.ballot as ballot

Standalone Vyper interface files .vyi outside the interfaces directory compile into ABI-only ContractTypes. These artifacts are not deployable, but they can be used from Ape scripts to interact with already deployed contracts. For example, contracts/IFace.vyi interface can be used in a script:

from ape import project

iface = project.IFace.at("0x...")
iface.some_method()

Decimals

To use decimals on Vyper 0.4, use the following config:

[tool.ape.vyper]
enable_decimals = true

Pragmas

Ape-Vyper supports Vyper 0.3.10's new pragma formats

Version Pragma

#pragma version 0.3.10

EVM Version Pragma

#pragma evm-version paris

Optimization Pragma

#pragma optimize codesize

VVM CLI

You can install versions of Vyper using the ape vyper vvm CLI tools. List installed versions using:

ape vyper vvm list

To list the available Vyper versions, do:

ape vyper vvm list --available

Install more versions using the command:

ape vyper vvm install 0.3.7 0.3.10

Custom Output Format

To customize Vyper's output format (like the native -f flag), you can configure the output format: For example, to only get the ABI, do:

[tool.ape.vyper]
output_format = ["abi"]

To do this using the CLI only (adhoc), use the following command:

ape compile --config-override '{"vyper": {"output_format": ["abi"]}}'

Solc JSON Format

ape-vyper supports the socl_json format. To use this format, configure ape-vyper like:

[tool.ape.vyper]
output_format = ["solc_json"]

Note: Normally, in Vyper, you cannot use solc_json with other formats. However, ape-vyper handles this by running separately for the solc_json request.

Be sure to use the --force flag when compiling to ensure you get the solc JSON output.

ape compile file_needing_solc_json_format.vy -f

To get a dependency source file in this format, configure and compile the dependency.

[[tool.ape.dependencies]]
name = "my_dep"
config_override = { "vyper" = { "output_format" = ["solc_json"] } }

And then run:

ape pm compile --force

Metadata

Release files for ape-vyper 0.8.13

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

Source distribution (sdist)

Source distribution for ape-vyper 0.8.13
File Size Uploaded Provenance Actions
ape_vyper-0.8.13.tar.gz 75.9 kB With provenance Details for ape_vyper-0.8.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ape-vyper 0.8.13
File Interpreter ABI Platform Actions
ape_vyper-0.8.13-py3-none-any.whl Python 3 none any Details for ape_vyper-0.8.13-py3-none-any.whl

Total release size: 124.7 kB

Release files / ape_vyper-0.8.13.tar.gz

Download URL ape_vyper-0.8.13.tar.gz
Size 75.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b1033f0f630b6633a3681717db489d2f0102777fabf7796481ed5f0721b99f6c
BLAKE2b-256 checksum
How to use checksums
c2f143066b3b256925cb9d748e0494b4e6140f48e698673aa197fdc6cb172f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / ape_vyper-0.8.13-py3-none-any.whl

Download URL ape_vyper-0.8.13-py3-none-any.whl
Size 48.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfe1afa25ca0f4a69d3ba10a172099e1e9c86444297b266fd2cf6b748657341f
BLAKE2b-256 checksum
How to use checksums
d3e0a2d5b01742717bf5d21ac6cfcc58cb9b8d46ed19d5e1b7f36bed7e0c7a48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for ape-vyper 0.8.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ape_vyper-0.8.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.13 This release

2 release files Full provenance

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