Open alexander-winkler opened 3 years ago
Hi Alexander,
I've always meant to make the pymods parser more flexible to various inputs. My workflows have always involved local XML files, so I never got around to implementing that feature. I'm happy to hear that someone else is using pymods, so that will bump the priority up for me a bit.
My family just welcomed our first child recently, so unfortunately I don't have much time to work on this at the moment. If you're comfortable submitting a PR implementing string parsing, I'll consider it for merging. Otherwise, it might be a little bit until I'm back in the office and ready to spend time on this.
If you need a short-term solution, you can write out requests.get(<your request url>).text
and pass that to the parser. If you're working with OAI-PMH data, I've had a lot of success with with Mark Phillips' pyoaiharvester. It's a python2 utility, but it's very helpful at getting OAI-PMH data where you can use it.
Best, -MM
Hello!
I'm trying to apply the MODSReader not to a xml-file (as in the examples provided) but rather on
requests.get
-responses I've tried transforming the xml-string into a file-like object usingio.StringIO
(which would be the usual way to deal with the issue in etree, I guess), but I'm getting aValueError
:Could you suggest me a way to pipe the xml-string directly into the parser?
Thank you very much!