orgparse icon indicating copy to clipboard operation
orgparse copied to clipboard

Document status of date parsing

Open jjlee opened this issue 4 years ago • 4 comments

Is orgparse.date public API? I'd like to use it in my code, but I'm not sure if it's intended as public API, and I wouldn't want to depend on it as library code if if it's not guaranteed to stay around as a stable API (by "stable" I don't mean "not growing" of course: just not mutating existing interfaces, except for carefully considered things like bugs, undefined behaviour...).

If it isn't public & stable, I'll just copy it and it will still be useful :-) -- just not as much as maintained library code of course.

jjlee avatar Oct 13 '19 20:10 jjlee

Good question! Not 100% sure as I'm not the original author of the library, but it looks very well written and thorough judging by source code, so I'd say it's stable. Personally I'm using it only to convert to datetime for further processing by other tools and scripts.

Definitely not planning to break it deliberately, so feel free to use it!

karlicoss avatar Oct 15 '19 23:10 karlicoss

I apologise in advance for asking a stupid question, but I've been trying to convert OrgDateClock, OrgDateClosed, OrgDateScheduled, etc objects to datetime objects, but can't seem to figure it out. How can I do that?

I couldn't find it in the docs, but might be a useful addition - should I create a separate Issue for that?

MarcvdSluys avatar May 28 '20 06:05 MarcvdSluys

@MarcvdSluys no problem! There are start/end methods: here, does that work for you? start is what I'm using in my tools to get native Python dates.

karlicoss avatar May 28 '20 07:05 karlicoss

Yes it does - I'm an idiot. I tried that before, but got an error. Turns out that was on a headline without completion date befor I got to the one that should work. I apologise again an thank you for your quick reply and the useful code!

MarcvdSluys avatar May 28 '20 08:05 MarcvdSluys