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 FileIO interface for .bib files #47

Merged
merged 1 commit into from
Sep 7, 2022
Merged

Add FileIO interface for .bib files #47

merged 1 commit into from
Sep 7, 2022

Conversation

drelatgithub
Copy link
Contributor

@drelatgithub drelatgithub commented Sep 2, 2022

Thank you for making this library!

Currently, importing from bib files or strings uses the same interface import_bibtex, but it is having an issue for me: For longer strings, isfile function fails due to ENAMETOOLONG error. While this issue can be resolved easily with ad-hoc solutions, I am thinking that maybe utilizing https://github.com/JuliaIO/FileIO.jl package could make a unified IO interface.

This PR is an attempt to implement interfaces required by FileIO for .bib files. If you think this is good, after it's merged, I will create a PR on the FileIO side to register this package for .bib files. I think it also serves as a good template to implement IO interfaces for other bibliography formats as well, such as .cff.

I added some tests to show that the functions actually work okay. The only issue is that I tried to validate bib contents by comparing the bib entries for equality, but even two consecutive reads of the same file do not produce entries that compare equal. However, I think this is a different issue and might better be discussed in BibInternal.jl.

@Azzaare
Copy link
Member

Azzaare commented Sep 3, 2022

That's a very nice idea and contribution. Also, sorry for the isfile problem, I did not even think about that issue!

I'm okay with merging (once the tests pass) on principle, but I will wait to have access to a computer (today or tomorrow).

We can probably register other bibliography formats later.

Thank you again for the PR

Edit: as for the output format, I don't remember clearly how I handled it in BibInternal, but it might be something as stupid as an unordered dict (default).
Do not hesitate to open an issue here or there so that I don't forget about it ...

@Azzaare Azzaare merged commit 8afd612 into Humans-of-Julia:master Sep 7, 2022
@Azzaare
Copy link
Member

Azzaare commented Sep 7, 2022

PR merged, and new version tagged soon JuliaRegistries/General#67813

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

Successfully merging this pull request may close these issues.

2 participants