Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Experience of naming scheme for output files #25

Open
davidverweij opened this issue May 6, 2020 · 10 comments
Open

User Experience of naming scheme for output files #25

davidverweij opened this issue May 6, 2020 · 10 comments
Labels
discussion General discussion about the repo, functionanility of the code or other topics related to this repo. enhancement New feature or request

Comments

@davidverweij
Copy link
Owner

As referred to in my code review of #22, we should have a discussion around what the user expects, and what use cases we envision for the CLI or module. For example, there are a few considerations:

  • What is not all rows have data in the column assigned for the naming scheme?
  • What if there is no need for a relation between the filename and the data? (i.e. do we want a default behaviour, e.g. numbering files)
  • How about more composite naming schemes, such as a possible combination of the template.docx and one or multiple .csv headers? I am imagining an invoice, with invoice.docx as template, and an output such as invoice_eventX_david_verweij_March_2020.docx

Next steps

Before implementing any code, I would like to kick off this discussion below. What are your thoughts on these use cases, any use cases you can think of (or have experienced yourself) and to what extent is this something our script should handle (considering OS native solution to batch rename files).

@davidverweij davidverweij added enhancement New feature or request discussion General discussion about the repo, functionanility of the code or other topics related to this repo. labels May 6, 2020
@salmannotkhan
Copy link
Contributor

salmannotkhan commented May 6, 2020

I'm thinking about that default thing. I guess we can do somthing about it like default naming would be e.g. Document.docx, Document_2.docx and so on.

We just have to put default parameter in function like name="Document" and the function will do the rest of work

About multiple columns i have to check how click is handling multiple argument for same parameter

And for missing data in CSV we can use default naming scheme e.g. Document.docx, Document_2.docx and so on

Another thing I was thinking about adding more output to command like where the files are saved, is there any missing data in name column etc. So user can know what's going on.

Repository owner deleted a comment from salmannotkhan May 6, 2020
Repository owner deleted a comment from salmannotkhan May 6, 2020
@jawrainey
Copy link
Collaborator

jawrainey commented May 6, 2020

I deleted and merged those comments with your first as it's easier to read 👍 Feel free to edit comments as you have new ideas if no one has responded 🦾

@salmannotkhan
Copy link
Contributor

@jawrainey what do you think about my solution should I implement it?

@davidverweij
Copy link
Owner Author

@salmannotkhan, please refrain from implementing at the moment - although I admire your enthusiasm! 👍 Let's first take our time to discuss the pros and cons for each possible implementation (such as your suggestion), and then we'll assign this task to one of the contributors. If you have any thoughts, do share them (as @jawrainey indicates above) here, or in any of the other Issues we set up.

After all, this is a project on-the-side from our full-time occupation, and we intend to keep the pace rather low (not day-by-day changes). And to add to that, there are more collaborators eager to contribute in code! (Including myself and @jawrainey) 🤓

@salmannotkhan
Copy link
Contributor

I understand your point but I'm more of coding than discussing person. that's why I'm eager to implement things than discussing them.
Pardon my eagerness.

@salmannotkhan
Copy link
Contributor

salmannotkhan commented May 9, 2020

I was thinking what if we give user option to create one docx file that contains all of the mailmerged documents?

@davidverweij
Copy link
Owner Author

That does make for a nice option in the use of the library. Do you think many people would need such an option? I.e. is this a scenario you might have seen people using Word for? Let's keep this option on our 'wish list' - and if we would get requests for this feature we can consider implementing it.

@salmannotkhan
Copy link
Contributor

It is most required feature just think about it you have mailmerge 100 documents and you want to print them all. You can't open 100 documents separately and print them one by one. But if all the merged documents are in one docx you just have to click print.

@davidverweij
Copy link
Owner Author

davidverweij commented May 20, 2020

Good point! I honestly didn't think about the scenario that someone would want to print the output. Somehow I was only thinking about digital uses. @salmannotkhan can you please open up an Issue that describes this as a feature request? We can then keep this issue focused on the naming convention. Cheers!

edit - thinking about this a bit more, this would equally be good once we have the export to pdf option. Perhaps the libary can receive a parameter, e.g. 'merge' which will do just that?

@davidverweij
Copy link
Owner Author

Regarding the naming scheme,

My suggestion would be to allow for one or multiple strings (an ordered List) for the .csv header name, plus a 'separator'. Then, instead of throwing an error if the header is not found, any non-found headers are read literally in the naming scheme. One 'concern' I might have with this solution would be that it might be functionality that is hardly used. Example:

# in csv2docx.py
def convert(
    data: str, 
    template: str, 
    name: Union[str, List[str]],    # changed
    name_sep: str = "-",            # new
    path: str = "output", 
    delimiter: str = ";"
) -> None:

In the click CLI we can then use the multiple options parameter to allow for a list of strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion General discussion about the repo, functionanility of the code or other topics related to this repo. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants