Import_txt script

Previous topic - Next topic

Tijo

In this video, we'll explore an exciting Python script that simplifies the data import process. This script will help you save time and automate the process of adding textual content to your Scribus projects.







Github:
https://github.com/tijo95/Scribus-CSV-Importer



a.l.e

interesting script!

did you create as an exercise or are you using for a specific workflow?

i like the entries browser you have created.

if i dare to give you three suggestions:

- i'm not fond of the variable and function names in french... being there, done that and i've learned to use "localised" names only for exceptional cases.

- you should reduce a bit the comments. as an example, in

# Fonction pour incrémenter le numéro de ligne
def incrementer_ligne():
    pass

you could name the function `incrémente_numéro_ligne()` (or, better, `increment_line_number()`...) and delete the comment : - )

- i would also use

if __name__ == "__main__":
    main()

at the end of the script to avoid global variables and give a clear workflow to the script.

Tijo

lol .

To tell you the truth, I started with an en/fr version with a drop-down list. During development, I encountered quite a few translation management problems, using two language files.

if not, yes, you can always improve. next update I'll bring the translation to the script.

For navigation, I've thought of something to minimize the number of hand movements between keyboard and mouse, so as to optimize time. And as I said, all that's missing is the ability to use the script with active content properties...

a.l.e

well, my comment was about using french in the code not in the UI : - )

anyway, i'm still curious what is the use case for your script...

Tijo

Here's an example of how I use the script to integrate article labels



a.l.e

Nice!

Looking at this makes me wish, the scripter would have some support for getting things from the scrapbook.

But I guess, that -- as a workaround -- it should be possible to get "cliparts" from a separate document.

Tijo

Hi everyone, please test out the new commit. Thanks

a.l.e

hi tijo

so, during the last few days, i've been thinking about your project and -- as i wrote -- i like it.

but, i have a hard time finding specific points, where i can give a feedback (on top of the general ones i've already written above).

but there is one more general hint from me... and then "something completely different" (not really...).

first the hint: i have the feeling that you're trying to create a general solution for putting a catalogue from an excel file.
from my point of view, the scribus scripter is probably not really up to the task. what i would rather try to achieve, is to build a solid foundation and then create tools for specific workflows on top of it.

indeed, there are things that are always the same and it's a good idea to write a common script to solve them.
but i would try to keep that script as simple as possible, and when i need to support a specific workflow, adapt it for that "client".

and now the "something completely different": it's not really a "would", but i'm trying to do it : - )

as you might have seen from some of my posts here (or in the bug tracker), i'm working on a script inspired by your work.
i will be publishing it soon.

so, my feedback will rather be in the form of some code that solves a same problem in a slightly different way: up to you, if you want to "steal" some ideas or just ignore it : - )

have a wonderful sunday
a.l.e

Tijo

hi a.l.e  8)

-Yes, my aim is to set up a catalog from an Excel file.

- in my last version i found some problems with importing .csv files, i'll fix it after some time .
 I've also noticed that when the script stays open for a long time, it tends to crash scribus.

-I can't wait to try your work,