pymbrewclient 1.0.3__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.
- pymbrewclient-1.0.3/.github/workflows/test-and-release.yml +121 -0
- pymbrewclient-1.0.3/.gitignore +177 -0
- pymbrewclient-1.0.3/LICENSE +36 -0
- pymbrewclient-1.0.3/Makefile +53 -0
- pymbrewclient-1.0.3/PKG-INFO +120 -0
- pymbrewclient-1.0.3/README.md +88 -0
- pymbrewclient-1.0.3/pyproject.toml +61 -0
- pymbrewclient-1.0.3/setup.cfg +4 -0
- pymbrewclient-1.0.3/src/pymbrewclient/__init__.py +36 -0
- pymbrewclient-1.0.3/src/pymbrewclient/cli.py +274 -0
- pymbrewclient-1.0.3/src/pymbrewclient/pymbrewclient.py +79 -0
- pymbrewclient-1.0.3/src/pymbrewclient/rest/__init__.py +36 -0
- pymbrewclient-1.0.3/src/pymbrewclient/rest/client.py +163 -0
- pymbrewclient-1.0.3/src/pymbrewclient/rest/models.py +164 -0
- pymbrewclient-1.0.3/src/pymbrewclient.egg-info/PKG-INFO +120 -0
- pymbrewclient-1.0.3/src/pymbrewclient.egg-info/SOURCES.txt +19 -0
- pymbrewclient-1.0.3/src/pymbrewclient.egg-info/dependency_links.txt +1 -0
- pymbrewclient-1.0.3/src/pymbrewclient.egg-info/entry_points.txt +2 -0
- pymbrewclient-1.0.3/src/pymbrewclient.egg-info/requires.txt +18 -0
- pymbrewclient-1.0.3/src/pymbrewclient.egg-info/top_level.txt +1 -0
- pymbrewclient-1.0.3/tests/test_client.py +235 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: Test and Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened] # Trigger when a PR is opened, updated, or reopened
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v*" # Trigger on version tags (e.g., v1.0.0)
|
|
9
|
+
workflow_dispatch: # Allow manual triggering of the workflow
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout code
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v4
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.12"
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
pip install --upgrade pip
|
|
28
|
+
pip install .[dev]
|
|
29
|
+
|
|
30
|
+
- name: Run tests with coverage
|
|
31
|
+
run: |
|
|
32
|
+
pytest --cov=pymbrewclient --cov-report=term-missing --cov-report=xml
|
|
33
|
+
|
|
34
|
+
- name: Upload coverage report
|
|
35
|
+
uses: actions/upload-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: coverage-report
|
|
38
|
+
path: coverage.xml
|
|
39
|
+
|
|
40
|
+
lint:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- name: Checkout code
|
|
44
|
+
uses: actions/checkout@v3
|
|
45
|
+
|
|
46
|
+
- name: Set up Python
|
|
47
|
+
uses: actions/setup-python@v4
|
|
48
|
+
with:
|
|
49
|
+
python-version: "3.12"
|
|
50
|
+
|
|
51
|
+
- name: Install dependencies
|
|
52
|
+
run: |
|
|
53
|
+
pip install --upgrade pip
|
|
54
|
+
pip install .[dev]
|
|
55
|
+
|
|
56
|
+
- name: Run ruff
|
|
57
|
+
run: ruff check .
|
|
58
|
+
|
|
59
|
+
- name: Run black
|
|
60
|
+
run: black --check .
|
|
61
|
+
|
|
62
|
+
build:
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
needs: [test, lint] # Only run if test and lint jobs succeed
|
|
65
|
+
steps:
|
|
66
|
+
- name: Checkout code
|
|
67
|
+
uses: actions/checkout@v3
|
|
68
|
+
with:
|
|
69
|
+
fetch-depth: 0 # Ensure all tags are fetched for setuptools_scm
|
|
70
|
+
|
|
71
|
+
- name: Set up Python
|
|
72
|
+
uses: actions/setup-python@v4
|
|
73
|
+
with:
|
|
74
|
+
python-version: "3.12"
|
|
75
|
+
|
|
76
|
+
- name: Install build tools
|
|
77
|
+
run: |
|
|
78
|
+
pip install --upgrade pip
|
|
79
|
+
pip install build twine
|
|
80
|
+
|
|
81
|
+
- name: Build package
|
|
82
|
+
run: python -m build
|
|
83
|
+
|
|
84
|
+
- name: Upload build artifacts
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: build-artifacts
|
|
88
|
+
path: dist/
|
|
89
|
+
|
|
90
|
+
release:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
needs: [build] # Only run if the build job succeeds
|
|
93
|
+
if: startsWith(github.ref, 'refs/tags/v') # Only run for version tags
|
|
94
|
+
permissions:
|
|
95
|
+
contents: read
|
|
96
|
+
id-token: write # Required for OIDC authentication
|
|
97
|
+
steps:
|
|
98
|
+
- name: Checkout code
|
|
99
|
+
uses: actions/checkout@v3
|
|
100
|
+
with:
|
|
101
|
+
fetch-depth: 0 # Ensure all tags are fetched for setuptools_scm
|
|
102
|
+
|
|
103
|
+
- name: Download build artifacts
|
|
104
|
+
uses: actions/download-artifact@v4
|
|
105
|
+
with:
|
|
106
|
+
name: build-artifacts
|
|
107
|
+
path: dist/
|
|
108
|
+
|
|
109
|
+
- name: Set up Python
|
|
110
|
+
uses: actions/setup-python@v4
|
|
111
|
+
with:
|
|
112
|
+
python-version: "3.12"
|
|
113
|
+
|
|
114
|
+
- name: Install twine
|
|
115
|
+
run: pip install twine
|
|
116
|
+
|
|
117
|
+
- name: Publish to PyPI using OIDC
|
|
118
|
+
env:
|
|
119
|
+
TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
|
|
120
|
+
run: |
|
|
121
|
+
python -m twine upload dist/*
|
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
110
|
+
.pdm.toml
|
|
111
|
+
.pdm-python
|
|
112
|
+
.pdm-build/
|
|
113
|
+
|
|
114
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
115
|
+
__pypackages__/
|
|
116
|
+
|
|
117
|
+
# Celery stuff
|
|
118
|
+
celerybeat-schedule
|
|
119
|
+
celerybeat.pid
|
|
120
|
+
|
|
121
|
+
# SageMath parsed files
|
|
122
|
+
*.sage.py
|
|
123
|
+
|
|
124
|
+
# Environments
|
|
125
|
+
.env
|
|
126
|
+
.venv
|
|
127
|
+
env/
|
|
128
|
+
venv/
|
|
129
|
+
ENV/
|
|
130
|
+
env.bak/
|
|
131
|
+
venv.bak/
|
|
132
|
+
|
|
133
|
+
# Spyder project settings
|
|
134
|
+
.spyderproject
|
|
135
|
+
.spyproject
|
|
136
|
+
|
|
137
|
+
# Rope project settings
|
|
138
|
+
.ropeproject
|
|
139
|
+
|
|
140
|
+
# mkdocs documentation
|
|
141
|
+
/site
|
|
142
|
+
|
|
143
|
+
# mypy
|
|
144
|
+
.mypy_cache/
|
|
145
|
+
.dmypy.json
|
|
146
|
+
dmypy.json
|
|
147
|
+
|
|
148
|
+
# Pyre type checker
|
|
149
|
+
.pyre/
|
|
150
|
+
|
|
151
|
+
# pytype static type analyzer
|
|
152
|
+
.pytype/
|
|
153
|
+
|
|
154
|
+
# Cython debug symbols
|
|
155
|
+
cython_debug/
|
|
156
|
+
|
|
157
|
+
# PyCharm
|
|
158
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
159
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
160
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
161
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
162
|
+
.idea/
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
# ignore java class files -> theres a small bit of java code in the repo
|
|
166
|
+
*.class
|
|
167
|
+
|
|
168
|
+
# venvs
|
|
169
|
+
venv*/
|
|
170
|
+
activate
|
|
171
|
+
|
|
172
|
+
# sandbox scripts
|
|
173
|
+
sandbox/
|
|
174
|
+
|
|
175
|
+
# vim files
|
|
176
|
+
*.swo
|
|
177
|
+
*.swp
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
“Commons Clause” License Condition v1.0
|
|
2
|
+
|
|
3
|
+
The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
|
|
4
|
+
|
|
5
|
+
Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software.
|
|
6
|
+
|
|
7
|
+
For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.
|
|
8
|
+
|
|
9
|
+
Software: pymbrewclient
|
|
10
|
+
License: MIT License
|
|
11
|
+
Licensor: Stuart Pearson
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
MIT License
|
|
15
|
+
|
|
16
|
+
Copyright (c) 2024 Stuart Pearson
|
|
17
|
+
|
|
18
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
19
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
20
|
+
in the Software without restriction, including without limitation the rights
|
|
21
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
22
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
23
|
+
furnished to do so, subject to the following conditions:
|
|
24
|
+
|
|
25
|
+
The above copyright notice and this permission notice shall be included in all
|
|
26
|
+
copies or substantial portions of the Software.
|
|
27
|
+
|
|
28
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
29
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
30
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
31
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
32
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
33
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
|
+
SOFTWARE.
|
|
35
|
+
|
|
36
|
+
Disclaimer: This software is an independent project and is not affiliated with, endorsed by, or associated with MiniBrew. MiniBrew's trademarks, logos, API, and other intellectual property are owned by MiniBrew and are not included in this software. Users are responsible for complying with MiniBrew's terms of service when using this software.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Variables
|
|
2
|
+
PYTHON = python
|
|
3
|
+
PIP = $(PYTHON) -m pip
|
|
4
|
+
COVERAGE = coverage
|
|
5
|
+
PYTEST = pytest
|
|
6
|
+
REQ_FILE = requirements.txt
|
|
7
|
+
SRC_DIR = pymbrewclient
|
|
8
|
+
TEST_DIR = tests
|
|
9
|
+
DIST_DIR = dist
|
|
10
|
+
COV_REPORT_DIR = htmlcov
|
|
11
|
+
|
|
12
|
+
# Default target
|
|
13
|
+
.PHONY: all
|
|
14
|
+
all: test
|
|
15
|
+
|
|
16
|
+
# Install dependencies
|
|
17
|
+
.PHONY: install
|
|
18
|
+
install:
|
|
19
|
+
$(PIP) install --upgrade pip
|
|
20
|
+
$(PIP) install -r $(REQ_FILE)
|
|
21
|
+
$(PIP) install pytest coverage
|
|
22
|
+
|
|
23
|
+
# Run tests with coverage
|
|
24
|
+
.PHONY: test
|
|
25
|
+
test:
|
|
26
|
+
$(COVERAGE) run -m $(PYTEST)
|
|
27
|
+
$(COVERAGE) report
|
|
28
|
+
$(COVERAGE) xml
|
|
29
|
+
$(COVERAGE) html
|
|
30
|
+
|
|
31
|
+
# Clean up coverage and build artifacts
|
|
32
|
+
.PHONY: clean
|
|
33
|
+
clean:
|
|
34
|
+
rm -rf $(COV_REPORT_DIR) $(DIST_DIR) .coverage coverage.xml
|
|
35
|
+
|
|
36
|
+
# Build the package
|
|
37
|
+
.PHONY: build
|
|
38
|
+
build:
|
|
39
|
+
$(PYTHON) setup.py sdist bdist_wheel
|
|
40
|
+
|
|
41
|
+
# Run linting (optional)
|
|
42
|
+
.PHONY: lint
|
|
43
|
+
lint:
|
|
44
|
+
flake8 $(SRC_DIR) $(TEST_DIR)
|
|
45
|
+
|
|
46
|
+
# Run all checks (tests + linting)
|
|
47
|
+
.PHONY: check
|
|
48
|
+
check: lint test
|
|
49
|
+
|
|
50
|
+
# Run semantic commit validation
|
|
51
|
+
.PHONY: validate-commit
|
|
52
|
+
validate-commit:
|
|
53
|
+
git log -1 --pretty=%B | grep -E '^(feat|fix|chore|docs|style|refactor|perf|test|ci|build): .+' || exit 1
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pymbrewclient
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: pymbrewclient: A Python library and CLI for readonly access to Minibrew's API
|
|
5
|
+
Author-email: Stuart Pearson <1926002+stuartp44@users.noreply.github.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: pydantic<3,>=1.10.17
|
|
16
|
+
Requires-Dist: requests<3,>=2.32.3
|
|
17
|
+
Requires-Dist: loguru<1,>=0.7.2
|
|
18
|
+
Requires-Dist: typer<1,>=0.12.5
|
|
19
|
+
Requires-Dist: rich<14,>=13.9.4
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest<8,>=7.4.0; extra == "dev"
|
|
22
|
+
Requires-Dist: requests-mock<2,>=1.11.0; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest-cov<5,>=4.1.0; extra == "dev"
|
|
24
|
+
Requires-Dist: black<24,>=23.9.1; extra == "dev"
|
|
25
|
+
Requires-Dist: Flask<3,>=2.3.3; extra == "dev"
|
|
26
|
+
Requires-Dist: ruff<1,>=0.7.2; extra == "dev"
|
|
27
|
+
Requires-Dist: pre-commit<5,>=4.0.1; extra == "dev"
|
|
28
|
+
Provides-Extra: build
|
|
29
|
+
Requires-Dist: build; extra == "build"
|
|
30
|
+
Requires-Dist: twine; extra == "build"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# pymbrewclient
|
|
34
|
+
|
|
35
|
+
`pymbrewclient` is a Python library and CLI tool for interacting with Minibrew's API. It provides both programmatic access and a command-line interface for fetching brewery and session information.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- Fetch brewery overview data.
|
|
42
|
+
- Retrieve session information.
|
|
43
|
+
- Easy-to-use CLI for quick access.
|
|
44
|
+
- Python library for programmatic integration.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### PLEASE NOTE
|
|
49
|
+
This library will only work with a valid subscription to the pro portal.
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
You can install `pymbrewclient` using `pip`:
|
|
54
|
+
|
|
55
|
+
### CLI
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install pymbrewclient
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pymbrewclient get-token --username <USERNAME> --password <PASSWORD>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pymbrewclient brewery-overview
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pymbrewclient session-info --username <USERNAME> --password <PASSWORD> --session-id <SESSION_ID>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Library Usage
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from pymbrewclient import pymbrewclient
|
|
77
|
+
|
|
78
|
+
# Initialize the client
|
|
79
|
+
client = pymbrewclient(username,password)
|
|
80
|
+
|
|
81
|
+
# Fetch brewery overview
|
|
82
|
+
brewery_overview = client.get_brewery_overview()
|
|
83
|
+
print(brewery_overview)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from pymbrewclient import pymbrewclient
|
|
88
|
+
|
|
89
|
+
# Initialize the client
|
|
90
|
+
client = pymbrewclient()
|
|
91
|
+
|
|
92
|
+
# Fetch session info
|
|
93
|
+
session_id = 12345
|
|
94
|
+
session_info = client.get_session_info(session_id)
|
|
95
|
+
print(session_info)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## Development
|
|
100
|
+
|
|
101
|
+
Clone the repository:
|
|
102
|
+
```
|
|
103
|
+
git clone https://github.com/yourusername/pymbrewclient.git
|
|
104
|
+
cd pymbrewclient
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Install dependencies:
|
|
108
|
+
```
|
|
109
|
+
pip install .[dev]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Run tests:
|
|
113
|
+
```
|
|
114
|
+
pytest
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Lint the code:
|
|
118
|
+
```
|
|
119
|
+
make lint
|
|
120
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# pymbrewclient
|
|
2
|
+
|
|
3
|
+
`pymbrewclient` is a Python library and CLI tool for interacting with Minibrew's API. It provides both programmatic access and a command-line interface for fetching brewery and session information.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Fetch brewery overview data.
|
|
10
|
+
- Retrieve session information.
|
|
11
|
+
- Easy-to-use CLI for quick access.
|
|
12
|
+
- Python library for programmatic integration.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### PLEASE NOTE
|
|
17
|
+
This library will only work with a valid subscription to the pro portal.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
You can install `pymbrewclient` using `pip`:
|
|
22
|
+
|
|
23
|
+
### CLI
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install pymbrewclient
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pymbrewclient get-token --username <USERNAME> --password <PASSWORD>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pymbrewclient brewery-overview
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pymbrewclient session-info --username <USERNAME> --password <PASSWORD> --session-id <SESSION_ID>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Library Usage
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from pymbrewclient import pymbrewclient
|
|
45
|
+
|
|
46
|
+
# Initialize the client
|
|
47
|
+
client = pymbrewclient(username,password)
|
|
48
|
+
|
|
49
|
+
# Fetch brewery overview
|
|
50
|
+
brewery_overview = client.get_brewery_overview()
|
|
51
|
+
print(brewery_overview)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from pymbrewclient import pymbrewclient
|
|
56
|
+
|
|
57
|
+
# Initialize the client
|
|
58
|
+
client = pymbrewclient()
|
|
59
|
+
|
|
60
|
+
# Fetch session info
|
|
61
|
+
session_id = 12345
|
|
62
|
+
session_info = client.get_session_info(session_id)
|
|
63
|
+
print(session_info)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## Development
|
|
68
|
+
|
|
69
|
+
Clone the repository:
|
|
70
|
+
```
|
|
71
|
+
git clone https://github.com/yourusername/pymbrewclient.git
|
|
72
|
+
cd pymbrewclient
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Install dependencies:
|
|
76
|
+
```
|
|
77
|
+
pip install .[dev]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Run tests:
|
|
81
|
+
```
|
|
82
|
+
pytest
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Lint the code:
|
|
86
|
+
```
|
|
87
|
+
make lint
|
|
88
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel", "build", "setuptools_scm"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[tool.setuptools_scm]
|
|
6
|
+
version_scheme = "post-release"
|
|
7
|
+
local_scheme = "node-and-date"
|
|
8
|
+
|
|
9
|
+
[project]
|
|
10
|
+
name = "pymbrewclient"
|
|
11
|
+
description = "pymbrewclient: A Python library and CLI for readonly access to Minibrew's API"
|
|
12
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
license = {text = "MIT"}
|
|
15
|
+
authors = [{name = "Stuart Pearson", email = "1926002+stuartp44@users.noreply.github.com"}]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent"
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"pydantic>=1.10.17,<3",
|
|
25
|
+
"requests>=2.32.3,<3",
|
|
26
|
+
"loguru>=0.7.2,<1",
|
|
27
|
+
"typer>=0.12.5,<1",
|
|
28
|
+
"rich>=13.9.4,<14",
|
|
29
|
+
]
|
|
30
|
+
dynamic = ["version"]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest>=7.4.0,<8",
|
|
35
|
+
"requests-mock>=1.11.0,<2",
|
|
36
|
+
"pytest-cov>=4.1.0,<5",
|
|
37
|
+
"black>=23.9.1,<24",
|
|
38
|
+
"Flask>=2.3.3,<3",
|
|
39
|
+
"ruff>=0.7.2,<1",
|
|
40
|
+
"pre-commit>=4.0.1,<5",
|
|
41
|
+
]
|
|
42
|
+
build = [
|
|
43
|
+
"build",
|
|
44
|
+
"twine",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.scripts]
|
|
48
|
+
pymbrewclient = "pymbrewclient.cli:app"
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
testpaths = ["tests"]
|
|
52
|
+
addopts = "--cov=pymbrewclient --cov-report=term-missing --cov-report=xml"
|
|
53
|
+
|
|
54
|
+
[tool.ruff]
|
|
55
|
+
line-length = 120
|
|
56
|
+
select = ["E", "F", "ANN", "UP"]
|
|
57
|
+
ignore = ["E501", "ANN101"]
|
|
58
|
+
|
|
59
|
+
[tool.black]
|
|
60
|
+
line-length = 120
|
|
61
|
+
target-version = ["py312"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# “Commons Clause” License Condition v1.0
|
|
2
|
+
#
|
|
3
|
+
# The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
|
|
4
|
+
#
|
|
5
|
+
# Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software.
|
|
6
|
+
#
|
|
7
|
+
# For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.
|
|
8
|
+
#
|
|
9
|
+
# Software: pymbrewclient
|
|
10
|
+
# License: MIT License
|
|
11
|
+
# Licensor: Stuart Pearson
|
|
12
|
+
#
|
|
13
|
+
#
|
|
14
|
+
# MIT License
|
|
15
|
+
#
|
|
16
|
+
# Copyright (c) 2024 Stuart Pearson
|
|
17
|
+
#
|
|
18
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
19
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
20
|
+
# in the Software without restriction, including without limitation the rights
|
|
21
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
22
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
23
|
+
# furnished to do so, subject to the following conditions:
|
|
24
|
+
#
|
|
25
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
26
|
+
# copies or substantial portions of the Software.
|
|
27
|
+
#
|
|
28
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
29
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
30
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
31
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
32
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
33
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
|
+
# SOFTWARE.
|
|
35
|
+
#
|
|
36
|
+
# Disclaimer: This software is an independent project and is not affiliated with, endorsed by, or associated with MiniBrew. MiniBrew's trademarks, logos, API, and other intellectual property are owned by MiniBrew and are not included in this software. Users are responsible for complying with MiniBrew's terms of service when using this software.
|