Skip to main content

A command-line interface for exploring breweries via the Open Brewery DB API.

Project description

brewcli

A command-line interface (CLI) for exploring breweries via the Open Brewery DB API.

Code Style: Ruff Type Checked: Mypy Python Versions License Downloads

brewcli is a Python-based CLI tool designed to interact with the Open Brewery DB API. With brewcli, you can fetch random breweries, search breweries by city, state, or type, and more—all from the command line.

Features

  • Fetch a list of random breweries.
  • Search breweries by city, country, name, postal code, state, type, or distance from a coordinate.
  • Retrieve detailed information about a specific brewery by its ID.
  • Output data in a user-friendly format.

Installation

Install brewcli using pip:

pip install brewcli

Usage example

Here are some examples of how to use brewcli:

Lists of breweries are rendered as a color table, and single-brewery lookups as a detail panel. Website URLs are shown as clickable links in terminals that support them.

Get a number of random breweries (the count is required):

brewcli random 3
  Name                 Type       Location            Phone        Website
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  MadTree Brewing      regional   Cincinnati, Ohio    5138368733   madtreebrewing.com
  Rhinegeist Brewery   micro      Cincinnati, Ohio    —            rhinegeist.com
  Fifty West Brewing   brewpub    Cincinnati, Ohio    5138916996   fiftywestbrew.com

Look up a specific brewery by its ID:

brewcli by-id b54b16e1-ac3b-4bff-a11f-f7ae9ddc27e0
╭─ MadTree Brewing  (regional) ─╮
│ 5164 Kennedy Ave              │
│ Cincinnati, Ohio 45213        │
│ United States                 │
│                               │
│ ☎  5138368733                 │
│ 🌐 madtreebrewing.com         │
╰───────────────────────────────╯

Search breweries by city:

brewcli search --by-city "Cincinnati"

Search breweries by state and type:

brewcli search --by-state "California" --by-type "micro"

Available search filters: --by-city, --by-country, --by-dist (coordinates as 'lat,lon'), --by-name, --by-postal, --by-state, and --by-type (one of: micro, nano, regional, brewpub, planning, contract, proprietor, closed).

Run brewcli --help or brewcli <command> --help for full usage details.

Development setup

This project uses uv for dependency management and is pinned to Python 3.12 (see .python-version).

Clone the repository:

git clone https://github.com/tynardone/brewcli.git
cd brewcli

Create the virtual environment and install all dependencies (runtime + dev) from the lockfile:

uv sync

Run the CLI:

uv run brewcli --help

Run tests:

uv run pytest

Release History

  • 0.2.1
    • Fix a crash when the API returned an HTTP error (random/by-id now show a friendly message instead of a traceback).
    • Fix an invalid PyPI classifier that broke the package build.
    • Ship py.typed so downstream type checkers use the bundled annotations.
    • Expand the test suite (CLI commands, error paths, and output rendering).
  • 0.2.0
    • Rich terminal output: brewery lists render as a color table and single lookups as a detail panel, with clickable website links.
  • 0.1.0
    • Initial release: random, by-id, and search commands.

Meta

Tyler Nardone – tynardone@gmail.com - LinkedIn

Distributed under the MIT license. See LICENSE for more information.

https://github.com/tynardone/brewcli

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

brewcli-0.2.1.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

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

brewcli-0.2.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file brewcli-0.2.1.tar.gz.

File metadata

  • Download URL: brewcli-0.2.1.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for brewcli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f33239445a477536b8e39a213c2b40492321d67367d2e0aabed94f1a1934e8ed
MD5 750d25280d4c09a06ef6a4d2234bfe0c
BLAKE2b-256 2c0032a4d43a9520f51040e4c11165ced914a81dac4ad795cac0d4ba5692f3ae

See more details on using hashes here.

File details

Details for the file brewcli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: brewcli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for brewcli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5adf5d79d6077293419b52530be04efd4141bf09dd7f10a8a72c409f77d992d3
MD5 e5916651ccf5d9dda32afa7841defec8
BLAKE2b-256 a1ee16a5bf7648afe5685b406aaf43d722e4fb43ad2d67f71c4915ba7f28a25f

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