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.
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
.
The build
module contains classes and methods used internally by Brownie to interact with files in a project's build/contracts
folder.
>>> from brownie.project import TokenProject
>>> TokenProject._build
<brownie.project.build.Build object at 0x7fb74cb1b2b0>
The following methods exist outside the scope of individually loaded projects.
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.
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.
The scripts
module contains methods for comparing, importing and executing python scripts related to a project.
The sources
module contains classes and methods to access project source code files and information about them.