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.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.0.tar.gz (36.3 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.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: brewcli-0.2.0.tar.gz
  • Upload date:
  • Size: 36.3 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.0.tar.gz
Algorithm Hash digest
SHA256 05fc368907d7255791be4671b7254fe7c127890263049710d8bcf00143aa7d7f
MD5 f2c601cdcfe956a32050e67f2a2c317f
BLAKE2b-256 476a086671b8d1c27f568254d53e545d229e09d36b7a09cef8adefe714f21890

See more details on using hashes here.

File details

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

File metadata

  • Download URL: brewcli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf5434f2ad70e9c2eabb6aac6fa8b3dbe4d0f6987d974f9b0ec8bc89d596ab75
MD5 dcf379bd413ddfe0738dfdefcba8c12e
BLAKE2b-256 9c432147db8eeb51ef7b20b1e254463e665ad52f8b51891a60d8bc1ad419b424

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