Git Product home page Git Product logo

pybib's Introduction

pybib PyPI version

pybib is an easy way to get citations for your LaTeX document. Instead of typing out BibTeX entries yourself, just give pybib the Digital Object Identifier (DOI) of the resource you want to cite and it will get all the information for you. Then, you can just add the citation it gives you to your BibTeX file.

Installation

The package is available on PyPi and can be installed with the following command:

$ pip3 install --user pybib

For user-only installs, pip installs scripts to the directory ~/.local/bin, so make sure it’s in your path. If you would prefer to install it system-wide, just leave out the --user flag.

Usage examples

Get a citation:

$ bib get 10.1112/plms/s2-42.1.230

Get a citation and add it to your bibliography file:

$ bib get 10.1145/159544.159617 >> citations.bib

Get a citation and add it to your bibliography file, running it through bibtool first to format the entry and auto-generate a citation key:

$ bib get 10.1145/159544.159617 | bibtool >> citations.bib

Searching

Search for a resource:

$ bib search name of the resource

Get the citation for search result number N:

$ bib search name of the resource --get N

Troubleshooting

If you encounter any problems, please open an issue so I can rectify them as soon as possible.

pybib's People

Contributors

jgilchrist avatar dependabot-preview[bot] avatar dependabot[bot] avatar ap-- avatar

Stargazers

Hailin Wang avatar Rijnder Wever avatar  avatar Frédéric Branchaud-Charron avatar Luiz Felix avatar John Pisokas avatar Guido Arnau avatar R. Sommariva avatar Luis avatar Martín Varela avatar Calin R Turliuc avatar Jakob Meldgaard Kjær avatar  avatar Christoph avatar Ellis Michael avatar Niru Maheswaranathan avatar  avatar Aslak Raanes avatar Guinslym avatar Louis Maddox avatar Thomas Antony avatar Trevor Bekolay avatar Xavier Garrido avatar Mikel Iturbe Urretxa avatar Cory Knapp avatar Christopher Wetherill avatar

Watchers

 avatar Marcus avatar  avatar

Forkers

lmmx ap--

pybib's Issues

Won't pip install

Hey man! 😃 Cool package, but sorry to say when I tried to install it I got

error: file '/tmp/pip_build_louis/pybib/bin/pybib' does not exist`.

After I renamed bin/bib to bin/pybib and reverted the last commit to give it the file it seemed to want it didn't error out, but doesn't seem to be set up properly.

I can import pybib inside Python just fine, but I don't get a shell command bib (or pybib FWIW).

~ $ pip3 install --user pybib
Downloading/unpacking pybib
  Downloading pybib-1.2.tar.gz
  Running setup.py (path:/tmp/pip_build_louis/pybib/setup.py) egg_info for package pybib

Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3/dist-packages (from pybib)
Installing collected packages: pybib
  Running setup.py install for pybib
    error: file '/tmp/pip_build_louis/pybib/bin/pybib' does not exist
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_louis/pybib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-e4yjck6f-record/install-record.txt --single-version-externally-managed --compile --user:
    running install

running build

running build_py

creating build

creating build/lib

creating build/lib/pybib

copying pybib/drivers.py -> build/lib/pybib

copying pybib/pybib.py -> build/lib/pybib

copying pybib/__init__.py -> build/lib/pybib

running build_scripts

creating build/scripts-3.4

copying and adjusting bin/bib -> build/scripts-3.4

error: file '/tmp/pip_build_louis/pybib/bin/pybib' does not exist

----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_louis/pybib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-e4yjck6f-record/install-record.txt --single-version-externally-managed --compile --user failed with error code 1 in /tmp/pip_build_louis/pybib
Storing debug log for failure in /home/louis/.pip/pip.log

(After forking and renaming things)

 ~ $ pip3 install --user git+https://github.com/lmmx/pybib.git
Downloading/unpacking git+https://github.com/lmmx/pybib.git
  Cloning https://github.com/lmmx/pybib.git to /tmp/pip-4qk7xucp-build
  Running setup.py (path:/tmp/pip-4qk7xucp-build/setup.py) egg_info for package from git+https://github.com/lmmx/pybib.git

Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3/dist-packages (from pybib==1.2)
Installing collected packages: pybib
  Running setup.py install for pybib
    changing mode of build/scripts-3.4/pybib from 644 to 755

    changing mode of /home/louis/.local/bin/pybib to 755
Successfully installed pybib
Cleaning up...
~ $ bib myfile.ext
No command 'bib' found, did you mean:
. . . . . .
bib: command not found

UnicodeEncodeError with french é on names

With the 2.2.1 version

(lab)luis@spinoza:/tmp$ bib --version
2.2.1

A search on this:

(lab)luis@spinoza:/tmp$ bib search From Local Patterns to Global Models: The LeGo Approach to Data Mining
0. From Local Patterns to Global Models: Towards Domain Driven Educational Process Mining
    N. Trcka, M. Pechenizkiy (2009) [Proceedings Article], 
    10.1109/isda.2009.159
1. From Local Patterns to Classification Models
    B. Bringmann, S. Nijssen, A. Zimmermann (2010) [Book Chapter], 
    10.1007/978-1-4419-7738-0_6
Traceback (most recent call last):
  File "/home/luis/lab/bin/bib", line 11, in <module>
    sys.exit(main())
  File "/home/luis/lab/local/lib/python2.7/site-packages/pybib/main.py", line 55, in main
    args.cmd(args)
  File "/home/luis/lab/local/lib/python2.7/site-packages/pybib/main.py", line 22, in search_cmd
    formatted_result = pybib.format_entry(result)
  File "/home/luis/lab/local/lib/python2.7/site-packages/pybib/formatters.py", line 161, in format_entry
    return template.format(parts=parts)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 14: ordinal not in range(128)
(lab)luis@spinoza:/tmp$

Invalid DOI error

I tried to run pybib with your examples. It works fine from the command line. But when I put them in a file 'foo.doi' and do $ bib -f foo.doi I get error messages like: 'Line 1: Invalid DOI 10.1145/2043164.2018477'. This is, of course, a valid DOI. I'm using the latest version installed with Pip3 on Yosemite.

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.