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 Biber date format #32

Closed
wants to merge 3 commits into from

Conversation

laurentperrinet
Copy link

The previous code was generating invalid dates such as 2018-01-01-01.

The previous code was generating invalid dates such as 2018-01-01-01.
@gcushen
Copy link
Collaborator

gcushen commented Mar 17, 2019

Please describe the problem which you are trying to solve along with an example BibTeX excerpt.

@laurentperrinet
Copy link
Author

Description of the problem:

The biblatex has extended support for producing datestamps, as outputed for instance by a bibliography manager like zotero.

This could be a problem in this script as it assumes the standard bibtex format.

Description of the changes:

In the more general case, if a date entry was present in the input bibtex which also contained the month (like "2017-08") or the day (as in ("2019-03-14"), the date field is used in preference.

example BibTeX excerpt

for instance,

@article{BoutinFranciosiniRuffierPerrinet19,
 author = {Boutin, Victor and Franciosini, Angelo and Ruffier, Franck and Perrinet, Laurent U},
 date = {2019-02-20},
 date-modified = {2019-02-25 23:21:37 +0100},
 journal = {submitted to Neural Networks},
 keywords = {sparse coding},
 preprint = {https://arxiv.org/abs/1902.07651},
 title = {Meaningful representations emerge from Sparse Deep Predictive Coding},
 url = {https://arxiv.org/abs/1902.07651},
 year = {2019}
}

transforms into:

+++
title = "Meaningful representations emerge from Sparse Deep Predictive Coding"
date = 2019-02-20
authors = [ "Victor Boutin", "Angelo Franciosini", "Franck Ruffier", "Laurent U Perrinet",]
publication_types = [ "2",]
featured = false
publication = "*submitted to Neural Networks*"
url_pdf = "https://arxiv.org/abs/1902.07651"
tags = [ "sparse coding",]
+++

@gcushen
Copy link
Collaborator

gcushen commented Jun 18, 2019

So you are suggesting to increase the scope of the tool from just the BibTeX format to consider both the BibTeX and Biber formats?

P.S. I found a nice comparison at https://tex.stackexchange.com/a/25702

@laurentperrinet
Copy link
Author

Exactly. The advantage I see in using biblatex are mainly the unicode encoding (for instance for authors) and the format of the date which follows iso 8601.

Maybe the tool could parse a new boolean variable to switch behavior from the old to the new scheme?

@gcushen gcushen changed the title Fix how to handle the date when full data is missing Add support for Biber date format Jun 25, 2019
@gcushen
Copy link
Collaborator

gcushen commented Jun 25, 2019

This project uses https://bibtexparser.readthedocs.io/en/master/ to parse references. I can't immediately see that it officially supports the Biber format?

@laurentperrinet
Copy link
Author

Indeed, I see no trace of the biblatex format used by biber - it could have been useful to be able to support it fully. The proposed solution in this PR was more to propose to support the timestamp from biblatex without breaking compatibility with the classical bibtex format.

@gcushen gcushen added the enhancement New feature or request label Jun 25, 2019
@laurentperrinet
Copy link
Author

Do you want me to add a warning about the fact that the library does not aim to fully support ```biblatex`` but that this serves as a working solution?

@cgxeiji
Copy link

cgxeiji commented Sep 10, 2019

I would like this feature, as all my references are in biblatex format.

@laurentperrinet
Copy link
Author

for the moment, it does not provide with a fully compliance with biblatex, but at least it provides with a fix to not mess with the date ...

@cgxeiji
Copy link

cgxeiji commented Sep 10, 2019

for the moment, it does not provide with a fully compliance with biblatex, but at least it provides with a fix to not mess with the date ...

Well, at least it will let me automate the process, because, right now, my references fail to load as I don't have a year entry, but date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants