Re: Parsing GS1-128
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
Re: Parsing GS1-128
- From: Sergi Almacellas Abellana <sergi [at] koolpi.com>
- To: python-stdnum-users [at] lists.arthurdejong.org
- Subject: Re: Parsing GS1-128
- Date: Fri, 31 May 2019 00:21:20 +0200
Hi Arthur,
First of all, thank you for your comments
On 26/5/19 13:31, Arthur de Jong wrote
> 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.
Great, I will slowly implement it as I want to have some tests and user
feedback first. Then I will publish a review.
>
> Other modules that provide something like the above are called info()
> or split() in python-stdnum.
Ok, I will go for info() as the list can be large.
BTW: we have the need to build a gs1-128 code from the data and we will
like to introduce this feature.
Is there some naming convetion about this "reverse" functions?
> 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.
Ok, I will follow this approach.
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk