digital-science / dimcli

Python client and CLI for scientometrics and research analytics using the Dimensions API.

Home Page:https://digital-science.github.io/dimcli/getting-started.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dimcli

Dimcli is a Python client for accessing the Dimensions Analytics API. It makes it easier to authenticate against the API, send queries to it and process the JSON data being returned.

>>> import dimcli

>>> dimcli.login(key="private-key-here",  
                 endpoint="https://app.dimensions.ai/api/dsl/v2")
               
>>> dsl = dimcli.Dsl()

>>> res = dsl.query("""search grants for "malaria" return researchers""")

>>> print(res.json)
{'researchers': [{'id': 'ur.01332073522.49',
   'count': 75,
   'last_name': 'White',
   'first_name': 'Nicholas J'},
  {'id': 'ur.01343654360.43',
   'count': 59,
   'last_name': 'Marsh',
   'first_name': 'Kevin'},
  .............
  ],
 '_stats': {'total_count': 8735}}

CLI

Dimcli includes also a command line interface (CLI) that aims at simplifying the process of learning the grammar of the Dimensions Search Language (DSL).

dimcli_animation

Jupyter

Dimcli plays nice with Jupyter notebooks too. It comes with various magic commands for querying the API, transforming JSON data into dataframes and turning them into interactive tables with hyperlinks - so that data can be inspected further on external websites.

dimcli_animation_jupyter

More info

For more information see the Getting Started with Dimcli tutorial.

Current version: see pypi homepage. Source code hosted on github.

Downloads

Comments, bug reports

Dimcli lives on Github. You can file issues or pull requests there. Suggestions, pull requests and improvements welcome!

About

Python client and CLI for scientometrics and research analytics using the Dimensions API.

https://digital-science.github.io/dimcli/getting-started.html

License:MIT License


Languages

Language:Jupyter Notebook 52.1%Language:Python 26.7%Language:HTML 21.1%Language:Shell 0.2%Language:Makefile 0.0%