3 Commits

Author SHA1 Message Date
534d7ad615 v0.1.2 2025-06-03 07:08:26 -07:00
ce03d7b5b0 add font metrics for 300-dpi printers 2025-06-02 17:40:58 -07:00
049c87869a Edit README.md 2025-06-02 17:33:05 -07:00
7 changed files with 23 additions and 7 deletions

View File

@@ -26,3 +26,12 @@ Usage
-----
```python -m partdb-labeler -h``` will show you the available options.
For convenience, you might also consider adding a short shell script somewhere in your PATH that will call the Python module
with your server configuration. I use this (the API key is a read-only key I've publicized elsewhere):
```
#!/usr/bin/env bash
python -m partdb-labeler -p https://partdb.alfter.us -k tcp_673fc81f0b7837ca4c029fbd6536b27742eb8b742eba27bf547c8136dc6a84f8 $*
```

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

BIN
dist/partdb_labeler-0.1.2.tar.gz vendored Normal file
View File

Binary file not shown.

View File

@@ -16,7 +16,7 @@ parser.add_argument("-q", help="send to selected print queue instead of stdout")
parser.add_argument("-p", help="PartDB base URL")
parser.add_argument("-k", help="PartDB API key")
parser.add_argument("-r", help="printer resolution (default: 203 dpi)", type=int)
parser.add_argument('-v', action='version', version='%(prog)s 0.1.1')
parser.add_argument('-v', action='version', version='%(prog)s 0.1.2')
args=parser.parse_args()
id=args.id
if args.x==None:
@@ -47,11 +47,18 @@ else:
# width and height for built-in monospace fonts (includes whitespace)
font_metrics={}
font_metrics[1]=(10,14)
font_metrics[2]=(12,18)
font_metrics[3]=(14,22)
font_metrics[4]=(16,26)
font_metrics[5]=(34,50)
if res==203:
font_metrics[1]=(10,14)
font_metrics[2]=(12,18)
font_metrics[3]=(14,22)
font_metrics[4]=(16,26)
font_metrics[5]=(34,50)
if res==300:
font_metrics[1]=(14,22)
font_metrics[2]=(18,30)
font_metrics[3]=(22,38)
font_metrics[4]=(26,46)
font_metrics[5]=(50,82)
# make substitutions for characters not in CP437

View File

@@ -8,7 +8,7 @@ authors = [
{name="Scott Alfter", email="scott@alfter.us"}
]
description = "PartDB Labeler"
version = "0.1.1"
version = "0.1.2"
readme = "README.md"
dependencies = ["requests", "zebra", "qrcode", "pillow"]