Reference¶
The CLI executable is bpr or brew-python-resources.
The help is available with --help.
usage: bpr [-e EXCLUDE] [-i INCLUDE] [-s] [-v] [-C] [-V] [-D] [-h] [package] # (1)!
example: bpr [package]
positional arguments:
package Package name or file path
options:
-e, --exclude EXCLUDE
Exclude regex patterns [CSV]
-i, --include INCLUDE
Include regex patterns [CSV]
-s, --single Process single package
-v, --verbose Verbose output [debug: -vvv]
-C, --clear-cache Clear request cache
-V, --version Show installed version
-D, --docs Launch docs in browser
-h, --help Show this help message
- Tip: Save your options with Environment Variables.
To view the source code, see the cli.py on GitHub.
Note: single should not be used with exclude or include.
Install¶
From PyPI , Homebrew or GitHub .
-
Note: the
!installs into/usr/local/bin.Omit this to use the current directory.
See jpillora/installer for more details.
Upgrade.
Uninstall.
Run without installing using astral-sh/uv .
Check the installed --version.
Usage¶
The Python Version depends on the running interpreter.
To generate resources for a specific version, use that version.
The CLI executable is bpr or brew-python-resources.
Run on a published pacakge.
Run on a package file.
Process a single resource.
Exclude or include packages with regex. Comma seperated list of patterns.
Increase output with --verbose. Debug with -vv or -vvv.
Output results to a file.
Run without installing using astral-sh/uv .
Example (verbose output).
$ bpr -v toml-run
Package: toml-run
Python 3.8.20 (default, Oct 2 2024, 16:34:12)
--- COPY RESOURCES BELOW HERE -----------------------------------------------------------------------
resource "tomli" do
url "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz"
sha256 "64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"
end
--- COPY RESOURCES ABOVE HERE -----------------------------------------------------------------------
Note: verbose outputs to stderr so you can still capture the resources with stdout.
Environment¶
Many options support setting environment variable defaults.
| Environment Variable | Default | Type | Description |
|---|---|---|---|
BPR_PACKAGE |
- | str |
Package name or file |
BPR_EXCLUDE |
- | str |
Exclude regex |
BPR_INCLUDE |
- | str |
Include regex |
BPR_SINGLE |
0 | bool |
Single resource |
BPR_VERBOSE |
0 | int |
Enable verbose output |
Allowed boolean values, case-insensitive.
You can temporarily set variables on the command line.
Question
If you need help getting started or run into any issues, support is available!