Giter VIP home page Giter VIP logo

stephen-zhao / datetime_matcher Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 78 KB

A python module that extends regex to allow matching, extracting, and reformatting datetimes using familiar datetime format codes.

Home Page: https://pypi.org/project/datetime-matcher/

License: MIT License

Python 78.77% Makefile 21.23%
python datetime regex datetime-format datetime-parsing python-package regular-expression find-and-replace substitution strftime-codes

datetime_matcher's Introduction

Hi there ๐Ÿ‘‹

I'm a senior software engineer. I like math, skiing, and tanks.

What I use on a daily basis

Trino Apache Solr dotnet Typescript Python Docker Apache Kafka Microsoft SQL Server

Homelab

Proxmox Active Directory Portainer Nginx Proxy Manager Jellyfin

datetime_matcher's People

Contributors

stephen-zhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jedzill4

datetime_matcher's Issues

Non-zero padding formats

Hi and thank you for the nice work!
I'm having an issue with non-zero padding datetime extraction, for example matching a 1/11/2017 string with format %-d/%m/%Y. The RegexGenerator class match correctly the pattern, but the DatetimeExtractor cannot extract the pattern as datetime object.

My problem is in the __parse_match_into_maybe_datetime function, in the strptime conversion. I'm using python 3.10 on linux and strptime doesn't accept the %-d directive, but can handle correctly the %d even when there is no zero padding.
From what I have read may be a platform issue and work without problems on other python implementation (anaconda maybe?). The workaround that I found is to replace all %- to their standard version (e.i. %-d to %d)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.