Skip to main content

LLM fragments plugin for PyPI packages metadata

Project description

llm-fragments-pypi

Load PyPI package metadata as LLM fragments.

Installation

Install this plugin in the same environment as LLM.

llm install llm-fragments-pypi

Usage

Use -f pypi:package_name to include the package's README and metadata as fragments.

# Retrieve a package's latest version
llm -f pypi:polars "How does the performance of polars compare to pandas?"

You can optionally specify a version with the @version suffix:

# Retrieve a specific version
llm -f pypi:pydantic@1.6 "What are the Python versions supported by pydantic?"

You can combine multiple fragments:

llm -f pypi:litestar -f pypi:fastapi \
  "What are some similarities and differences between litestar and fastapi?"

And combine with other llm features:

$ llm --schema-multi "package,version" \
  -f pypi:polars \
  -f pypi:pandas \
  "What's the latest version of each package?" \
| jq .items

[
  {
    "package": "polars",
    "version": "1.27.1"
  },
  {
    "package": "pandas",
    "version": "2.2.3"
  }
]

Development

Local Setup

To set up this plugin locally, use uv:

uv run llm install -e .

It'll take care of creating a virtual environment, installing the dependencies, and you can run a uv run llm instance that will use the local version of the plugin.

Dev dependencies

Install the dev dependencies in your local environment:

uv sync --group dev

Linting & formatting

You can format and lint the code with ruff:

uv run ruff format .
uv run ruff check .

And run the pre-commit hooks:

uv run pre-commit install

Tests

Run tests:

uv run pytest

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

llm_fragments_pypi-0.1.1.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

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

llm_fragments_pypi-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_fragments_pypi-0.1.1.tar.gz.

File metadata

  • Download URL: llm_fragments_pypi-0.1.1.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.14

File hashes

Hashes for llm_fragments_pypi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 efb782eeffcfdbe244c8b553e7dc4f93397588bfdc463f9bec893da221471d78
MD5 9dab880cc1c26e8446ca63062461621a
BLAKE2b-256 81452de7961cd7b9e88ef93ca73f30c826d756d3e1b0d112ad2ce75d21a61623

See more details on using hashes here.

File details

Details for the file llm_fragments_pypi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_fragments_pypi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 751cf41f8c75e8dae5ebee132226a4afa1ed28c5288bfd8e74a6fa285ef544fc
MD5 000b9a7b905ff6134277dd26b2a4bcc8
BLAKE2b-256 10c62340fecb58ed60aeb55c851d8e0ee1e8ce2347e1ca401e3d53bd4454d480

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