bug-recutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-recutils] Python support


From: Michał Masłowski
Subject: Re: [bug-recutils] Python support
Date: Tue, 23 Jul 2013 21:01:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi.

> a) The duplicate functions.

Librec doesn't use reference counting: all objects inside other objects
are deep copied.  This makes duplicating objects more useful than in
Python where references are typically used.  Maybe implement the special
methods used by the copy module instead?  (I haven't tried to understand
how Recutils and Python memory management would cooperate.)

> b) Functions that get/set elements, msets (I think we don't need to
> expose msets).

We need some way of iterating records and comments, msets with list-like
interface could do this.  Making custom element types doesn't look
useful outside of librec, so it could be omitted.

> c) Comment functions.

These work just as strings, so the APIs using them could accept Python
strings and translate them into rec_comment_t.

> d) Integrity checks, for a database alone is enough?

Being able to use them would make writing Python scripts modifying
recfiles easier.

> e) Encryption routines for field and record.
> f) Aggregate functions.

Maybe these could be implemented later, they don't seem to affect the
design much.  Implementing aggregate functions in Python could be
useful, while it should be easy to do similar processing of query
results in Python scripts instead.

> It may be better if you could tell me what functions/functionality are
> *absolutely* necessary in Python. I will modify accordingly. Thanks.

Maybe write a specific script using these bindings?  It could be simpler
than finding a necessary minimum functionality.

I have some uses for readonly processing of recfiles, being able to
iterate over all rsets and records of a recfile should be sufficient for
it.  Reimplementing one of the utils would show what functionality might
be useful, I think it would be too much to implement now (although
rec2csv looks simple and Python has its own csv module).

Attachment: pgpZ64vUmsm5u.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]