mavsec.project.ProjectInfo
- class mavsec.project.ProjectInfo(name: str, version: str, description: str, proj_file: str | Path | None = None)
Bases:
SchemaInformation about the project.
- __init__(name: str, version: str, description: str, proj_file: str | Path | None = None) None
Methods
__init__(name, version, description[, proj_file])check()Check the project for issues.
from_dict(data)Get a cls object from a dictionary.
from_file(path)Get a cls object from a file.
from_json(path)Get a cls object from a JSON file.
from_toml(path)Get a cls object from a TOML file.
from_yaml(path)Get a cls object from a YAML file.
to_dict()Convert the object to a dictionary.
to_json(path)Write the object to a JSON file.
to_toml(path)Write the object to a TOML file.
to_yaml(path)Write the object to a YAML file.
Attributes
Path to the project file.
Name of the project.
Version of the project.
Description of the project.
- check() ProjectCheckResult
Check the project for issues.
- description: str
Description of the project.
- classmethod from_dict(data: dict) SchemaT
Get a cls object from a dictionary.
- Parameters:
data (dict) – The dictionary to convert to a cls object.
- Returns:
The Schema object.
- Return type:
cls
- classmethod from_file(path: str | Path) SchemaT
Get a cls object from a file.
- Parameters:
path (str) – The path to the file.
- Returns:
The cls object.
- Return type:
cls
- classmethod from_json(path: str | Path) SchemaT
Get a cls object from a JSON file.
- Parameters:
path (str) – The path to the JSON file.
- Returns:
The cls object.
- Return type:
cls
- classmethod from_toml(path: str | Path) SchemaT
Get a cls object from a TOML file.
- Parameters:
path (str) – The path to the TOML file.
- Returns:
The cls object.
- Return type:
cls
- classmethod from_yaml(path: str | Path) SchemaT
Get a cls object from a YAML file.
- Parameters:
path (str) – The path to the YAML file.
- Returns:
The cls object.
- Return type:
cls
- name: str
Name of the project.
- proj_file: str | Path | None = None
Path to the project file.
- to_dict() dict
Convert the object to a dictionary. proj_file is deliberately not included in the dictionary.
- Returns:
The dictionary.
- Return type:
dict
- to_json(path: str | Path) None
Write the object to a JSON file.
- Parameters:
path (str) – The path to the JSON file.
- to_toml(path: str | Path) None
Write the object to a TOML file.
- Parameters:
path (str) – The path to the TOML file.
- to_yaml(path: str | Path) None
Write the object to a YAML file.
- Parameters:
path (str) – The path to the YAML file.
- version: str
Version of the project.