|
From: | Maninya M |
Subject: | Re: [bug-recutils] Python support |
Date: | Mon, 29 Jul 2013 18:47:47 +0530 |
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.)
We need some way of iterating records and comments, msets with list-like
> b) Functions that get/set elements, msets (I think we don't need to
> expose msets).
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.
Being able to use them would make writing Python scripts modifying
> d) Integrity checks, for a database alone is enough?
recfiles easier.
Maybe these could be implemented later, they don't seem to affect the
> e) Encryption routines for field and record.
> f) Aggregate functions.
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.
Maybe write a specific script using these bindings? It could be simpler
> It may be better if you could tell me what functions/functionality are
> *absolutely* necessary in Python. I will modify accordingly. Thanks.
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).
sample.c
Description: Text Data
books.rec
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |