Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
strptime
In the pursuit of a faster strptime
implementation, two backing Rust crates were chosen due to their popularity in the ecosystem – chrono
and time
.
Both impementations are exposed under the following methods:
fastdatetime.strptime
(based on time along with time-fmt)fastdatetime.chrono.strptime
(based on chrono)Initially, chrono
seemed liked a drop-in replacement, however due to subtle differences of %f
specifier the format argument needs to preprocessed to conform to the Python referece which incurs slight performance overhead as the format string needs to be scanned.
Furthermore, even without this shortcoming, the parsing was slower compared to time
.
What's also interesting is that time
doesn't support strptime
compatible inferface out of the box – fortunatelly time-fmt does (in addition, some fixes and new functionality was upstreamed to the crate).
parse
Oftentimes the date format is not known ahead of time, or it is not possible to infer it from a few samples. In Python, one would usually opt for using the dateutil
package, which can deal with all sorts of edge cases and is very forgiving, however these guarantees come at a cost – in order for the results to not be ambiguous but accurate, the user can tweak a lot of options (is the day or year first, ...) and has to sacrifice performance.
Enter dtparse
by Bradlee Speice, a rewrite of dateutil.parse
in Rust. Going full circle, fastdatetime
just exposes Python bindings to Bradlee's excellent crate. This yields ~15x faster parsing performance (657 vs 42 Kops/sec on M1 Pro).
TBD
TBD
chrono as an alternative implementation parse strptime
formats (specifiers reference)
pyo3 for Python bindings
maturin for building Python wheels
© 2022 Contributors of Project fastdatetime.
This project is licensed under either of
at your option.
The SPDX license identifier for this project is MIT OR Apache-2.0
.
FAQs
Like datetime, but fast
We found that fastdatetime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.