- Python 89.7%
- Makefile 10.1%
- Shell 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| streepjescode | ||
| test | ||
| .editorconfig | ||
| .flake8 | ||
| .gitignore | ||
| .isort.cfg | ||
| AI_POLICY.md | ||
| example_inkscape.svg | ||
| example_path.svg | ||
| example_simple.svg | ||
| LICENSE | ||
| Makefile | ||
| poetry.lock | ||
| publish.py | ||
| pyproject.toml | ||
| pytest-ci.ini | ||
| pytest.ini | ||
| README.md | ||
| run | ||
| tox.ini | ||
streepjescode
Generate well-formatted, production-ready Barcodes.
By default, existing Python barcode libraries like python-barcode generate good barcodes, but any and all formatting of the text is left up to the user. streepjescode generates a nicely formatted barcode with interleaved text out of the box:
Depending on your renderer (and true by default), text in the barcode is not an SVG <text> element, as such an elment may render differently on different machines depending on font availability.
This library is currently limited to UPC-A/EAN and EPS/SVG – that's all we (the original authors) needed. Patches welcome!
Installation
pipx (recommended)
You should use something like pipx to install this, so it doesn't interfere with any of your existing libraries.
$ pipx install streepjescode
From source
~$ git clone https://codeberg.org/jessebot/streepjescode.git
~$ cd streepjescode
~/streepjescode$ make
help List all commands
install-poetry install or update poetry
install install via poetry
update Update the dependencies as according to the pyproject.toml file
lint Run code formatters and linter
fix-code-style Fix code formatting
tox-listenvs List all tox test environments
tox Run pytest via tox with all environments
tox-py36 Run pytest via tox with *python v3.6*
tox-py37 Run pytest via tox with *python v3.7*
tox-py38 Run pytest via tox with *python v3.8*
tox-py39 Run pytest via tox with *python v3.9*
pytest Run pytest
pytest-ci Run pytest with CI settings
publish Release new version to PyPi
makemessages Make and compile locales message files
~/streepjescode$ make install
Usage
In Python
>>> from streepjescode import GTIN
>>> GTIN('123456789012').write('output.svg')
Via the Command Line
$ streepjescode 123456789012 -o output.svg
# the streepjescode command could be aliased to barcode
$ alias barcode='streepjescode'
$ barcode 123456789012 -o output.svg
# to make the alias permanent, put it into your shell's rc file e.g. .bashrc
Attribution
This project was forked from boxine/beautiful_barcode in order to add a no AI policy, build for the latest version of Python (and poetry), and also add a proper CLI for convenience.
License
Fun Facts
streepjescode means barcode in Dutch :)