Skip to main content

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

Metadata

Release files for brewcli 0.2.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 brewcli 0.2.1
File Size Uploaded
brewcli-0.2.1.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brewcli 0.2.1
File Interpreter ABI Platform
brewcli-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 51.0 kB

Release files / brewcli-0.2.1.tar.gz

Download URL brewcli-0.2.1.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f33239445a477536b8e39a213c2b40492321d67367d2e0aabed94f1a1934e8ed
BLAKE2b-256 checksum
How to use checksums
2c0032a4d43a9520f51040e4c11165ced914a81dac4ad795cac0d4ba5692f3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / brewcli-0.2.1-py3-none-any.whl

Download URL brewcli-0.2.1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5adf5d79d6077293419b52530be04efd4141bf09dd7f10a8a72c409f77d992d3
BLAKE2b-256 checksum
How to use checksums
a1ee16a5bf7648afe5685b406aaf43d722e4fb43ad2d67f71c4915ba7f28a25f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.2.1 This release

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