## project.ProjectManager


Usage

``` python
project.ProjectManager(username=None)
```


## Attributes

| Name | Description |
|----|----|
| [labrat_file](#labrat_file) | Get the path to the .labrat config file. |

------------------------------------------------------------------------


#### labrat_file


Get the path to the .labrat config file.


`labrat_file`


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize the project manager with a default username. |
| [add_template()](#add_template) | Add a new project template. |
| [archive_project()](#archive_project) | Archive a project directory to a timestamped archive folder. |
| [delete_project()](#delete_project) | Archive and delete a project directory. |
| [list_project_files()](#list_project_files) | List all files within the given project directory. |
| [list_projects()](#list_projects) | List all projects stored in the .labrat file. |
| [new_project()](#new_project) | Create a new project and update its metadata in the .labrat file. |
| [update_project()](#update_project) | Update the last modified timestamp for an existing project. |

------------------------------------------------------------------------


#### \_\_init\_\_()


Initialize the project manager with a default username.


Usage

``` python
__init__(username=None)
```


##### Parameters


`username: str = None`  
The user's name. Defaults to the value in .labrat or 'default_user'.


------------------------------------------------------------------------


#### add_template()


Add a new project template.


Usage

``` python
add_template(name, url)
```


##### Parameters


`name: str`  
The name of the template.

`url: str`  
The repository URL of the template.


##### Raises


`ValueError`  
If the template name already exists.


------------------------------------------------------------------------


#### archive_project()


Archive a project directory to a timestamped archive folder.


Usage

``` python
archive_project(project_path, archive_base_dir)
```


##### Parameters


`project_path: str or Path`  
The path to the project directory.

`archive_base_dir: str or Path`  
The base directory for storing archives.


##### Returns


`str`  
Path to the created archive directory.


------------------------------------------------------------------------


#### delete_project()


Archive and delete a project directory.


Usage

``` python
delete_project(project_path, archive_base_dir)
```


##### Parameters


`project_path: str or Path`  
The path to the project directory.

`archive_base_dir: str or Path`  
The base directory for storing archives.


##### Raises


`ValueError`  
If the project path does not exist or is not a directory.


------------------------------------------------------------------------


#### list_project_files()


List all files within the given project directory.


Usage

``` python
list_project_files(project_path)
```


##### Parameters


`project_path: str`  
The path to the project.


##### Returns


`list`  
A list of file paths within the project directory.


------------------------------------------------------------------------


#### list_projects()


List all projects stored in the .labrat file.


Usage

``` python
list_projects()
```


##### Returns


`list`  
A list of project metadata dictionaries.


------------------------------------------------------------------------


#### new_project()


Create a new project and update its metadata in the .labrat file.


Usage

``` python
new_project(project_type, project_name, project_path, description)
```


##### Parameters


`project_type: str`  
The type of project.

`project_name: str`  
The name of your project.

`project_path: str`  
The destination path of the project.

`description: str`  
A description of the project.


##### Raises


`ValueError`  
If the project type is not valid.


------------------------------------------------------------------------


#### update_project()


Update the last modified timestamp for an existing project.


Usage

``` python
update_project(project_path)
```


##### Parameters


`project_path: str`  
The path to the project to update.
