Giter Site home page Giter Site logo

labelmaker's People

Contributors

ducky64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

labelmaker's Issues

bug: One label is missing

labelmaker will not fill the entire page. One label is missing. I think it has to do something with the first line in cvs which contains the names of variables. So labels 8x3 should output 24 labels, but if so there is error saying "todo handle page overflow, new page support". With only 23 labels it is working ok, but one label is missing...

navod.svg.zip

OSX error

Me again. Testing on OSX following error poped up. On linux - ubuntu - it is working ok.
python labelmaker.py kp/kp-lepky-A4.svg kp/data.csv ss.svg
Traceback (most recent call last):
File "labelmaker.py", line 89, in
for row in data_reader:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 108, in next
row = self.reader.next()
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 10: ordinal not in range(128)
MacBook-Air-uzivatela-David:labelmaker dadoprom$ python labelmaker.py kp/kp-lepky-A4.svg kp/data1.csv ss.svg
Traceback (most recent call last):
File "labelmaker.py", line 89, in
for row in data_reader:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 108, in next
row = self.reader.next()
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 10: ordinal not in range(128)

Feature request: position to start

Now one last thing I would need. It often happens that you have a label sheet of paper where not all the labels were printed. Some are left empty.

So is it possible to implement this:

Generate svg labels: position to start on row 2 column 2. But only for the first page. This would be optional feature, I mean if you have new sheet of labels (no missing labels) you do not have to specify the start position, it would generate the whole page or better said as many labels as requested. Something like this. See a attached example svg file. I hope you understand my english :D

example-svg.zip

cant get it to work, please help

This is what it doeas with test files:
python labelmaker.py tests/testtemplate.svg tests/testdata.csv tests/vysledok.svg
Traceback (most recent call last):
File "labelmaker.py", line 62, in
StyleFilter()])
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 263, in init
raise TemplateError("No config command found")
SvgTemplate.TemplateError: No config command found

This is what it doeas with my test svg files:
python labelmaker.py kp/kp-lepky-A4.svg kp/kp-lepky-A4.csv output.svg
Traceback (most recent call last):
File "labelmaker.py", line 62, in
StyleFilter()])
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 260, in init
config_parse(self.base_etree.getroot())
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 254, in config_parse
if config_parse(child):
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 254, in config_parse
if config_parse(child):
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 244, in config_parse
text = get_text_contents(elt)
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 33, in get_text_contents
process_child(elt)
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 32, in process_child
process_child(child_child_elt)
File "/home/dadoprom/Stiahnuté/apky/labelmaker-master/SvgTemplate.py", line 28, in process_child
raise NotImplementedError("get_text_contents only supports tspan children, got '%s'" % strip_tag(child_elt.tag))
NotImplementedError: get_text_contents only supports tspan children, got 'title'

Cyrylic not supported

Hello,

Just stumbled on this and seemed quite useful, but it does not support cyrilyc (although it should by the looks of it)

Traceback (most recent call last):
  File "labelmaker.py", line 133, in <module>
    for row in data_reader:
  File "/usr/lib/python2.7/csv.py", line 104, in next
    row = self.reader.next()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-7: ordinal not in range(128)
labelmaker$ pip freeze
Pillow==3.2.0
argparse==1.2.1
configparser==3.5.0
wsgiref==0.1.2

attached samples

tst.zip

Cannot run test case

Hi,

I'm running python labelmaker.py tests/testtemplate.svg configs/1.75in_x_0.5in_4x6.ini tests/testdata.csv gen.svg but getting this error:

Traceback (most recent call last):
  File "D:\dev\labelmaker\labelmaker.py", line 141, in <module>
    for elt in template.generate(row):
  File "D:\dev\labelmaker\SvgTemplate.py", line 449, in generate
    substitute(filter_obj, elt)
  File "D:\dev\labelmaker\SvgTemplate.py", line 444, in substitute
    substitute(filter_obj, child)
  File "D:\dev\labelmaker\SvgTemplate.py", line 442, in substitute
    filter_obj.apply(self, elt, data_dict)
  File "D:\dev\labelmaker\SvgTemplate.py", line 131, in apply
    new_elts = self.replace(template, get_text_contents(text_elt), rect_elt)
  File "D:\dev\labelmaker\SvgTemplate.py", line 265, in replace
    thickness = units_to_pixels(cmd.get_kw_arg('thickness', 'barcode thickness', 3)) * template.get_viewbox_correction()
  File "D:\dev\labelmaker\SvgTemplate.py", line 52, in units_to_pixels
    match = re.search(r"(\d*.?\d+)\s*(\w*)", units_num)
  File "D:\scoop\apps\python\current\lib\re.py", line 201, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object
$ python --version
Python 3.9.6

Error on Ubuntu 14.04 LTS

This error apreared on Ubuntu 14.04 (as well as on OSX with python3) working ok on ubuntu 16.04

python3 kp/kp-lepky-A4.svg kp/data1.csv test.svg
File "kp/kp-lepky-A4.svg", line 1

^
SyntaxError: invalid syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.