Skip to main content

Python package to interface with Snip Lab Notebook

Project description

Snip

PyPI - Version Documentation Status

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

  • 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.
  • API Wrappers: Wrappers for the Snip API to make requests and handle responses.

Quickstart

Snip is distributed on PyPI. To use the package:

  1. Install the package using pip:
pip install snip-python
  1. 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.
snip token --help
  1. Create and upload snippets to your lab books programmatically using the Python API.
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.

# 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.

For more information, visit documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snip_python-0.3.1.tar.gz (298.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snip_python-0.3.1-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file snip_python-0.3.1.tar.gz.

File metadata

  • Download URL: snip_python-0.3.1.tar.gz
  • Upload date:
  • Size: 298.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for snip_python-0.3.1.tar.gz
Algorithm Hash digest
SHA256 501cbe4e482b9c4931d821a9486e49fa840de9407b0294c0ce4ac97534418cee
MD5 7018df6d0089e3259bee279911ed0b77
BLAKE2b-256 7d1974d22f46115e242f0159c1f3b49d1a0ccede07653940d007405e92f845e6

See more details on using hashes here.

File details

Details for the file snip_python-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: snip_python-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for snip_python-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8570c25d350330036a780e4bb1bc34140a11cf40c92d42e4b74b3242f2738498
MD5 53750ce4b5c6faca2f639fb95dd6f172
BLAKE2b-256 3d853e3789693804e7ffd4c62f893409e5e1d04323445cd0d62a2ab6fcd10f74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page