Giter Site home page Giter Site logo

r-xue / ads2bibdesk Goto Github PK

View Code? Open in Web Editor NEW
41.0 13.0 11.0 268 KB

ads2bibdesk helps you add astrophysics articles listed on NASA/ADS to your BibDesk database using the new ADS Developer API

License: GNU General Public License v3.0

Python 98.17% Shell 1.09% AppleScript 0.74%
bibdesk bibtex latex pyobjc astrophysics macos python

ads2bibdesk's People

Contributors

ebellm avatar morisset avatar r-xue avatar

Stargazers

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

Watchers

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

ads2bibdesk's Issues

AttributeError: 'NoneType' object has no attribute 'deliverNotification_'

When running ads2bibdesk on the key ADS '1976JAtS...33.2049A', I get the following error:

Starting ADS to BibDesk
Traceback (most recent call last):
File "/Users/townsend/.local/lib/python3.7/site-packages/ads2bibdesk/ads2bibdesk.py", line 523, in notify
center.deliverNotification_(notification)
AttributeError: 'NoneType' object has no attribute 'deliverNotification_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/townsend/bin/ads2bibdesk", line 10, in
sys.exit(main())
File "/Users/townsend/.local/lib/python3.7/site-packages/ads2bibdesk/ads2bibdesk.py", line 110, in main
article_status = process_article(args, prefs)
File "/Users/townsend/.local/lib/python3.7/site-packages/ads2bibdesk/ads2bibdesk.py", line 142, in process_article
article_status = process_token(args.article_identifier, prefs, bibdesk)
File "/Users/townsend/.local/lib/python3.7/site-packages/ads2bibdesk/ads2bibdesk.py", line 269, in process_token
bibdesk('cite key', pid).stringValue(), ads_article.title[0], alert_sound=alert_sound)
File "/Users/townsend/.local/lib/python3.7/site-packages/ads2bibdesk/ads2bibdesk.py", line 526, in notify
except ExplicitException:
NameError: name 'ExplicitException' is not defined

Hoping for a quick fix!

Long author list is truncated

ads2bibdesk 2023APh...15002850A

The above command imports the paper information as expected but its author list is truncated and and et al. is added. Changing the ADS code to DOI 10.1016/j.astropartphys.2023.102850 does not help.

the "preprint-update" option

We can restore the "preprint-update" option from the original ads_bibdesk, by scanning/updating BibDesk entries with article_bibcode in the arXiv style (something like 2019arXiv1234.5678).

Won't work with BibDesk v1.7.5

One will get an error message from the AppleScript call of adding new BibTeX entries.

BibDesk got an error: document 1 doesn’t understand the “import” message.

temporary workaround: just don't upgrade to BibDesk v1.7.5 util the change is clarified.

update: reported the bug to the BibDesk developers and it will be fixed in their next release.

App problem finding bibcodes

I am getting the following error message in the log, and nothing happens.

2021-06-17 11:48:14 ads2bibdesk.ads2bibdesk.main [INFO] : Starting ADS to BibDesk
2021-06-17 11:48:25 ads2bibdesk.ads2bibdesk.process_token [INFO] : Found Zero or Multiple ADS antries for [valid API key]
2021-06-17 11:48:25 ads2bibdesk.ads2bibdesk.process_token [INFO] : No update in BibDesk

I just created the .ads directory (so no pre-existing files present) and added my brand new API key from ADS to ads2bibdesk.cfg, but still got this error.

Problems running on Catalina

I recently updated from macOS High Sierra to Catalina. ads2bibdesk was working fine on High Sierra but now gives errors (see below). I'm trying to run this in python 3.7.9 managed with conda. Does this need a different version of ImageMagick? Are there other tricks or suggestions? Thanks.
ads2bibdesk_errors.txt

articles without the PDF gateway links

For some articles, the direct publisher PDF links are not available on ADS (e.g. 2014PhR...541...45C, 2011Natur.470..233C, 2015Sci...348..779H). Therefore, the ArXiv-version PDFs were downloaded, instead of publisher-versions. Some last code changes in the forked ads_bibdesk could be borrowed to help resolve the issue, by guessing the PDF direct link from the HTML link/content.

Workflow not working

Thank you for this nice tool. While the command line works in the terminal, this is not the case for the workflow. As it never worked for me (using the new version since about 1 year or more maybe), I thought some may have the same issue so I decided to post the error. When I click to "add to bibdesk", I have the following error:

L’action « Exécuter un script Shell » a rencontré une erreur : « Starting ADS to BibDesk
Traceback (most recent call last):
File "/Users/agallenn/.local/bin/ads2bibdesk", line 33, in
sys.exit(load_entry_point('ads2bibdesk==0.2.dev3', 'console_scripts', 'ads2bibdesk')())
File "/Users/agallenn/.local/lib/python3.8/site-packages/ads2bibdesk/ads2bibdesk.py", line 111, in main
article_status = process_article(args, prefs)
File "/Users/agallenn/.local/lib/python3.8/site-packages/ads2bibdesk/ads2bibdesk.py", line 141, in process_article
bibdesk = BibDesk()
File "/Users/agallenn/.local/lib/python3.8/site-packages/ads2bibdesk/bibdesk.py", line 19, in init
self.refresh()
File "/Users/agallenn/.local/lib/python3.8/site-packages/ads2bibdesk/bibdesk.py", line 53, in refresh
self.titles = self('return title of publications', strlist=True)
File "/Users/agallenn/.local/lib/python3.8/site-packages/ads2bibdesk/bibdesk.py", line 44, in call
for i in range(output.numberOfItems())]
AttributeError: 'NoneType' object has no attribute 'numberOfItems' »

Note that I always had the same error since I installed your version.

Info system: MacOS 10.15.7, Python 3.8.10, Bibdesk 1.8.3

Found Zero or Multiple ADS antries for ...

I am trying to use ads2bibdesk from the commandline. It worked fine until maybe a week ago when I used it last time. I have not used this for a week and have not updated the OS or python.

Now I get this "zero or multiple entries" error for basically any arXiv number I feed ...

Starting ADS to BibDesk
Found Zero or Multiple ADS antries for 2209.09905

am I the only one seeing this problem?

ads2bibdesk not working after latest bibdesk update 1st April 2020

Dear r-xue,

I am a big fan of this code and use it all the time. However, yesterday I updated bibdesk and it appeared to stop working. The error message was as follows:

Starting ADS to BibDesk
Traceback (most recent call last):
File "/Users/hamish/.local/bin/ads2bibdesk", line 10, in
sys.exit(main())
File "/Users/hamish/.local/lib/python3.7/site-packages/ads2bibdesk.py", line 90, in main
article_status=process_article(args ,prefs)
File "/Users/hamish/.local/lib/python3.7/site-packages/ads2bibdesk.py", line 99, in process_article
article_status=process_token(args.article_identifier, prefs, bibdesk)
File "/Users/hamish/.local/lib/python3.7/site-packages/ads2bibdesk.py", line 234, in process_token
pub = pub.descriptorAtIndex_(1).descriptorAtIndex_(3).stringValue()
AttributeError: 'NoneType' object has no attribute 'descriptorAtIndex_'

Can you please help

EDIT: I just saw your post about not updating to 1.7.5. I have gone back to 1.7.4. Thanks again for all your effort with this program!

Suggestion - Rename PDF files by first author and year

Dear r-xue,

This is an enhancement suggestion.

Is it possible for ads2bibdesk to name the downloaded PDFs using the first author name and the date. So your paper this year might be named Xue2020.pdf. And your second paper this year could be Xue2020b.pdf (etc etc).

Currently the papers that ads2bibdesk downloads for me have names like tmpav9l1brw.pdf

Kind regards

arXiv PDF is downloaded instead of published PDF

ads2bibdesk 10.3847/2041-8213/acdac6

downloads the paper PDF from arXiv instead of retrieving the final published PDF from ApJL.

Similar papers are downloaded as expected.

ads2bibdesk 10.3847/2041-8213/acda88
ads2bibdesk 10.3847/2041-8213/acda9a

Please introduce the configuration file ads2bibdesk.cfg in the README (or did I miss it?)

For a long time I have been trying to find a way to disable downloading PDF automatically but failed. After digging into the code I realized there is a configuration file ~/.ads/ads2bibdesk.cfg in which you can set download_pdf=False. I know you have

The API key can be written into your ads2bibdesk preference file ~/.ads/ads2bibdesk.cfg (see the template)

in your README, but without a care read of the template, I didn't know there is a configuration file at all. I would be helpful to the readers if you could mention there is a configuration file where you can configure download_pdf, ssh_user, etc.

--install-option was deprecated in pip v22.3 and has been removed completely in v23.1.

When I tried to run pip install --user -U --no-deps --force-reinstall --install-option="--service" ads2bibdesk under Mac OS 14 with pip 23.1.2, I got an error no such option: --install-option

So following this discussion:

--install-option was deprecated in pip v22.3 and has been removed completely in v23.1.

I ran python -m pip install pip==22.2.1 and I was able to build the service.

Hopefully this is helpful and looking forward to an update addressing this issue.

Big Sur

Hi, after updating to Big Sur I can't make it to work. I get the error message below. Any advice appreciated.
Thanks,
Dimitris

Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/ads2bibdesk", line 33, in
sys.exit(load_entry_point('ads2bibdesk==0.2.dev3', 'console_scripts', 'ads2bibdesk')())
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/ads2bibdesk", line 25, in importlib_load_entry_point
return next(matches).load()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ads2bibdesk/ads2bibdesk.py", line 22, in
from .bibdesk import BibDesk
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/ads2bibdesk/bibdesk.py", line 5, in
import AppKit # from pyobjc-framework-Cocoa
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/AppKit/init.py", line 10, in
import Foundation
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Foundation/init.py", line 9, in
import CoreFoundation
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/CoreFoundation/init.py", line 9, in
import objc
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/init.py", line 6, in
from . import _objc
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so, 2): Symbol not found: _ffi_find_closure_for_code_np
Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so
Expected in: flat namespace
in /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so

notifications break

Hi,

I'm running python 3.6, on 10.12. The code works well so far, with one exception - notify module results in error.

objc.lookUpClass('NSUserNotificationCenter').\

AttributeError: 'NoneType' object has no attribute 'scheduleNotification_'

During handling of the above exception, another exception occurred:

growl_notify(title, desc, sticky)

NameError: name 'growl_notify' is not defined

Commenting out the last line has fixed it, resulting in a successful download.

Import fails with empty abstract

If there is no abstract the import will fail with

AttributeError: 'NoneType' object has no attribute 'replace'
> /Users/ebellm/Eric/Archive/Projects/ads2bibdesk/ads2bibdesk.py(240)process_token()
    238
    239     # abstract
--> 240     ads_abstract_clean=ads_article.abstract.replace('\\', r'\\').replace('"', r'\"').replace('}', ' ').replace('{', ' ')
    241     bibdesk(f'set abstract to "{ads_abstract_clean}"', pub)
    242

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.