Skip to content

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
Svenito committed Oct 19, 2024
1 parent a8fafb0 commit 2717c3c
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 56 deletions.
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ To run the tests you use
In addition to the tests it's advisable to run a linter of the source as Github actions
will also check for linting and formatting errors.

rye run ruff format --check src tests
uv run ruff format --check src tests

or if you want to format the files automatically

rye run ruff format src tests
uv run ruff format src tests

For linting use

rye run ruff check src tests
uv run ruff check src tests

Thanks
======
Expand Down
134 changes: 81 additions & 53 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ brew-tools

::

╔╗ ╦═╗╔═╗╦ ╦ ╔╦╗╔═╗╔═╗╦ ╔═╗
╠╩╗╠╦╝║╣ ║║║───║ ║ ║║ ║║ ╚═╗
╚═╝╩╚═╚═╝╚╩╝ ╩ ╚═╝╚═╝╩═╝╚═╝
╔╗ ╦═╗╔═╗╦ ╦ ╔╦╗╔═╗╔═╗╦ ╔═╗
╠╩╗╠╦╝║╣ ║║║───║ ║ ║║ ║║ ╚═╗
╚═╝╩╚═╚═╝╚╩╝ ╩ ╚═╝╚═╝╩═╝╚═╝

|Build Status| |Documentation Status| |PyPI version|

A command line utility that offers a set of calculators for home
brewers.

NOTE: All values and calculations are provided as guidelines only.
Brew-tools should not be used for professional brewing. No warranty
or guarantee of accuracy is provided on the information provided by
this calculator.
NOTE: All values and calculations are provided as guidelines only.
Brew-tools should not be used for professional brewing. No warranty
or guarantee of accuracy is provided on the information provided by
this calculator.

Description
===========

Need to do a quick calculation during your brew day? Don't fancy digging
Need to do a quick calculation during your brew day? Dont fancy digging
through a GUI application, or a web based tool? Prefer to do simple
things in a terminal?

Expand All @@ -37,8 +37,9 @@ Currently brew-tools includes:
- Final gravity from a given attenuation percentage
- Gravity adjustment by boil off/dilution calculator
- New gravity after volume adjustment
- Strike water temp calculator
- Strike water temperature
- Unit conversion
- Simple unit converter

More to come

Expand All @@ -51,54 +52,67 @@ Brew-tools is available from PyPI

::

pip install brew-tools
pip install brew-tools

You can also clone/download this repository and install it using pip

::

cd <brew-tools-dir>
pip install .
cd <brew-tools-dir>
pip install .

Usage
=====

When first starting Brew tools you will be asked for your preferred unit type, metric or imperial.
This is then stored in a config file and used as the default unit. This can be temporarily
changed with the `--unit` option.
When first starting Brew tools you will be asked for your preferred unit
type, metric or imperial. This is then stored in a config file and used
as the default unit. This can be temporarily changed with the ``--unit``
option.

Brew tools has built in help

::

Usage: brew-tools [OPTIONS] COMMAND [ARGS]...
Usage: brew_tools [OPTIONS] COMMAND [ARGS]...

Options:
--version Show the version and exit.
--unit [metric|imperial] Ignore config and use a different unit.
--help Show this message and exit.
Brew-Tools is a small commandline utility that offers quick access to a
set of calculators and tools to help homebrewers create their brews.

Commands:
abv
infuse
kegpsi
prime
dme
All values and calculations are provided as guidelines only. Brew-tools
should not be used for professional brewing. No warranty or guarantee of
accuracy is provided on the information provided by this calculator.

Options:
--version Show the version and exit.
--unit [metric|imperial] Ignore config and use a different unit.
--help Show this message and exit.

Commands:
abv Calculates the ABV from the original and final gravity...
adjust-gravity Calculate the amount of liquid to boil off/dilute with to...
adjust-volume Calculate the new gravity after a change in wort volume...
attenuation Calculates the apparent and real attenuation from the...
convert Convert a value between given measurements.
dme Given the current volume of the mash, work out how much...
fg-from-att Given a starting gravity and a desired attenuation level,...
infuse Given the current mash temperature, work out how much...
kegpsi Calculates the regulator pressure required to achieve...
prime

and also for its commands

::

brew-tools infuse --help
Usage: brew-tools infuse [OPTIONS]
brew-tools infuse --help
Usage: brew-tools infuse [OPTIONS]

Options:
-temp FLOAT Current temperature of mash
-target FLOAT Target temperature of mash
-ratio FLOAT Grist/water ratio
-grain FLOAT Weight of grain in mash
-water FLOAT Temp of infusion water
--help Show this message and exit.
Options:
-temp FLOAT Current temperature of mash
-target FLOAT Target temperature of mash
-ratio FLOAT Grist/water ratio
-grain FLOAT Weight of grain in mash
-water FLOAT Temp of infusion water
--help Show this message and exit.

If the inputs are not passed via the command line arguments, brew tools
will prompt the user for input.
Expand All @@ -108,48 +122,62 @@ For more information see the

Development
===========

If you want to help develop brew tools you should install it into a
virtual environment. The current version of brew-tools uses [Poetry](https://poetry.eustace.io/)
to manage virtual environments and such.
virtual environment. The current version of brew-tools uses
`uv <https://docs.astral.sh/uv>`__ to manage virtual environments and
such.

In order to start, [install Poetry](https://poetry.eustace.io/docs/#installation)
and change into the brew-tools directory. From there you can run
In order to start, `install
uv <https://docs.astral.sh/uv/getting-started/installation/>`__ and
change into the brew-tools directory. From there you can run

::

poetry install
uv sync

which will create a virtual environment and install the dependencies.
To run `brew_tools` in the developmeent environment it's probably easiest to run
which will create a virtual environment and install the dependencies as
well as install ``brew_tools`` to the environment. To run ``brew_tools``
in the development environment run

::

poetry shell
uv run brew_tools

Which will launch ``brew_tools``. Simply add arguments to the end of the
line.

To run the tests you use

which will spawn a configured shell for the environment.
::

uv run pytest tests

Tests can be run in this environment, or you can use
In addition to the tests it’s advisable to run a linter of the source as
Github actions will also check for linting and formatting errors.

::

poetry run pytest tests
uv run ruff format --check src tests

or if you want to format the files automatically

::

to run the tests without spawning a shell.
uv run ruff format src tests

In addition to the tests it's advisable to run a linter of the source as Travis
will also check for linting errors. The linter command ignores some errors, so you
can use this command to match the command run by Travis
For linting use

::

poetry run flake8 src --ignore=E501,W504,W503
uv run ruff check src tests

Thanks
======

Thanks to

- /u/DAMNIT\_REZNO - for inspiring me to start this project
- /u/DAMNIT_REZNO - for inspiring me to start this project
- SlayterDev - DME addition calculator
- Szczyp - Add input for grain temp and fix missing input function

Expand All @@ -161,7 +189,7 @@ Brew Tools is released under the MIT license.
See ``LICENSE.txt`` for more details

.. |Build Status| image:: https://travis-ci.com/Svenito/brew-tools.svg?branch=main
:target: https://travis-ci.com/Svenito/brew-tools
:target: https://app.travis-ci.com/github/Svenito/brew-tools
.. |Documentation Status| image:: https://readthedocs.org/projects/brew-tools/badge/?version=latest
:target: https://brew-tools.readthedocs.io/en/latest/?badge=latest
.. |PyPI version| image:: https://badge.fury.io/py/brew-tools.svg
Expand Down

0 comments on commit 2717c3c

Please sign in to comment.