Re: Library for parsing binary structures

2019-03-30 Thread Cameron Simpson
On 30Mar2019 10:29, Paul Moore wrote: On Fri, 29 Mar 2019 at 23:21, Cameron Simpson wrote: On 27Mar2019 18:41, Paul Moore wrote: >I'm looking for a library that lets me parse binary data structures. >The stdlib struct module is fine for simple structures, but when it >gets to more

Re: Library for parsing binary structures

2019-03-30 Thread Paul Moore
On Fri, 29 Mar 2019 at 23:21, Cameron Simpson wrote: > > On 27Mar2019 18:41, Paul Moore wrote: > >I'm looking for a library that lets me parse binary data structures. > >The stdlib struct module is fine for simple structures, but when it > >gets to more complicated cases, you end up doing a lot

Re: Library for parsing binary structures

2019-03-29 Thread Cameron Simpson
On 30Mar2019 09:44, Cameron Simpson wrote: On 27Mar2019 18:41, Paul Moore wrote: I'm looking for a library that lets me parse binary data structures. The stdlib struct module is fine for simple structures, but when it gets to more complicated cases, you end up doing a lot of the work by hand

Re: Library for parsing binary structures

2019-03-29 Thread Cameron Simpson
On 27Mar2019 18:41, Paul Moore wrote: I'm looking for a library that lets me parse binary data structures. The stdlib struct module is fine for simple structures, but when it gets to more complicated cases, you end up doing a lot of the work by hand (which isn't that hard, and is generally

Re: Library for parsing binary structures

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 16:34:35 +, Paul Moore wrote: > On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote: > > > Obviously you need some way to describe the specific binary format you > > want to parse - in other words, a grammar. The library could then use > > the grammar to parse the input -

Re: Library for parsing binary structures

2019-03-29 Thread Paul Moore
On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote: > Obviously you need some way to describe the specific binary format you > want to parse - in other words, a grammar. The library could then use > the grammar to parse the input - either by interpreting it directly, or > by generating (Python)

Re: Library for parsing binary structures

2019-03-29 Thread Dan Sommers
On 3/29/19 12:13 PM, Peter J. Holzer wrote: Obviously you need some way to describe the specific binary format you want to parse - in other words, a grammar. The library could then use the grammar to parse the input - either by interpreting it directly, or by generating (Python) code from it.

Re: Library for parsing binary structures

2019-03-29 Thread Peter J. Holzer
On 2019-03-28 11:07:22 +0100, dieter wrote: > Paul Moore writes: > > My real interest is in whether any libraries exist to do this sort > > of thing (there are plenty of parser libraries for text, pyparsing > > being the obvious one, but far fewer for binary structures). > > Sure. *BUT* the

Re: Library for parsing binary structures

2019-03-28 Thread dieter
Paul Moore writes: > On Thu, 28 Mar 2019 at 08:15, dieter wrote: > ... > My real interest is in whether any > libraries exist to do this sort of thing (there are plenty of parser > libraries for text, pyparsing being the obvious one, but far fewer for > binary structures). Sure. *BUT* the

Re: Library for parsing binary structures

2019-03-28 Thread Paul Moore
On Thu, 28 Mar 2019 at 08:15, dieter wrote: > What you have is a generalized deserialization problem. > It can be solved with a set of deserializers. Yes, and thanks for the suggested code structure. As I say, I can certainly do the parsing "by hand", and the way you describe is very similar to

Re: Library for parsing binary structures

2019-03-28 Thread dieter
Paul Moore writes: > I'm looking for a library that lets me parse binary data structures. > The stdlib struct module is fine for simple structures, but when it > gets to more complicated cases, you end up doing a lot of the work by > hand (which isn't that hard, and is generally perfectly viable,

Library for parsing binary structures

2019-03-27 Thread Paul Moore
I'm looking for a library that lets me parse binary data structures. The stdlib struct module is fine for simple structures, but when it gets to more complicated cases, you end up doing a lot of the work by hand (which isn't that hard, and is generally perfectly viable, but I'm feeling lazy ;-))