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
File details
Details for the file dimcli-1.3.tar.gz
.
File metadata
- Download URL: dimcli-1.3.tar.gz
- Upload date:
- Size: 208.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2933f2a3f31040778d5993956026cffbd25f1e406d885324c1dc5390ad8646bb |
|
MD5 | b4da5ab5b4f4766b30736665b8d8dad4 |
|
BLAKE2b-256 | 61344e6e7f99f29f58ab826cac430a55e692121276f6d1db1a142deb1c474e9d |
File details
Details for the file dimcli-1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: dimcli-1.3-py2.py3-none-any.whl
- Upload date:
- Size: 241.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68ab49e603808625e01be9efc25d56aa7e8b62c8f9eec2f528f63e69ac217623 |
|
MD5 | b4007bb8c40603776c7fff88d45f23e0 |
|
BLAKE2b-256 | 8b140a2102b27b6a5538da20fc65c1f52e7e22d5192cd70bbf60b5f9a6477ae9 |