Code Monkey home page Code Monkey logo

semanticscholar's Introduction

semanticscholar

Latest version GitHub license

A python library that aims to retrieve data from Semantic Scholar API.

How to install

pip install semanticscholar

Usage

Programmatically access paper and author data. Can be used to access both the public API or the S2 Data Partner's API using a private key.

Paper Lookup (Public API)

To access paper data:

>>> from semanticscholar import SemanticScholar
>>> sch = SemanticScholar(timeout=2)
>>> paper = sch.paper('10.1093/mind/lix.236.433')
>>> paper.keys()
dict_keys(['abstract', 'arxivId', 'authors', 'citationVelocity', 'citations', 'doi',
'influentialCitationCount', 'paperId', 'references', 'title', 'topics', 'url', 'venue', 'year'])
>>> paper['title']
'Computing Machinery and Intelligence'
>>> for author in paper['authors']:
...     print(author['name'])
...     print(author['authorId'])
...
'Alan M. Turing'
2262347

Author Lookup (Public API)

To access author data:

>>> from semanticscholar import SemanticScholar
>>> sch = SemanticScholar(timeout=2)
>>> author = sch.author(2262347)
>>> author.keys()
dict_keys(['aliases', 'authorId', 'citationVelocity', 'influentialCitationCount', 'name', 'papers', 'url'])
>>> author['name']
'Alan M. Turing'
>>> len(author['papers'])
77

Accessing the Data Partner's API

If you are a Semantic Scholar Data Partner you can provide the private key as an optional argument:

>>> from semanticscholar import SemanticScholar
>>> s2_api_key = '40-CharacterPrivateKeyProvidedToPartners'
>>> sch = SemanticScholar(api_key=s2_api_key)

semanticscholar's People

Contributors

danielnsilva avatar dependabot[bot] avatar

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.