Coder Social home page Coder Social logo

bmc's People

Contributors

a3nm avatar bcbnz avatar drvinceknight avatar kanzure avatar phyks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bmc's Issues

Discussion: what should be the `delete` behavior?

  • For a file in Papers
    • Remove the citation from index.bib and unlink the file (currently used, most logical);
    • Remove the citation, do not unlink the file (not logical at all).
  • For a file imported in-place:
    • Remove from index, unlink (current behavior, somewhat objectionable)
    • Remove from index, leave in-place (not implemented).

The user should be forewarned that some operations are a) irreversible and/or b) not idempotent, IMHO. An alternative - give the delete command an -m/manual switch to signify no unlinking is to take place. Another, perhaps more usable alternative, do not unlink by default.

Release

Hi,

Is it possible to have a release? I would like to prepare a package for archlinux. I think having identified versions make things easier to follow from the user point of view (in terms of evolution, regressions, bugs, features...)

Manual entry not working?

Hi I'm just getting started with BMC. I get an error when pointing it at an old pdf for which I can't seem to find the DOI so hoping to use manual:

~$ python BMC/bmc.py import ~/Desktop/yadin_1965.pdf
DOI / arXiv / ISBN / manual / skip? manual
The bibtex entry found for /Users/vince/Desktop/yadin_1965.pdf is:
Traceback (most recent call last):
  File "BMC/bmc.py", line 550, in <module>
    args.tag)
  File "BMC/bmc.py", line 188, in addFile
    bibtex = checkBibtex(src, bibtex_string)
  File "BMC/bmc.py", line 30, in checkBibtex
     bibtex = bibtex[list(bibtex.keys())[0]]
IndexError: list index out of range

Have I got the use case wrong for manual or is it not implemented yet?

Move to python3

All the dependencies should be ok with python3, except the socks module. I'll have to look for something, but the rest should not be much work to be py3 compatible.

Watermarks

Hi,

Just for your information, about the last bullet point of your goal list, you can have a look to this simple script: https://github.com/sciunto/tear-pages

PS: I think we have similar needs in bibliography management :)

bmc.py KeyError

'bmc.py download http://arxiv.org/pdf/1412.3638v2'

'''
Downloading http://arxiv.org/pdf/1412.3638v2
[==================================================] 96%Download finished
ArXiv id for /tmp/tmpbwpxkzwh.pdf is 1412.3638v2.
Traceback (most recent call last):
File "/usr/bin/bmc.py", line 568, in
args.tag)
File "/usr/bin/bmc.py", line 300, in downloadFile
new_name = addFile(tmp.name, filetype, manual, autoconfirm, tag)
File "/usr/bin/bmc.py", line 173, in addFile
bibtex = fetcher.arXiv2Bib(arxiv).strip().replace(',', ",\n")+"\n"
File "/usr/lib/python3.5/site-packages/libbmc/fetcher.py", line 323, in arXiv2Bib
return tools.parsed2Bibtex(fetched_bibtex)
File "/usr/lib/python3.5/site-packages/libbmc/tools.py", line 49, in parsed2Bibtex
bibtex = '@'+parsed['type']+'{'+parsed['id']+",\n"
KeyError: 'type'
'''

virtuanenv - module not found

I'm trying to install BMC on my arch linux box inside of a python3 virtual environment.

$ python -m venv biblio
$ source biblio/bin/activate
(biblio)$ pip install arxiv2bib PySocks bibtexparser pyPDF2 isbnlib
(biblio)$ git clone https://github.com/Phyks/BMC
(biblio)$ ./BMC/bmc.py
Traceback (most recent call last):
  File "./bmc.py", line 11, in <module>
    from bibtexparser.bparser import BibTexParser
ImportError: No module named bibtexparser.bparser

however, import bibtexparser from a python3 console inside the virtualenv seems to work.

Any idea whats going on?

Feature request: ability to work with preprints/technical reports

@TechReport{Doe2015,
  author =   {John A. Doe},
  title =    {How to frobnify efficiently: lessons from the 10th International Frobnification Experiment},
  institution =  {Scripps Institution of Oceanography},
  year =     {2015},
  type =     {Working Paper},
  number =   {135/16},
  address =      {La Jolla, Calif.},
  month =    {December},
}

If I manually add the BibTeX record now, BMC won't recognize the record type.

typeError after download with python3

[==================================================] 96%Download finished
Traceback (most recent call last):
  File "/home/berceanu/tmp/biblio/bin/bmc.py", line 532, in <module>
    args.tag)
  File "/home/berceanu/tmp/biblio/bin/bmc.py", line 292, in downloadFile
    fh.write(dl)
  File "/usr/lib/python3.4/codecs.py", line 711, in write
    return self.writer.write(data)
  File "/usr/lib/python3.4/codecs.py", line 368, in write
    data, consumed = self.encode(object, self.errors)
TypeError: Can't convert 'bytes' object to str implicitly

import from zotero

could you add import capability to BMC, allowing one to migrate a zotero library for instance?

Refactor config file

Hi,

I think using a python file for parameters is not the best choice.
A config file (json, yaml...) located in ~/.config would be much better.

Missing files in test/

Hi

In your directory test, you call many missing files. See below :)


======================================================================

ERROR: test_arXiv2Bib (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_arXiv2Bib_False (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_doi2Bib (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_doi2Bib_False (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_download (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_download_invalid_type (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_download_invalid_url (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findArXivId (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findDOI_DJVU (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findDOI_False (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findDOI_PDF (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findHALId (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findISBN_DJVU (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findISBN_False (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_findISBN_PDF (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_isbn2Bib (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

======================================================================

ERROR: test_isbn2Bib_False (test_fetcher.TestFetcher)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/build/sciunto/BMC/tests/test_fetcher.py", line 18, in setUp

with open("tests/src/doi.bib", 'r') as fh:

IOError: [Errno 2] No such file or directory: 'tests/src/doi.bib'

Refactor

I am again using this software heavily recently, and have been working on a better associated library, which is now available from here.

Hence, there will be a refactor to use this library rather than duplicating it in the source code.

I also plan on making BMC behave a bit as Git, with a repo and to work in this repo, allowing more easily to keep papers in different places.

Feel free to give feedbacks about issues with the current design, arguments against new design etc here.

Im getting some error.

I have installed BMC but cannot get it working.
This is the usual error:


bmc.py import vlada.pdf
DOI for vlada.pdf is 10.1002/wrna.1254.
Traceback (most recent call last):
File "/usr/local/bin/bmc.py", line 584, in
args.tag, not args.inplace)
File "/usr/local/bin/bmc.py", line 185, in addFile
bibtex_string = tools.parsed2Bibtex(bibtex)
File "/usr/local/lib/python2.7/dist-packages/libbmc/tools.py", line 49, in parsed2Bibtex
bibtex = '@'+parsed['type']+'{'+parsed['id']+",\n"
KeyError: u'type'


I have bibtexparser 0.6.1 installed. Can it be the problem?
Thanks.
Petro

failed to download pdf from rev. mod. phys

Error while downloading the following paper
http://journals.aps.org/rmp/pdf/10.1103/RevModPhys.85.299

Traceback (most recent call last):
  File "/home/berceanu/tmp/biblio/bin/bmc.py", line 532, in <module>
    args.tag)
  File "/home/berceanu/tmp/biblio/bin/bmc.py", line 285, in downloadFile
    dl, contenttype = fetcher.download(url)
  File "/home/berceanu/tmp/biblio/lib/python3.4/site-packages/libbmc/fetcher.py", line 71, in download
    r = urlopen(url)
  File "/usr/lib/python3.4/urllib/request.py", line 153, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.4/urllib/request.py", line 455, in open
    response = self._open(req, data)
  File "/usr/lib/python3.4/urllib/request.py", line 473, in _open
    '_open', req)
  File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 1202, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.4/urllib/request.py", line 1177, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.4/socket.py", line 371, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

Unable to open index file

from a fresh today install I get

$ bmc.py list 
WARNING:  Unable to open index file.
$ 

idem for resync::

$ bmc.py resync
Resync files and bibtex index? [y/N] y
WARNING:  Unable to open index file.
$ 

New version?

Hi,

Do you plan to release a new version? 0.2 does not include the setup.py and many other improvements. :)

Thanks!

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.