Skip to main content

granite-common

Python library that provides enhanced prompt creation and output parsing for IBM Granite models.

Installation

To install from the main development branch, type:

pip install git+https://github.com/ibm-granite/granite-common.git

Developer setup

For compatibility with different underlying operating system versions, we recommend using conda to create a consistent base Python environment for development and testing.

Detailed instructions:

  1. Install MiniForge or another package that provides the conda command-line utility.
  2. Set the environment variable CONDA_HOME to point to the root of your conda install. If you installed MiniForge in your home directory, this value should be ${HOME}/miniforge3.
  3. Check out a copy of this repository.
  4. Run the script scripts/env.sh from the root of your local copy of the repository. The script will create a Conda environment in ./env and will install the source code of your local copy as an editable Pip package. The script will also install and enable pre-commit hooks with pre-commit.
  5. Before running commands such as python or jupyter from the command line, activate the Conda environment by typing conda activate ./env from the root of your local copy of this repository.
  6. If you are using Visual Studio Code or a similar IDE, configure your IDE to use the environment at ./env

Running tests

After following the instructions in the previous section, you should be able to run tests on your local machine by typing:

pytest tests

from the root of your local copy of this repository, using the conda environment described in the previous section.

The build automation for this project uses the tox environment manager. Sometimes you will need to run tests from inside a tox managed environment to replicate issues from the continuous integration environment. To run tests with tox, activate the Python environment ./env created earlier, then choose from among the following:

  • Run regression tests: tox -e unit
  • Run pylint checks: tox -e lint
  • Run ruff formatter: tox -e ruff
  • Run a full continuous integration suite: tox

Metadata

Release files for granite-common 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for granite-common 0.4.1
File Size Uploaded
granite_common-0.4.1.tar.gz 714.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for granite-common 0.4.1
File Interpreter ABI Platform
granite_common-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 800.7 kB

Release files / granite_common-0.4.1.tar.gz

Download URL granite_common-0.4.1.tar.gz
Size 714.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5290e03d43e2962218aaf13c9c43877af6fb7869332a4ea35983c4f6a206d801
BLAKE2b-256 checksum
How to use checksums
cd10ca8f59c644a3574a443bb85ff807f1ebbe726a6ad75bd471e092ab002f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 25, 2026.

Transparency log

Release files / granite_common-0.4.1-py3-none-any.whl

Download URL granite_common-0.4.1-py3-none-any.whl
Size 86.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e82df48f69a98b46dbff8a36c10a64a13d4400fed2425f2ad9a6981031544062
BLAKE2b-256 checksum
How to use checksums
a3eec52f5ddb073c111c19f15889646fd65e0be2b4e0b01764237d1ecbcd5bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page