Re: Parsing GS1-128
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
Re: Parsing GS1-128
- From: Arthur de Jong <arthur [at] arthurdejong.org>
- To: Sergi Almacellas Abellana <sergi [at] koolpi.com>, python-stdnum-users [at] lists.arthurdejong.org
- Subject: Re: Parsing GS1-128
- Date: Sun, 26 May 2019 13:31:50 +0200
Thank you for your GTIN PR!
On Wed, 2019-05-22 at 17:52 +0200, Sergi Almacellas Abellana wrote:
> We are interested on parsing a code and obtaining the correct data
> types on python. So for example, parsing:
> 01 12345678901234 11 190102 17 190104
> (Note that I included spaces for clarification but GS1-128 does not
> include spaces)
>
> We want to obtain something like:
>
> data = {
> '01': '12345678901234',
> '11': datetime.date(2019, 01, 02),
> '17': datetime.date(2019, 01, 04),
> }
> Do you think this will fit into python-stdnum library?
I think so, feel free to make a PR.
Other modules that provide something like the above are called info()
or split() in python-stdnum.
From my understanding GS1-128 embeds a various numbers with an
application identifier prefix. If these numbers are interesting in
their own right (e.g. GTIN/EAN) having them in their own module would
be really nice (especially if extra validation there would be useful).
Parts that only handle a date or size should probably be part of the
gs1_128 module.
It would be really nice if you could provide an implementation for
this.
Thanks!
--
-- arthur - arthur@arthurdejong.org - https://arthurdejong.org/ --
- Parsing GS1-128,
Sergi Almacellas Abellana
- Re: Parsing GS1-128,
Arthur de Jong