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 support for Proleptic Julian calendar #54

Open
mmejai opened this issue Jan 18, 2023 · 2 comments
Open

Add support for Proleptic Julian calendar #54

mmejai opened this issue Jan 18, 2023 · 2 comments

Comments

@mmejai
Copy link

mmejai commented Jan 18, 2023

When fetching date of birth (P569) of Pythagoras (Item: Q10261) I got a DatavalueError... unsupported calendarmodel for time datavalue. Can you add/adjust the calender model to support for date of birth BCE. Many thanks.

@dahlia
Copy link
Owner

dahlia commented Jan 29, 2023

As of now Pythagoras (Q10261)'s DOB (P569) on Wikidata has the below value:

{
  "type": "time",
  "value": {
    "time": "-0582-00-00T00:00:00Z",
    "timezone": 0,
    "before": 0,
    "after": 0,
    "precision": 7,
    "calendarmodel": "http://www.wikidata.org/entity/Q1985786"
  }
}

And the calendar model it refers to (Q1985786) apparently not just BCE, but Proleptic Julian calendar. It means we need to handle leap years in a different way to how Python's datetime (which assumes the current Gregorian calendar always was according to the docs) deal with them.

What I mean is not I won't implement this calendar model, but just it would take a long time. However, if somebody sends a patch to implement this I'm going to happily review it!

@dahlia dahlia changed the title Add support for date BCE Add support for Proleptic Julian calendar Jan 29, 2023
@DavidDoukhan
Copy link
Contributor

DavidDoukhan commented Jul 5, 2024

Hi, first of all I would like to thank @dahlia for providing this useful package.

I had a problem similar than @mmejai with entity: https://www.wikidata.org/wiki/Q675908

A workaround may be to automatically convert julian dates to gregorian dates with package https://pypi.org/project/juliandate .
Another option would be to add date decoding options in the package to keep the whole available information : time precision, calendar model, full date string...

I may propose to contribute to this work but I would prefer having maintainer's stance on the way to manage these heterogenous formats before trying to implement something...

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