Metadata-Version: 2.4
Name: gamster
Version: 0.6.4
Summary: Convert local GAMS object directories to BagitFiles.
Author-email: Fabio Tosques <fabio.tosques@uni-graz.at>, Gunter Vasold <gunter.vasold@uni-graz.at>
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: click>=8.4.2
Requires-Dist: gamslib>=0.8.5
Description-Content-Type: text/markdown

# Gamster

## Overview

`gamster` creates bag directories from *GAMS object directories*, which can then be ingested into GAMS.
The program can also convert bags back into GAMS object directories.

The command for creating Bags is `gamster create <PATH>`.

The command for "unpacking" Bags into GAMS object directories is:
`gamster unpack <PATH>`

```mermaid
graph LR
    subgraph A[Object directory]
    AA[Must contain files 
    that belong to the digital object,
    plus 'DC.xml', 
    'object.csv', and
    'datastreams.csv']
    end
    subgraph B[BAG]
    BB[Data structure
     in Bag format
     that can be ingested,
     i.e. one
     Bag directory 
     per digital object]
    end
    A -->|gamster create| B[Bag file]
```

Using `unpack`, an object directory can be recreated from a bag directory at any time.

```mermaid
graph LR
        subgraph A[Object directory]
        AA[Must contain files 
        that belong to the digital object,
        plus 'DC.xml', 
        'object.csv', and
    'datastreams.csv']
    end
    subgraph B[BAG]
        BB[Data structure
         in Bag format
         that can be ingested,
         i.e. one
         Bag directory 
         per digital object]
    end
        B[BAG] -->|gamster unpack| A[Object directory]
  
```
At the moment, only a command-line interface (CLI) is available. A GUI is planned.

## Installation

### Without explicit installation

If the user has `uv` installed, `gamster` can be run directly without prior
installation via `uvx gamster` (or `uv tool install gamster`).
If needed, a suitable Python installation and virtual environment are created
in the background.

### Traditional installation

`pip install gamster`. We strongly recommend using a dedicated virtual
environment for this.
`gamster` and `gamspreprocessing` can be installed in the same virtual
environment.


## Usage
## Create Bags from object directories

`gamster create` creates Bags.

In the simplest form, this command is sufficient:
```
gamster create <PATH>
```

    * `PATH` can be a single object directory or a
        directory that contains multiple object directories.

By default, the generated Bags are created in the `./bags` directory.

`gamster create` supports several options that control its behavior. Details
are available via `gamster create --help` or in the
[Online-Dokumentation](https://dhgraz.github.io/gamster/)



## Convert Bags into an object directory

To create an object directory from a Bag, this command is sufficient:
`gamster unpack <PATH>`. `PATH` is either the path to the bag to unpack or
to a directory that contains bags to unpack (these are also searched for in
subdirectories). `unpack` can handle both bag directories and zipped bags.
Here is a complete example that converts all bags in the `bags` directory into
object directories and creates them in the `objects` directory:

```
gamster unpack -o objects bags
```

All available options are shown via `gamster unpack --help` and in the
[online documentation](https://dhgraz.github.io/gamster/).
