mapping-commons / sssom-py

Python toolkit for SSSOM mapping format
https://mapping-commons.github.io/sssom-py/index.html#
MIT License
49 stars 12 forks source link

Suggestion: `write_table`: pass outpath alternative to `TextIO` #516

Open joeflack4 opened 6 months ago

joeflack4 commented 6 months ago

Just a minor suggestion. Instead of requiring that it be like this:

with open(outpath, 'w') as f:
    write_table(msdf, f)

how about having this option?

write_table(msdf, outpath)
matentzn commented 6 months ago

I think you are right, this would be convenient, but just like pandas:

msdf.to_tsv(outpath)

or

msdf.to_json(outpath)
joeflack4 commented 6 months ago

Yeah I was thinking of that too; I think that's even better.