Giter Club home page Giter Club logo

bibpy's People

Contributors

katrinleinweber avatar misanthropicbit avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bibpy's Issues

Implement codec for LaTeX/unicode

Such a codec would translate LaTeX symbol notation to Python unicode and vice versa. Observe:

>>> from bibpy.codec import decode, encode
>>> decode('Kurt G{\"o}del')
'Kurt Gödel'
>>> encode(_)
'Kurt G{\"o}del'

A unicode to LaTeX mapping exists here.

Keep line number/position information after parsing

The lexers/parsers throw away information about line number positions. This is problematic for tools like bibformat which should maintain the same relative positions of comments and entries in files as those given in the input. This is sensible for comments that are given for a specific entry.

However, it is more complicated than that. What if a comment appears two entries that both change position after being processed by bibformat? We cannot sort by line number as this would undo the reordering. Instead we could store a relative position, e.g. a comment with position 1 should be placed after the first entry has been output. Since we cannot know if a comment belongs to a certain entry, the least we can do is keep its position in the file.

`entry.get` returns wrong default value

Retrieving the value of a missing field with default value fails.

import bibpy

ref = """
@misc{reddit_2022,
title  = {R/reinforcementlearning. Are exploration and credit assignment independent? What's your opinion?},
url    = {https://www.reddit.com/r/reinforcementlearning/comments/vobvly/are_exploration_and_credit_assignment_independent/},
ournal = {reddit},
year   = {2022},
month  = {Jun}
}
"""

references = bibpy.read_string(ref)
for ref in references:
    author = ref.get("author", default="")
    assert author == "", "author is not an empty string, but {}".format(str(author))

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.