Python REPL/API for accessing dimensions.ai.
Project description
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).
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.
More info
For more information see the Getting Started with Dimcli tutorial.
Current version: see pypi homepage. Source code hosted on github.
Comments, bug reports
Dimcli lives on Github. You can file issues or pull requests there. Suggestions, pull requests and improvements welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dimcli-1.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 844a34144b16d590f061d0ba841e75eecd43eaaee7e85adb32a4cc4014d30015 |
|
MD5 | 41101e2ec62c65adce01af8e7951b507 |
|
BLAKE2b-256 | 077139fad7b594542d9d86855af46253b3de9dd228083290208afe955c9c6e82 |