brewcli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brewcli-0.1.0/.claude/settings.local.json +8 -0
- brewcli-0.1.0/.dockerignore +27 -0
- brewcli-0.1.0/.gitignore +174 -0
- brewcli-0.1.0/.pre-commit-config.yaml +24 -0
- brewcli-0.1.0/.python-version +1 -0
- brewcli-0.1.0/.vscode/launch.json +19 -0
- brewcli-0.1.0/.vscode/tasks.json +26 -0
- brewcli-0.1.0/Dockerfile +34 -0
- brewcli-0.1.0/LICENSE +21 -0
- brewcli-0.1.0/PKG-INFO +132 -0
- brewcli-0.1.0/README.md +111 -0
- brewcli-0.1.0/pyproject.toml +74 -0
- brewcli-0.1.0/src/brewcli/__init__.py +0 -0
- brewcli-0.1.0/src/brewcli/__main__.py +4 -0
- brewcli-0.1.0/src/brewcli/brewery.py +120 -0
- brewcli-0.1.0/src/brewcli/cli.py +112 -0
- brewcli-0.1.0/src/brewcli/logging.py +20 -0
- brewcli-0.1.0/src/brewcli/logging_config.json +0 -0
- brewcli-0.1.0/src/brewcli/models.py +392 -0
- brewcli-0.1.0/src/brewcli/utils.py +3 -0
- brewcli-0.1.0/tests/__init__.py +0 -0
- brewcli-0.1.0/tests/conftest.py +79 -0
- brewcli-0.1.0/tests/test_brewery_api.py +100 -0
- brewcli-0.1.0/tests/test_cli.py +133 -0
- brewcli-0.1.0/tests/test_models.py +404 -0
- brewcli-0.1.0/uv.lock +539 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
**/__pycache__
|
|
2
|
+
**/.venv
|
|
3
|
+
**/.classpath
|
|
4
|
+
**/.dockerignore
|
|
5
|
+
**/.env
|
|
6
|
+
**/.git
|
|
7
|
+
**/.gitignore
|
|
8
|
+
**/.project
|
|
9
|
+
**/.settings
|
|
10
|
+
**/.toolstarget
|
|
11
|
+
**/.vs
|
|
12
|
+
**/.vscode
|
|
13
|
+
**/*.*proj.user
|
|
14
|
+
**/*.dbmdl
|
|
15
|
+
**/*.jfm
|
|
16
|
+
**/bin
|
|
17
|
+
**/charts
|
|
18
|
+
**/docker-compose*
|
|
19
|
+
**/compose*
|
|
20
|
+
**/Dockerfile*
|
|
21
|
+
**/node_modules
|
|
22
|
+
**/npm-debug.log
|
|
23
|
+
**/obj
|
|
24
|
+
**/secrets.dev.yaml
|
|
25
|
+
**/values.dev.yaml
|
|
26
|
+
LICENSE
|
|
27
|
+
README.md
|
brewcli-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Ruff stuff:
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# PyPI configuration file
|
|
174
|
+
.pypirc
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v2.3.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-yaml
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-added-large-files
|
|
8
|
+
- id: trailing-whitespace
|
|
9
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
10
|
+
rev: v1.8.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: mypy
|
|
13
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
14
|
+
# Ruff version.
|
|
15
|
+
rev: v0.7.2
|
|
16
|
+
hooks:
|
|
17
|
+
# Run the linter.
|
|
18
|
+
- id: ruff
|
|
19
|
+
name: ruff-sort
|
|
20
|
+
args: ["check", "--select", "I", "--fix"]
|
|
21
|
+
- id: ruff
|
|
22
|
+
args: [--fix]
|
|
23
|
+
# Run the formatter (similar to black)
|
|
24
|
+
- id: ruff-format
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configurations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Containers: Python - General",
|
|
5
|
+
"type": "docker",
|
|
6
|
+
"request": "launch",
|
|
7
|
+
"preLaunchTask": "docker-run: debug",
|
|
8
|
+
"python": {
|
|
9
|
+
"pathMappings": [
|
|
10
|
+
{
|
|
11
|
+
"localRoot": "${workspaceFolder}",
|
|
12
|
+
"remoteRoot": "/app"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"projectType": "general"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"type": "docker-build",
|
|
6
|
+
"label": "docker-build",
|
|
7
|
+
"platform": "python",
|
|
8
|
+
"dockerBuild": {
|
|
9
|
+
"tag": "brewcli:latest",
|
|
10
|
+
"dockerfile": "${workspaceFolder}/Dockerfile",
|
|
11
|
+
"context": "${workspaceFolder}",
|
|
12
|
+
"pull": true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "docker-run",
|
|
17
|
+
"label": "docker-run: debug",
|
|
18
|
+
"dependsOn": [
|
|
19
|
+
"docker-build"
|
|
20
|
+
],
|
|
21
|
+
"python": {
|
|
22
|
+
"file": "src/brewcli/__main__.py"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
brewcli-0.1.0/Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Use the official uv image with Python preinstalled
|
|
2
|
+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
|
3
|
+
|
|
4
|
+
# Keeps Python from generating .pyc files in the container
|
|
5
|
+
ENV PYTHONDONTWRITEBYTECODE=1
|
|
6
|
+
|
|
7
|
+
# Turns off buffering for easier container logging
|
|
8
|
+
ENV PYTHONUNBUFFERED=1
|
|
9
|
+
|
|
10
|
+
# Compile bytecode for faster startup and copy (not link) packages into the venv
|
|
11
|
+
ENV UV_COMPILE_BYTECODE=1
|
|
12
|
+
ENV UV_LINK_MODE=copy
|
|
13
|
+
|
|
14
|
+
WORKDIR /app
|
|
15
|
+
|
|
16
|
+
# Install dependencies first (cached layer) using the lockfile, without the project itself
|
|
17
|
+
COPY pyproject.toml uv.lock ./
|
|
18
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
19
|
+
uv sync --frozen --no-install-project --no-dev
|
|
20
|
+
|
|
21
|
+
# Copy the rest of the project and install it
|
|
22
|
+
COPY . /app
|
|
23
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
24
|
+
uv sync --frozen --no-dev
|
|
25
|
+
|
|
26
|
+
# Put the project's virtualenv on PATH
|
|
27
|
+
ENV PATH="/app/.venv/bin:$PATH"
|
|
28
|
+
|
|
29
|
+
# Creates a non-root user with an explicit UID and gives it access to /app
|
|
30
|
+
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
|
|
31
|
+
USER appuser
|
|
32
|
+
|
|
33
|
+
# Run the installed console script
|
|
34
|
+
CMD ["brewcli"]
|
brewcli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tyler Nardone
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
brewcli-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: brewcli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A command-line interface for exploring breweries via the Open Brewery DB API.
|
|
5
|
+
Project-URL: Homepage, https://github.com/tynardone/brewcli
|
|
6
|
+
Project-URL: Repository, https://github.com/tynardone/brewcli
|
|
7
|
+
Author-email: Tyler Nardone <tynardone@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: beer,brewery,cli,openbrewerydb
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Utilities
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: click>=8.1.8
|
|
19
|
+
Requires-Dist: httpx>=0.28.1
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# brewcli
|
|
23
|
+
|
|
24
|
+
> A command-line interface (CLI) for exploring breweries via the [Open Brewery DB API](https://www.openbrewerydb.org/).
|
|
25
|
+
|
|
26
|
+
![Code Style: Ruff][ruff-style]
|
|
27
|
+
![Type Checked: Mypy][mypy-check]
|
|
28
|
+
![Python Versions][python-versions]
|
|
29
|
+
![License][license]
|
|
30
|
+
![Downloads][downloads]
|
|
31
|
+
|
|
32
|
+
`brewcli` is a Python-based CLI tool designed to interact with the [Open Brewery DB API](https://www.openbrewerydb.org/). With `brewcli`, you can fetch random breweries, search breweries by city, state, or type, and more—all from the command line.
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- Fetch a list of random breweries.
|
|
37
|
+
- Search breweries by city, country, name, postal code, state, type, or distance from a coordinate.
|
|
38
|
+
- Retrieve detailed information about a specific brewery by its ID.
|
|
39
|
+
- Output data in a user-friendly format.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
Install `brewcli` using pip:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pip install brewcli
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage example
|
|
50
|
+
|
|
51
|
+
Here are some examples of how to use brewcli:
|
|
52
|
+
|
|
53
|
+
Get a number of random breweries (the count is required):
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
brewcli random 5
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Look up a specific brewery by its ID:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
brewcli by-id b54b16e1-ac3b-4bff-a11f-f7ae9ddc27e0
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Search breweries by city:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
brewcli search --by-city "Cincinnati"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Search breweries by state and type:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
brewcli search --by-state "California" --by-type "micro"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Available `search` filters: `--by-city`, `--by-country`, `--by-dist` (coordinates as
|
|
78
|
+
`'lat,lon'`), `--by-name`, `--by-postal`, `--by-state`, and `--by-type` (one of:
|
|
79
|
+
`micro`, `nano`, `regional`, `brewpub`, `planning`, `contract`, `proprietor`, `closed`).
|
|
80
|
+
|
|
81
|
+
Run `brewcli --help` or `brewcli <command> --help` for full usage details.
|
|
82
|
+
|
|
83
|
+
## Development setup
|
|
84
|
+
|
|
85
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management and is
|
|
86
|
+
pinned to Python 3.12 (see `.python-version`).
|
|
87
|
+
|
|
88
|
+
Clone the repository:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
git clone https://github.com/tynardone/brewcli.git
|
|
92
|
+
cd brewcli
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Create the virtual environment and install all dependencies (runtime + dev) from the
|
|
96
|
+
lockfile:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
uv sync
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Run the CLI:
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
uv run brewcli --help
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Run tests:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
uv run pytest
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Release History
|
|
115
|
+
|
|
116
|
+
- 0.1.0
|
|
117
|
+
- Work in progress
|
|
118
|
+
|
|
119
|
+
## Meta
|
|
120
|
+
|
|
121
|
+
Tyler Nardone – <tynardone@gmail.com> - [LinkedIn](https://www.linkedin.com/in/tynardone/)
|
|
122
|
+
|
|
123
|
+
Distributed under the MIT license. See ``LICENSE`` for more information.
|
|
124
|
+
|
|
125
|
+
[https://github.com/tynardone/brewcli](https://github.com/tynardone/brewcli)
|
|
126
|
+
|
|
127
|
+
<!-- Markdown link & img dfn's -->
|
|
128
|
+
[python-versions]: https://img.shields.io/pypi/pyversions/brewcli
|
|
129
|
+
[license]: https://img.shields.io/github/license/tynardone/brewcli
|
|
130
|
+
[downloads]: https://img.shields.io/pypi/dm/brewcli
|
|
131
|
+
[ruff-style]:https://img.shields.io/badge/code%20style-ruff-000000?style=flat&logo=python
|
|
132
|
+
[mypy-check]:https://img.shields.io/badge/type%20checked-mypy-blue?style=flat&logo=python
|
brewcli-0.1.0/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# brewcli
|
|
2
|
+
|
|
3
|
+
> A command-line interface (CLI) for exploring breweries via the [Open Brewery DB API](https://www.openbrewerydb.org/).
|
|
4
|
+
|
|
5
|
+
![Code Style: Ruff][ruff-style]
|
|
6
|
+
![Type Checked: Mypy][mypy-check]
|
|
7
|
+
![Python Versions][python-versions]
|
|
8
|
+
![License][license]
|
|
9
|
+
![Downloads][downloads]
|
|
10
|
+
|
|
11
|
+
`brewcli` is a Python-based CLI tool designed to interact with the [Open Brewery DB API](https://www.openbrewerydb.org/). With `brewcli`, you can fetch random breweries, search breweries by city, state, or type, and more—all from the command line.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- Fetch a list of random breweries.
|
|
16
|
+
- Search breweries by city, country, name, postal code, state, type, or distance from a coordinate.
|
|
17
|
+
- Retrieve detailed information about a specific brewery by its ID.
|
|
18
|
+
- Output data in a user-friendly format.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Install `brewcli` using pip:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
pip install brewcli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage example
|
|
29
|
+
|
|
30
|
+
Here are some examples of how to use brewcli:
|
|
31
|
+
|
|
32
|
+
Get a number of random breweries (the count is required):
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
brewcli random 5
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Look up a specific brewery by its ID:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
brewcli by-id b54b16e1-ac3b-4bff-a11f-f7ae9ddc27e0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Search breweries by city:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
brewcli search --by-city "Cincinnati"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Search breweries by state and type:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
brewcli search --by-state "California" --by-type "micro"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Available `search` filters: `--by-city`, `--by-country`, `--by-dist` (coordinates as
|
|
57
|
+
`'lat,lon'`), `--by-name`, `--by-postal`, `--by-state`, and `--by-type` (one of:
|
|
58
|
+
`micro`, `nano`, `regional`, `brewpub`, `planning`, `contract`, `proprietor`, `closed`).
|
|
59
|
+
|
|
60
|
+
Run `brewcli --help` or `brewcli <command> --help` for full usage details.
|
|
61
|
+
|
|
62
|
+
## Development setup
|
|
63
|
+
|
|
64
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management and is
|
|
65
|
+
pinned to Python 3.12 (see `.python-version`).
|
|
66
|
+
|
|
67
|
+
Clone the repository:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
git clone https://github.com/tynardone/brewcli.git
|
|
71
|
+
cd brewcli
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Create the virtual environment and install all dependencies (runtime + dev) from the
|
|
75
|
+
lockfile:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
uv sync
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Run the CLI:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
uv run brewcli --help
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Run tests:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
uv run pytest
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Release History
|
|
94
|
+
|
|
95
|
+
- 0.1.0
|
|
96
|
+
- Work in progress
|
|
97
|
+
|
|
98
|
+
## Meta
|
|
99
|
+
|
|
100
|
+
Tyler Nardone – <tynardone@gmail.com> - [LinkedIn](https://www.linkedin.com/in/tynardone/)
|
|
101
|
+
|
|
102
|
+
Distributed under the MIT license. See ``LICENSE`` for more information.
|
|
103
|
+
|
|
104
|
+
[https://github.com/tynardone/brewcli](https://github.com/tynardone/brewcli)
|
|
105
|
+
|
|
106
|
+
<!-- Markdown link & img dfn's -->
|
|
107
|
+
[python-versions]: https://img.shields.io/pypi/pyversions/brewcli
|
|
108
|
+
[license]: https://img.shields.io/github/license/tynardone/brewcli
|
|
109
|
+
[downloads]: https://img.shields.io/pypi/dm/brewcli
|
|
110
|
+
[ruff-style]:https://img.shields.io/badge/code%20style-ruff-000000?style=flat&logo=python
|
|
111
|
+
[mypy-check]:https://img.shields.io/badge/type%20checked-mypy-blue?style=flat&logo=python
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[tool.hatch.build.targets.wheel]
|
|
6
|
+
packages = ["src/brewcli"]
|
|
7
|
+
|
|
8
|
+
[project]
|
|
9
|
+
name = "brewcli"
|
|
10
|
+
version = "0.1.0"
|
|
11
|
+
description = "A command-line interface for exploring breweries via the Open Brewery DB API."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
authors = [{ name = "Tyler Nardone", email = "tynardone@gmail.com" }]
|
|
14
|
+
license = "MIT"
|
|
15
|
+
license-files = ["LICENSE"]
|
|
16
|
+
requires-python = ">=3.12"
|
|
17
|
+
keywords = ["brewery", "cli", "openbrewerydb", "beer"]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"Environment :: Console",
|
|
21
|
+
"Intended Audience :: End Users/Desktop",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Topic :: Utilities",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"click>=8.1.8",
|
|
28
|
+
"httpx>=0.28.1",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/tynardone/brewcli"
|
|
33
|
+
Repository = "https://github.com/tynardone/brewcli"
|
|
34
|
+
|
|
35
|
+
[dependency-groups]
|
|
36
|
+
dev = [
|
|
37
|
+
"black>=24.10.0",
|
|
38
|
+
"coverage>=7.6.10",
|
|
39
|
+
"isort>=5.13.2",
|
|
40
|
+
"mypy>=1.14.1",
|
|
41
|
+
"pre-commit>=4.0.1",
|
|
42
|
+
"pylint>=3.3.3",
|
|
43
|
+
"pytest>=8.3.4",
|
|
44
|
+
"pytest-cov>=6.0.0",
|
|
45
|
+
"pytest-httpx>=0.35.0",
|
|
46
|
+
"pytest-mock>=3.14.0",
|
|
47
|
+
"ruff>=0.7.2",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.scripts]
|
|
51
|
+
brewcli = "brewcli.cli:cli"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
[tool.ruff.lint]
|
|
55
|
+
select = [
|
|
56
|
+
# pycodestyle
|
|
57
|
+
"E",
|
|
58
|
+
"W",
|
|
59
|
+
# Pyflakes
|
|
60
|
+
"F",
|
|
61
|
+
# pyupgrade
|
|
62
|
+
"UP",
|
|
63
|
+
# flake8-bugbear
|
|
64
|
+
"B",
|
|
65
|
+
# flake8-simplify
|
|
66
|
+
"SIM",
|
|
67
|
+
# isort
|
|
68
|
+
"I",
|
|
69
|
+
"N", # pep8 naming
|
|
70
|
+
"PL", # pylint
|
|
71
|
+
"RUF", # ruff specific
|
|
72
|
+
"PD", # pandas-vet
|
|
73
|
+
]
|
|
74
|
+
ignore = ["PLR2004"]
|
|
File without changes
|