WhyNotHugo / python-barcode

㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
http://python-barcode.rtfd.io/
MIT License
572 stars 123 forks source link

`barcode.PROVIDED_BARCODES` usage in docs is faulty #235

Closed HardMax71 closed 2 months ago

HardMax71 commented 2 months ago

Using this page from docs, i tried to replicate following example:

>>> import barcode
>>> barcode.PROVIDED_BARCODES
['code128', 'code39', 'ean', 'ean13', 'ean14', 'ean8', 'gs1', 'gs1_128', 'gtin', 'isbn', 'isbn10', 'isbn13', 'issn', 'itf', 'jan', 'pzn', 'upc', 'upca']
>>> EAN = barcode.get_barcode_class('ean13')
>>> EAN

It failed on second line with following message:

Python 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32
>>> import barcode
>>> barcode.PROVIDED_BARCODES
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\PyCharm Professional\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
AttributeError: module 'barcode' has no attribute 'PROVIDED_BARCODES'

Could you fix docs and/or example pls? Also tried to call barcode.get_barcode_class(..) - failed with same AttributeError.


Python 3.11.9, python-barcode 0.15.1

HardMax71 commented 2 months ago

Sorry, error on my side, closed.