Metadata-Version: 2.4
Name: snip-python
Version: 0.2.0
Summary: Python package to interface with Snip Lab Notebook 
Project-URL: Homepage, https://snip.roentgen.physik.uni-goettingen.de
Project-URL: Documentation, https://snip-python.readthedocs.io/
Project-URL: Repository, https://gitlab.gwdg.de/irp/snip
Author-email: "Sebastian B. Mohr" <sebastianbernd.mohr@uni-goettingen.de>
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: keyring>=25.3.0
Requires-Dist: nest-asyncio>=1.6.0
Requires-Dist: numpy>=2.1.2
Requires-Dist: pillow>=10.4.0
Requires-Dist: requests>=2.32.3
Requires-Dist: typer>=0.12.5
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: requests-mock>=1.12.1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: furo>=2024.8.6; extra == 'docs'
Requires-Dist: myst-nb>=1.1.2; extra == 'docs'
Requires-Dist: myst-parser>=4.0.0; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0.5.2; extra == 'docs'
Requires-Dist: sphinx-inline-tabs>=2023.4.21; extra == 'docs'
Requires-Dist: sphinx>=8.0.2; extra == 'docs'
Requires-Dist: sphinxcontrib-typer[html]>=0.5.0; extra == 'docs'
Provides-Extra: full
Requires-Dist: matplotlib>=3.9.2; extra == 'full'
Description-Content-Type: text/markdown

# Snip

![PyPI - Version](https://img.shields.io/pypi/v/snip-python?logoColor=green&color=%234bc51d)
[![Documentation Status](https://readthedocs.org/projects/snip-python/badge/?version=latest)](https://snip-python.readthedocs.io/en/latest/?badge=latest)

Python Package of quality of life and helper functions to interface with the Snip Lab Book. Allows to create and upload snippets with relative ease. Store and retrieve api tokens, and more.

## Features

<!-- start features -->

- **Token management**: Store and retrieve api tokens in a secure keyring or in a configuration files.
- **Python API**: Python API to create and upload snippets to your lab books.
- **CLI**: Command line interface to interact with the Snip API.

<!-- end features -->

## Quickstart

<!-- start quickstart -->

Snip-Lab is distributed on [PyPI]. To use the package:

1. Install the package using pip:

```bash
pip install snip-python
```
2. Use the `snip` command line interface (CLI) to interact with your lab books. For example, you can use the `snip token` command to store and retrieve your API tokens.

```bash
snip token --help
```

3. Create and upload snippets to your lab books programmatically using the Python API.

```python
from snip.snippets import ImageSnip

snip = ImageSnip.from_path("path/to/image.png", book_id="[YOUR_BOOK_ID]")

# show a preview of the snippet
snip.preview()
```

If you need help figuring out where to find the book id, please have a look [here](https://snip-python.readthedocs.io/en/latest/tokens.html#how-to-find-the-book-id).

```python
# upload the snippet
snip.upload()
```

The upload will automatically search your tokens in the keyring or in the configuration file and use the correct token to upload the snippet.

[pypi]: https://pypi.org/project/snip-python/

<!-- end quickstart -->


For more information, visit [documentation][quickstart-docs].

[quickstart-docs]: https://snip-python.readthedocs.io/en/latest/quickstart.html

