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 conversion support for the jiff datetime library #4510

Closed
rumpelsepp opened this issue Sep 2, 2024 · 3 comments · Fixed by #4823
Closed

Add conversion support for the jiff datetime library #4510

rumpelsepp opened this issue Sep 2, 2024 · 3 comments · Fixed by #4823

Comments

@rumpelsepp
Copy link
Contributor

The author of ripgrep has started a datetime library called jiff. The author provides a in depth comparison with other datetime libraries here. I figure, jiff might gain popularity quickly and it could be a good improvement for pyo3 to provide an implementation for converting to python datetime objects (as it is available for, e.g., chrono).

@bschoenmaeckers
Copy link
Contributor

bschoenmaeckers commented Sep 2, 2024

Sounds like a great exercise. I maybe take a stab at this next week.

@jessekrubin
Copy link
Contributor

jessekrubin commented Nov 19, 2024

I haven't done the conversions (tho I can add them), BUT I did add jiff struct wrappers to my to my side project recently if you are interested in checking it out https://github.com/jessekrubin/ry/blob/main/crates/ryo3-jiff/src

The project is a set of thin(ish) wrappers around several crates.

UPDATE/EDIT:

In my spare time I was able to make almost all the conversions (same repo) -- the conversions use new-type pattern with super thin wrapper structs around the jiff structs to get around the batman-rule (orphan-rule) so it might be a good base for really PR-ing in the jiff-type conversions.

I have little to no tests for the conversions in rust, all my tests are in python.

@jessekrubin
Copy link
Contributor

I will also add that jiff has been an absolute delight to work with.

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

Successfully merging a pull request may close this issue.

3 participants