Skip to main content

Extract structured coffee bean info from package or card images using Vision LLM

Project description

bean-lens

Extract structured coffee bean info from package or card images using Vision LLM.

Installation

pip install bean-lens

Or with uv:

uv add bean-lens

Setup

Get a Gemini API key from Google AI Studio and set it as an environment variable:

export GEMINI_API_KEY=your-api-key

Usage

Python

from bean_lens import extract

result = extract("coffee_package.jpg")

print(result.roastery)        # "Fritz Coffee"
print(result.origin.country)  # "Ethiopia"
print(result.flavor_notes)    # ["Citrus", "Jasmine", "Honey"]

CLI

bean-lens image.jpg

Output:

  bean-lens

  Roastery:      Fritz Coffee
  Name:          Ethiopia Yirgacheffe
  Origin:        Ethiopia / Yirgacheffe / Konga
  Variety:       Heirloom
  Process:       Washed
  Roast Level:   Light
  Flavor Notes:  Citrus, Jasmine, Honey
  Roast Date:    2024.01.15
  Altitude:      1,800-2,000m

JSON output:

bean-lens image.jpg --json

Extracted Fields

Field Description
roastery Roastery or brand name
name Coffee bean name
origin Origin info (country, region, farm)
variety Coffee varieties (e.g., Geisha, Typica)
process Processing method (e.g., Washed, Natural)
roast_level Roast level (e.g., Light, Medium, Dark)
flavor_notes Flavor notes list
roast_date Roast date
altitude Growing altitude

License

MIT

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

bean_lens-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

bean_lens-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file bean_lens-0.1.0.tar.gz.

File metadata

  • Download URL: bean_lens-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bean_lens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 61d1b9a3e36d680ec4abc0618bc52e70c3d58922cc96e4cb9decb84e3709f86a
MD5 dc2b013efbd1f4162ffb824131c6c26e
BLAKE2b-256 631a47e124d6343f6a5f4eadd254f5c9e612ecd9bff6e5b6a5492744c09dd7a7

See more details on using hashes here.

File details

Details for the file bean_lens-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bean_lens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bean_lens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0e7445a1cb75c0bdefbf266d045f374601eccb3c4f3aac919aaad74c5150a57
MD5 5e7389a16d6c24a8ee5c8e339eeef808
BLAKE2b-256 001e63dc8851005458eeaed5f3101d3c68caf75b09124884d75ac7de67f60c07

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