Arch User Repository (AUR) package for gunsnprices, the
Python library and command-line tool that parses firearm and ammunition product titles into
brand, model, caliber, magazine capacity, barrel length and rounds per box.
- Upstream source: https://github.com/gunsnprices/gunsnprices-python
- Documentation: https://gunsnprices.com/developers
- AUR page (after the first upload): https://aur.archlinux.org/packages/python-gunsnprices
This GitHub repository is a CI mirror. The AUR git repository
(ssh://aur@aur.archlinux.org/python-gunsnprices.git) holds only PKGBUILD, .SRCINFO and
LICENSE. This repository has the same files plus a GitHub Actions workflow that builds and tests
them on Arch Linux. Status: not yet uploaded to the AUR. See PUBLISHING.md.
git clone https://aur.archlinux.org/python-gunsnprices.git
cd python-gunsnprices
makepkg -si
Or with an AUR helper, for example paru -S python-gunsnprices or yay -S python-gunsnprices.
$ gunsnprices "Glock 19 Gen 5 9mm 15rd"
$ echo "Federal American Eagle 9mm 115gr FMJ 50rd" | gunsnprices --price 18.99
from gunsnprices import parse_title
info = parse_title("Sig Sauer P365 XL 9mm 3.7in 12rd Pistol")
print(info.to_dict())| Field | Value |
|---|---|
pkgname |
python-gunsnprices (Arch naming for a Python library) |
pkgver |
0.1.2 |
arch |
any (pure Python) |
url |
https://gunsnprices.com/developers |
license |
MIT AND CC-BY-4.0 (code MIT, bundled model and caliber data CC BY 4.0) |
depends |
python (no other runtime dependencies) |
makedepends |
python-build, python-hatchling, python-installer, python-wheel |
checkdepends |
python-pytest |
source |
GitHub tag v0.1.2 of gunsnprices-python, with sha256sums and b2sums |
build() makes a wheel with python -m build --wheel --no-isolation. check() installs that
wheel into a temporary venv (--system-site-packages) and runs the upstream test suite (1,191
tests) against it. package() installs the wheel with python -m installer and copies LICENSE
and LICENSE-DATA to /usr/share/licenses/python-gunsnprices/.
.github/workflows/archlinux.yml runs in the
archlinux:latest container on every push:
makepkg --printsrcinfomust match the committed.SRCINFO.namcap PKGBUILD(the job fails on errors).makepkg --syncdeps --rmdeps --cleanbuildas an unprivileged user. Only the declared dependencies are installed, andcheck()runs the test suite.namcapon the built.pkg.tar.zst(fails on errors), with the PATH of an Arch login shell.pacman -Uof the package, a secondnamcaprun with the package installed (information only), thengunsnprices --help,--version, a firearm title, an ammunition title with--price, and an import of the module from/usr/lib/python3.*.
The results of the last check, including the one namcap warning (a false positive), are in PUBLISHING.md.
.github/workflows/arch-command.yml is a manual helper
that runs one shell command in archlinux:latest. It is used to answer the pacman question on
the AUR registration form (see PUBLISHING.md).
The packaging files in this repository (PKGBUILD, .SRCINFO, workflows, documentation) are
under the 0BSD license, as recommended by the AUR submission guidelines. The packaged
software is MIT (code) and CC BY 4.0 (model and caliber data, credit "GunsNPrices
(gunsnprices.com)"), as declared upstream.