Giter Site home page Giter Site logo

Comments (6)

jonnybazookatone avatar jonnybazookatone commented on June 9, 2024 1

Thanks for showing interest. This type of question is more appropriate for the ADS github pages, as this library doesn't support ADS libraries (https://github.com/adsabs).

However, here's a quick answer. As the error message states, there's something wrong with your usage of the API. You can see how to use the API at the dev-api pages: https://github.com/adsabs/adsabs-dev-api/blob/master/libraries.md. What you're trying to do should look something like this (didn't check, but should work after some tweaking):

import requests

library_id = 'library ID'
ads_token = 'my token'

r = requests.post(
    'https://api.adsabs.harvard.edu/v1/biblib/documents/{}'.format(library_id),
    data={
        'bibcode': ['2016yCat..35970030A'],
        'action': 'add'
    },
    headers={'Authorization: Bearer {}'.format(ads_token)}
)

You can find more details at this set of un-merged documentation: https://github.com/adsabs/adsabs.github.io/blob/new-api/content/v1/libraries.md. Or you can look at how the tests used the API: https://github.com/adsabs/biblib-service/blob/master/biblib/tests/

from ads.

jonnybazookatone avatar jonnybazookatone commented on June 9, 2024

Should also add -- is there any need to include this in the API, over say, BigQuery?

from ads.

vsudilov avatar vsudilov commented on June 9, 2024

What is the signature of LibraryQuery()? I guess you could pass it a "query" that corresponds to a specific user? I'd like to question if it makes sense copy the SearchQuery interface for this feature.

Did you have any specific input you needed?

from ads.

jonnybazookatone avatar jonnybazookatone commented on June 9, 2024

At the moment there's no search functionality for libraries on the ADS side. Token -> user's libraries. You can request/access someone else's library if it's public (and you know the ID).

LibrarQuery was just to keep a similar format to the other query classes, but doesn't have to be that way.

Input: would anyone even use this, it's a relatively large addition, which is only worth it if it's useful. I can think of other things like BigQuery that is most likely less work and less complex.

from ads.

vsudilov avatar vsudilov commented on June 9, 2024

Not sure how to gauge interest in libraries-- I'd say go for it if you're keen on adding it personally.

I have noticed the big query use case come up many times though.

from ads.

minzastro avatar minzastro commented on June 9, 2024

I would like to use libraries API. More precisely, I need an option to add papers to the library.
Cannot make it running directly via API somehow - I get
{'error': 'You passed the wrong type. See the API documentation: http://adsabs.github.io/help/api/'}
when I try to post something like
https://api.adsabs.harvard.edu/v1/biblib/documents/...id...?action=add&bibcode=2016yCat..35970030A

from ads.

Related Issues (20)

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.