arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
502 stars 211 forks source link

Add GS1-128 parsing support #144

Closed pokoli closed 4 years ago

pokoli commented 5 years ago

Following https://lists.arthurdejong.org/python-stdnum-users/2019/msg00000.html

pokoli commented 5 years ago

I think this is now ready for testing and comments.

arthurdejong commented 5 years ago

I think this is now ready for testing and comments.

Hi Sergi,

There are already a few questions and comments on your pull request. Can you have a look at them? I'm fine with making some changes myself to merge this but there are some bits that are more difficult for me at this time.

The biggest blocker is the encoding of FNC1. It would be really nice to see how to generate an actual bar code so I can get a better feel for how the API should look like.

Thanks.

pokoli commented 4 years ago

Hi,

I've addressed most of the comments. It will be great if you can have a look at it.

pokoli commented 4 years ago

ping @arthurdejong

Will be great if you can give a second review on this.

Thanks in advance!

arthurdejong commented 4 years ago

Hi @pokoli ,

Sorry not to get around to this sooner but I rewrote bit parts of your contribution as 180788a. It should support a wider range of application identifiers and the list of GS1 application identifiers can also be downloaded from the GS1 website.

Other than that it also adds validate() and is_valid() functions which is more or less required for all number modules in python-stdnum.

I've included a wider range of tests and added a separator option that can be used to specify a value to use as FNC1 separator. That should make it easier for code that calls this to supply something that can be used in barcodes. The encode() function now also has a parentheses option to surround the application identifiers by parentheses (mostly to make my tests more readable).

Thanks for providing your pull request.

pokoli commented 4 years ago

@arthurdejong Thanks for your work on it!