yulqen / datamaps

MOVED: Command line interface to yulqen/bcompiler-engine. Used by DfT to collect and clean data using Excel spreadsheets.
https://git.sr.ht/~yulqen/datamaps
MIT License
2 stars 2 forks source link

Xlsm file requirement for blank_template #21

Open banillie opened 2 years ago

banillie commented 2 years ago

At the moment for export blank_template needs to be an xlsm file. Would be possible to handle xlsx files also? Thanks.

yulqen commented 2 years ago

I guess so. If I remember, the reason for using "xlsm" files was because the template contained macros. Not sure why "xlsx" files weren't enabled also. What's your timescale?

On 01-11-2021, Will Grant wrote:

At the moment for export blank_template needs to be an xlsm file. Would be possible to handle xlsx files also? Thanks.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/yulqen/datamaps/issues/21

--

Matthew Lemon Email: @.***

banillie commented 2 years ago

No timescale really. Whenever's good for you. Cheers.

yulqen commented 2 years ago

As far as I can tell, xlsx files are imported fine (datamaps import templates -d datamap.csv -m --inputdir . for example).

export creates xlsm files from a master but these can just be re-saved as xlsx files if you wish.

As far as I recall, we wanted the blank_template file to be macro-enabled for some reason - are you saying that you want these exported files to be xlsx files now, or do you want the choice?

Be good to get a more detailed scenario or the problem you are facing/the exact params you'd like to see in the Issue! We can discuss later in the week of course.

banillie commented 2 years ago

Ok thanks. I'll look into this further with the team and get back to you.

banillie commented 2 years ago

Hiya, re the above it would be good if the datamaps export command could simply handle both .xlsm and .xlsx files. This is a because the team is using datamaps for another data gathering bit of work which doesn't need an .xlsm file (only a simple xlsx).

yulqen commented 2 years ago

Ok.

Options for implementation

(Note to self: point at where decision is made is in bcompiler-engine.repository.templates:93.) Just thinking out loud here.

  1. cmd line param to set desired file type in datamaps (datamaps.main:329).
  2. Handle in bcompiler-engine.adapters.cli:89.
  3. Actually, it would be simpler/clearer if the output format matched the blank template, with no further config or user intervention. Then all code could be handled inside MultipleTemplatesWriteRepo.
yulqen commented 2 years ago

@banillie - Would you be content for the file type of the exported spreadsheets to match that of the template? In other words, if the blank template file is xlsx, the exported templates will be xlsx also? This is considerably more straightforward than adding a new command line option which allows the user to choose the output format and would be my preference in terms of simplcity. Happy to implement the command line flag option but it will take a bit longer.

banillie commented 2 years ago

Yes absolutely. Simply output the same file format. I think that makes more sense in terms of design anyway. Cheers.

yulqen commented 1 year ago

Wow - I need to do this.