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

Add ability to parse ISO 8601 duration to timedelta. #65

Open
frenzyk opened this issue Jul 7, 2018 · 2 comments
Open

Add ability to parse ISO 8601 duration to timedelta. #65

frenzyk opened this issue Jul 7, 2018 · 2 comments

Comments

@frenzyk
Copy link

frenzyk commented Jul 7, 2018

Like in this lib: isodate
Lib python code if needed

Examples:
P1Y2M6DT20H46M20S
PT1H5M26S
PT9H55M

Wiki description

@movermeyer
Copy link
Collaborator

movermeyer commented Jul 13, 2018

Thanks for the suggestion!

Do you have a need for this in your usage? Or is this request mostly to help make ciso8601 a complete ISO 8601 parser?

If you have an immediate need for a fast duration parser, Pendulum can already do this:

from pendulum.parsing import parse_iso8601
parse_iso8601("P1Y2M6DT20H46M20S").as_timedelta()

I'd be willing to accept a Pull Request for this.

@kinow
Copy link
Contributor

kinow commented Nov 12, 2021

Learned about ciso8601 via Arvados workflow manager that uses it as dependency. My previous job I worked on Cylc Flow, which uses metomi-isodatetime that also handles periods.

It is useful for tools like workflow managers if they want to allow for recurrence of tasks.

I'd be willing to accept a Pull Request for this.

👍 shame I don't have time, but otherwise it'd be fun to work on this one.

Thanks for ciso8601!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants