## filemanager.Archiver


Archive folders and files.


Usage

``` python
filemanager.Archiver(
    source_dir,
    archive_dir,
)
```


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize logger and archive parameters. |
| [archive()](#archive) | Perform the archive by copying the source directory to the archive directory |
| [get_archive_dir()](#get_archive_dir) | Generate a timestamped archive directory path. |

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


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


Initialize logger and archive parameters.


Usage

``` python
__init__(source_dir, archive_dir)
```


##### Parameters


`source_dir: str or Path`  
The directory to copy or archive.

`archive_dir: str or Path`  
The destination directory for the archive.


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


#### archive()


Perform the archive by copying the source directory to the archive directory


Usage

``` python
archive()
```


and then creating a zip file of the archived folder.


##### Raises


`SameFileError`  
If the source and destination are the same.

`OSError`  
For other filesystem-related errors.


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


#### get_archive_dir()


Generate a timestamped archive directory path.


Usage

``` python
get_archive_dir(base_dir, project_name)
```


##### Parameters


`base_dir: str or Path`  
The base directory where archives are stored.

`project_name: str`  
The name of the project being archived.


##### Returns


`Path`  
A path to the timestamped archive directory.
