ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* new module seeking approval: handlecsv
@ 2017-11-08 19:46 Pablo Rodriguez
  2017-11-11 19:01 ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2017-11-08 19:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Mojca,

I have submitted the handlecsv module to
https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=86.

It can handle different .csv files to data merging for document
automatic generation.

Would it be possible that it could be included in the ConTeXt Suite?

Many thanks for your help,

Pablo

PS: many kudos to Taco for solving the issue with the certificate.
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new module seeking approval: handlecsv
  2017-11-08 19:46 new module seeking approval: handlecsv Pablo Rodriguez
@ 2017-11-11 19:01 ` Mojca Miklavec
  2017-11-11 20:32   ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2017-11-11 19:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 8 November 2017 at 20:46, Pablo Rodriguez wrote:
> Dear Mojca,
>
> I have submitted the handlecsv module to
> https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=86.

Thank you. I believe we would need to have it accessible as an
extracted folder called t-handlecvs under

        https://modules.contextgarden.net/dl/

Taco should probably figure out how to fix that.

> It can handle different .csv files to data merging for document
> automatic generation.

It would be helpful to figure out what exactly is missing in the
built-in module written by Hans. Maybe that module could be upgraded
as well?

> Would it be possible that it could be included in the ConTeXt Suite?

It would be helpful if Taco could fix another issue, see above.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new module seeking approval: handlecsv
  2017-11-11 19:01 ` Mojca Miklavec
@ 2017-11-11 20:32   ` Pablo Rodriguez
  2017-11-12 10:46     ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2017-11-11 20:32 UTC (permalink / raw)
  To: ntg-context

On 11/11/2017 08:01 PM, Mojca Miklavec wrote:
> On 8 November 2017 at 20:46, Pablo Rodriguez wrote:
>> [...] 
>> It can handle different .csv files to data merging for document
>> automatic generation.
> 
> It would be helpful to figure out what exactly is missing in the
> built-in module written by Hans. Maybe that module could be upgraded
> as well?

If the module is
tex/texmf-context/tex/context/modules/mkiv/m-database.mkiv, I think this
is only intended for typesetting the database contents.

handlecsv enables document merging. With the first (stupid) sample that
comes to my mind:

    \starttext
    \startbuffer
    \Name\ has completed the course {\em\Course}, achieving the
    following grade: \Grade.\page
    \stopbuffer
    \doloopforall{\getbuffer}
    \stoptext

Having to do that with before and after options would be a pain (in my
opinion).

You may page through
https://github.com/ousia/handlecsv/blob/context-suite/doc/context/third/handlecsv/handlecsv.pdf
to see the features.

I wonder whether it makes sense to extend the built-in module by Hans.
If this wasn’t needed before, it may be not needed now. And Hans’ time
is most precious to devote to other issues ;-).

BTW, handlecsv is coded by Jaroslav Hajtmar. I only release the module
to the public.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new module seeking approval: handlecsv
  2017-11-11 20:32   ` Pablo Rodriguez
@ 2017-11-12 10:46     ` Mojca Miklavec
  2017-11-12 16:32       ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2017-11-12 10:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11 November 2017 at 21:32, Pablo Rodriguez wrote:
> On 11/11/2017 08:01 PM, Mojca Miklavec wrote:
>> On 8 November 2017 at 20:46, Pablo Rodriguez wrote:
>>> [...]
>>> It can handle different .csv files to data merging for document
>>> automatic generation.
>>
>> It would be helpful to figure out what exactly is missing in the
>> built-in module written by Hans. Maybe that module could be upgraded
>> as well?
>
> If the module is
> tex/texmf-context/tex/context/modules/mkiv/m-database.mkiv, I think this
> is only intended for typesetting the database contents.

Well, it parses CSV files and typesets them in an arbitrary way.

> handlecsv enables document merging. With the first (stupid) sample that
> comes to my mind:
>
>     \starttext
>     \startbuffer
>     \Name\ has completed the course {\em\Course}, achieving the
>     following grade: \Grade.\page
>     \stopbuffer
>     \doloopforall{\getbuffer}
>     \stoptext

Which is exactly what the other module supports. See page 4 of
    http://dl.contextgarden.net/myway/csv.pdf

> Having to do that with before and after options would be a pain (in my
> opinion).
>
> You may page through
> https://github.com/ousia/handlecsv/blob/context-suite/doc/context/third/handlecsv/handlecsv.pdf
> to see the features.

The old module doesn't support invoking columns by title and doesn't
do any special filters. Another limitation might be that it uses #1,
#2, ... which reaches it limits pretty soon, but I'm sure that could
(should?) be fixed anyway.

And certainly the documentation by Jaroslav is much much better
written than my poor mock-up.

> I wonder whether it makes sense to extend the built-in module by Hans.
> If this wasn’t needed before, it may be not needed now.

This is an oxymoron. If the functionality is not needed: then why do
we need that new module in the first place? :)

What I want to encourage is one well-written and fully functional
module rather than ending up with ten solution, each one of them with
its own set of bugs. The MKII version of the database module
admittedly has a number of issues, in particular when it comes to
non-ascii. There might be issues with MKIV as well, I haven't used it
for a while because I now usually start with lua tables. But all in
all it would be much better to have some "perfectly working" built-in
functionality to parse CSV files in my opinion.

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new module seeking approval: handlecsv
  2017-11-12 10:46     ` Mojca Miklavec
@ 2017-11-12 16:32       ` Pablo Rodriguez
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Rodriguez @ 2017-11-12 16:32 UTC (permalink / raw)
  To: ntg-context

On 11/12/2017 11:46 AM, Mojca Miklavec wrote:
> On 11 November 2017 at 21:32, Pablo Rodriguez wrote:
>> [...]
>> If the module is
>> tex/texmf-context/tex/context/modules/mkiv/m-database.mkiv, I think this
>> is only intended for typesetting the database contents.
> 
> Well, it parses CSV files and typesets them in an arbitrary way.

If the module is the same as
http://dl.contextgarden.net/myway/csv.pdf#page=4, having to generate
letters inside a command definition may be a real pain with it.

>> handlecsv enables document merging. With the first (stupid) sample that
>> comes to my mind:
>>
>>     \starttext
>>     \startbuffer
>>     \Name\ has completed the course {\em\Course}, achieving the
>>     following grade: \Grade.\page
>>     \stopbuffer
>>     \doloopforall{\getbuffer}
>>     \stoptext
> 
> Which is exactly what the other module supports. See page 4 of
>     http://dl.contextgarden.net/myway/csv.pdf

Enabling conditional text fragments inside the command definition
doesn’t seem an easy task.

It seems to be much easier to deploy in with the buffer approach (from
handlecsv).

>> Having to do that with before and after options would be a pain (in my
>> opinion).
>>
>> You may page through
>> https://github.com/ousia/handlecsv/blob/context-suite/doc/context/third/handlecsv/handlecsv.pdf
>> to see the features.
> 
> The old module doesn't support invoking columns by title and doesn't
> do any special filters. Another limitation might be that it uses #1,
> #2, ... which reaches it limits pretty soon, but I'm sure that could
> (should?) be fixed anyway.

The approach is different, because the needs are different.

Extending the original module is an option, but ConTeXt has plenty of
things to improve that could come first.

> And certainly the documentation by Jaroslav is much much better
> written than my poor mock-up.

Many thanks for the compliment. The documentation was written by me ;-).

I wrote the documentation after having used the module to create an
automatic document generation method at work. It is far from being
perfect, but it solves some issues.

Your documentation is clear. And your sample on
http://dl.contextgarden.net/myway/csv.pdf#page=7 shows which is the
proper scenarion for the module.

handlecsv was written with something different in mind. Not better or
worse, but simply diverse.

>> I wonder whether it makes sense to extend the built-in module by Hans.
>> If this wasn’t needed before, it may be not needed now.
> 
> This is an oxymoron.

Many thanks for your kindness in the objection :-), although I don’t
think there is a contradiction. I didn’t explain myself well.

> If the functionality is not needed: then why do we need that new
> module in the first place? :)

First, time devoted to ConTeXt is scarce and there are many areas for
improvements (I could name a few :-)).

Second, if the functionality wasn’t required *in that module*, does it
make sense to implement it now?

> What I want to encourage is one well-written and fully functional
> module rather than ending up with ten solutions, each one of them with
> its own set of bugs.

This should be similar to parallel text streams. Hans stated that he
would implement it, when there were a unified proposal.

I don’t think it makes sense to implement new features in the old module
before users start using the new module. Their approaches are totally
different.

> The MKII version of the database module admittedly has a number of
> issues, in particular when it comes to non-ascii.
Does it even make sense even to fix the issues the old module has for
MkII? (If no one had problems for years, new usage cases should deploy
MkIV.)

BTW, handlecsv doesn’t support MkII (only MkIV).

> There might be issues with MKIV as well, I haven't used it
> for a while because I now usually start with lua tables.

It is probably a better method, isn’t it?

> But all in all it would be much better to have some "perfectly
> working" built-in functionality to parse CSV files in my opinion.
Voltaire wrote « le mieux est l’ennemi du bien » (“the perfect is the
enemy of the good”), which is also a saying in Spanish.

I mean, the present m-database.mkiv is just fine for addding tables to
ConTeXt document. A sounder approach to document merging would be to use
SQL databases.

Betweeen those two needs, one can use handlecsv. But I realize that the
best option for some tasks is SQL (I cannot use it at work).

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-12 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 19:46 new module seeking approval: handlecsv Pablo Rodriguez
2017-11-11 19:01 ` Mojca Miklavec
2017-11-11 20:32   ` Pablo Rodriguez
2017-11-12 10:46     ` Mojca Miklavec
2017-11-12 16:32       ` Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).