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
plans
import 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 thename
attribute inproject_info.csv
file to match current folder name.Examples
Import
plans
import 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
- __init__(name, alias=None)[source]#
Initialize the
FileSys
object.- Parameters:
folder_base (str) – path to File System folder location
name (str) – unique class name
alias (str) – unique object alias. If None, it takes the first and last characters from name
- 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.
- setter(dict_setter, load_data=False)[source]#
Set selected attributes based on an incoming dictionary.
- Parameters:
dict_setter (dict) – incoming dictionary with attribute values
- load_data()[source]#
Load data from file. Expected to overwrite superior methods.
- Parameters:
file_data (str) – file path to data.
- Returns:
None
- Return type:
None
- setup()[source]#
This method sets up all the FileSys structure (default folders and files)
Danger
This method overwrites all existing default files.