Skip to content

Latest commit

 

History

History
634 lines (390 loc) · 24.2 KB

api-project.rst

File metadata and controls

634 lines (390 loc) · 24.2 KB

Project API

The project package contains methods for initializing, loading and compiling Brownie projects, and container classes to hold the data.

When Brownie is loaded from within a project folder, that project is automatically loaded and the ContractContainer <brownie.network.contract.ContractContainer> objects are added to the __main__ namespace. Unless you are working with more than one project at the same time, there is likely no need to directly interact with the top-level Project <brownie.project.main.Project> object or any of the methods within this package.

Only the project.main module contains methods that directly interact with the filesystem.

brownie.project.main

The main module contains the high-level methods and classes used to create, load, and close projects. All of these methods are available directly from brownie.project.

Project

Project Methods

TempProject

Module Methods

brownie.project.build

The build module contains classes and methods used internally by Brownie to interact with files in a project's build/contracts folder.

Build

>>> from brownie.project import TokenProject
>>> TokenProject._build
<brownie.project.build.Build object at 0x7fb74cb1b2b0>

Build Methods

Build Internal Methods

Internal Methods

The following methods exist outside the scope of individually loaded projects.

brownie.project.compiler

The compiler module contains methods for compiling contracts, and formatting the compiled data. This module is used internally whenever a Brownie project is loaded.

In most cases you will not need to call methods in this module directly. Instead you should use project.load <main.load> to compile your project initially and project.compile_source <main.compile_source> for adding individual, temporary contracts. Along with compiling, these methods also add the returned data to Project._build <brownie.project.build.Build> and return ContractContainer <brownie.network.contract.ContractContainer> objects.

Module Methods

brownie.project.ethpm

The ethpm module contains methods for interacting with ethPM manifests and registries. See the ethpm for more detailed information on how to access this functionality.

Module Methods

brownie.project.scripts

The scripts module contains methods for comparing, importing and executing python scripts related to a project.

Internal Methods

brownie.project.sources

The sources module contains classes and methods to access project source code files and information about them.

Sources

Module Methods