micropy.project

Module for generating/managing projects.

Classes

Project(path[, name])

Micropy Project.

class micropy.project.Project(path, name=None, **kwargs)

Bases: micropy.project.modules.modules.ProjectModule

Micropy Project.

Parameters
  • path (str) – Path to project root.

  • name (str, optional) – Name of Project. Defaults to None. If none, uses name of current directory.

add(component, *args, **kwargs)

Adds project component.

Parameters

component (Any) – Component to add.

property cache

Project wide cache.

Return type

Config

Returns

Cache instance

property config

Project Configuration.

Returns

Project Config Instance

Return type

Config

property context

Project context used in templates.

Returns

Current context

Return type

Config

create()

Creates new Project.

Returns

Path relative to current active directory.

Return type

Path

property exists

Whether this project exists.

Returns

True if it exists

Return type

bool

iter_children_by_priority()

Iterate project modules by priority.

Yields

the next child item

Return type

Iterator[Type[ProjectModule]]

load(**kwargs)

Loads all components in Project.

Return type

Project

Returns

Current Project Instance

remove(component)

Removes project component.

Parameters

component (Any) – Component to remove.

update()

Updates all project components.

Returns

Current active project.