8000 Replace isodate · Issue #33 · Azure/msrest-for-python · GitHub
[go: up one dir, main page]

Skip to content

Replace isodate #33

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

Open
lmazuel opened this issue Jul 3, 2017 · 1 comment
Open

Replace isodate #33

lmazuel opened this issue Jul 3, 2017 · 1 comment

Comments

@lmazuel
Copy link
Member
lmazuel commented Jul 3, 2017

Following discussion with @zooba about isodate:

  • Isodate is not maintained anymore for 2 years. Direct Gmail email to the author get no answer as well.
  • Isodate still uses 2to3
  • I got no issue adapting it without 2to3, but since the owner abandoned the project, it's useless.

The features we use of isodate are:

  • Parsing / serializing of ISO8601 datetime
  • Parsing / serializing of ISO8601 duration

Datetime is simple, and move from isodate is straightforward.

Duration is way more complicated, since this is relative duration (one month can't be converted to timedelta). Isodate algorithm returns timedelta instances for duration defined in days/hours/..., and a specific isodate.Duration class for ambiguous relative duration. It's dynamic based on what is parsed.

I found aniso8601 to parse duration. Aniso8601 is not using dynamic return type, there is a relative flag to decide if you want timedelta (might be converted with 1 month == 30 days), or dateutil.relativedelta to keep the precision. Aniso8601 does not serialize, but it's not the most complicated part.

Moving this dependency will also imply that users will get different object from a SDK call, moving from the couple timedelta/isodate.Duration to dateutil.relativedelta.

Considering that the issue itself (2to3 on Py3 install) is not that critical for now, and that there is no direct obvious solution, I plan to do nothing for now, but I keep this issue open for the record of what I found. Eventually we'll have to work on this.

FYI @johanste

@smereczynski
Copy link

It's really easy to fix isolate and maintain it. I did that months ago for the compatibility with Azure Functions in Py 3.6. https://github.com/smereczynski/isodate. Maybe it will be much easier to fork it and include?

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

2 participants
0