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

Wrap DSL functions into Python functions

lambdamusic opened this issue · comments

EG

results_df = extract_affiliations(name=df['name'], output='dataframe')

basically making python functions for each of the API 'functions' that take the same arguments at the API functions and just passing through the request. then adding a few keyword arguments to the python function for specifying things like output formatting, etc

https://docs.dimensions.ai/dsl/functions.html

Some thoughts...

  1. Output options would ideally include something like 'raw' and 'dataframe'.
  2. For functions that can return more than one result, include option to return only the single 'best' result.
  3. If returning a 'dataframe' for a function that returns multiple results, return multiple rows per input with a key of some sort back to the original input. (maybe a numerical key corresponding to row number of input)
  4. All functions can take batch input. if the corresponding API functions support batch operations, chunk the input and process in batches. otherwise just process through the inputs one at a time and return all results as a list of raw results or dataframe of all results.

Soon to be released with v 0.8