Installation

## Installation

It is recommended to install this package in a Python [virtual environment](https://docs.python.org/3/library/venv.html).
This will allow you to manage the package and its dependencies separately from other Python packages on your system.

To create a virtual environment and activate it, use the following commands:

```bash
python -m venv env
source env/bin/activate
```

Replace `env` with the desired name of your virtual environment.
If you succeeded, the prompt will show now `(env) $` instead of `$`.
To deactivate the virtual environment use the `deactivate` command.


### Requirements

This project requires Python 3.10 or higher.
The package dependencies can be found in the [`pyproject.toml`](pyproject.toml) file and include `click`, `pandas`, `matplotlib`, `simple-term-menu`, `jinja2`, and `tqdm`.


### Installing with pip

To install the latest stable release of the package, use pip:

```bash
pip install xrd-tools
```

You can also install the package from the Git repository using pip:

```bash
# Via https
pip install git+https://codeberg.org/Cs137/xrd-tools.git

# Via ssh
pip install git+ssh://git@codeberg.org:Cs137/xrd-tools.git
```

Please note that the [installation via ssh does not work if you install from a private repository and your ssh keys are protected with a passphrase](https://github.com/pypa/pip/issues/7308).


### Installing for development

To install the package in development mode, clone the Git repository and install the package using Poetry, as shown in the code block underneath.
To install Poetry, which is required for development and testing, follow the instructions on the [Poetry website](https://python-poetry.org/docs/#installation).

```bash
git clone https://codeberg.org/Cs137/xrd-tools.git
cd xrd-tools
poetry install
```

This will install the package in editable mode, allowing you to make changes to the code and see the effects immediately (comparable to `pip install -e`).

<!-- To run the tests, use the following command: -->

<!-- ```bash -->
<!-- poetry run pytest -->
<!-- ``` -->