plans.project#
Project-related classes and routines
Overview#
# todo [major docstring improvement] – overview Mauris gravida ex quam, in porttitor lacus lobortis vitae. In a lacinia nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Functions
|
Loads a Project from folder |
|
Create a new Project from a specification dictionary. |
Classes
|
- plans.project.new_project(specs)[source]#
Create a new Project from a specification dictionary.
Danger
This method overwrites all existing default files.
- Parameters:
specs (dict) –
Dictionary containing project specifications.
Required keys:
folder_base(str): Path where the project folder will be created.name(str): Name of the project.
Optional keys:
alias(str): Alternative identifier. Defaults toNone.source(str): Source reference. Defaults to empty string.description(str): Project description. Defaults to empty string.
- Raises:
ValueError – If any required key is missing.
- Returns:
A new :class:`plans.Project instance initialized with the given specifications.
- Return type:
plans.Project
Examples
Import
plansimport plans
Create a new
plans.Project. First setup details.# [CHANGE THIS] setup specs dictionary project_specs = { "folder_base": "C:/plans", # change this path "name": "newProject", "alias": "NPrj", "source": "Me", "description": "Just a test" }
Then call
new_project()plans.new_project(specs=project_specs)
Create and get the project instance:
prj = plans.new_project(specs=project_specs)
- plans.project.load_project(project_folder)[source]#
Loads a Project from folder
- Parameters:
project_folder (str or Path) – path to project root folder
- Returns:
A new :class:`plans.Project instance.
- Return type:
plans.Project
Notes
Warning
load_project()will overwrite thenameattribute inproject_info.csvfile to match current folder name.Examples
Import
plansimport plans
Load an existing
plans.Project# get project instance pj = plans.load_project(project_folder="path/to/project/folder")
- class plans.project.Project(name, alias=None)[source]#
Bases:
FileSys- setter(dict_setter, load_data=False)[source]#
Set selected attributes based on an incoming dictionary.
- Parameters:
dict_setter (dict) – incoming dictionary with attribute values
- setup()[source]#
This method sets up the FileSys structure (default folders and files)
Danger
This method overwrites all existing default files.
- get_metadata()[source]#
Get a dictionary with object metadata.
- Returns:
dictionary with all metadata
- Return type:
dict
Warning
Metadata does not necessarily include all object attributes.