Metadata-Version: 2.4
Name: sigmabam2openbis
Version: 0.0.2
Summary: Mapper script to convert SigmaBAM chemical inventory exports into openBIS-compatible format. 
Author-email: Tom Rousseau <tom.rousseau@bam.de>, "Jose M. Pizarro" <jose.pizarro-blanco@bam.de>
Maintainer-email: Tom Rousseau <tom.rousseau@bam.de>, "Jose M. Pizarro" <jose.pizarro-blanco@bam.de>
License: MIT License
        
        Copyright (c) 2025 Bundesanstalt für Materialforschung und -prüfung
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/BAMresearch/sigmabam2openbis
Project-URL: Bug Tracker, https://github.com/BAMresearch/sigmabam2openbis/issues
Classifier: Natural Language :: English
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pybis~=1.37.1rc4
Requires-Dist: pandas
Requires-Dist: bam-masterdata>=0.8.4
Provides-Extra: dev
Requires-Dist: mypy==1.0.1; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-timeout; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Provides-Extra: tuto
Requires-Dist: marimo; extra == "tuto"
Dynamic: license-file


You can use this package to parse SigmaBAM files in openBIS. There are two resources used for automating the parsing of such files:

1. Using the Python script in  `tutorials/parser_tutorial.py`. This script uses the parser class defined in `src/sigmabam2openbis/parser.py` and the [`bam-masterdata`](https://github.com/BAMresearch/bam-masterdata) parser infrastructure. **We recommend using this tutorial**. To run it, after setting up your environment (see below), run in the terminal `python tutorials/parser_script.py`.
2. Using the _Jupyter notebook_ from `tutorials/chemical_data_inventory_openbis_mapper_1_0.ipynb`. This tutorial uses [PyBIS](https://pypi.org/project/pybis/).


## Development

If you want to develop locally this package, clone the project and enter in the workspace folder:

```bash
git clone https://github.com/BAMresearch/sigmabam2openbis.git
cd sigmabam2openbis
```

Create a virtual environment (you can use Python>=3.10) in your workspace:

- **Using venv**:
  ```bash
  python3 -m venv .venv
  source .venv/bin/activate  # in Windows (cmd): source .venv\Scripts\activate
  ```
- **Using conda**:
  ```bash
  conda create --name .venv pip
  conda activate .venv
  ```

Install the package in editable mode (with the flag `-e`):
```bash
pip install --upgrade pip
pip install -e '.[dev]'
```

**Note**: In order to install faster the package, you can use [`uv`](https://docs.astral.sh/uv/) for pip installing Python packages:
```bash
pip install --upgrade pip
pip install uv
uv pip install -e '.[dev]'
```


### Run the tests

You can locally run the tests by doing:

```bash
python -m pytest -sv tests
```

where the `-s` and `-v` options toggle the output verbosity.

You can also generate a local coverage report:

```bash
python -m pytest --cov=src tests
```

### Run auto-formatting and linting

We use [Ruff](https://docs.astral.sh/ruff/) for formatting and linting the code following the rules specified in the `pyproject.toml`. You can run locally:

```bash
ruff check .
```

This will produce an output with the specific issues found. In order to auto-fix them, run:

```bash
ruff format .
```

If some issues are not possible to fix automatically, you will need to visit the file and fix them by hand.
