digital-science / dimcli

Python client and CLI for scientometrics and research analytics using the Dimensions API.
https://digital-science.github.io/dimcli/getting-started.html
MIT License
43 stars 6 forks source link

Wrap DSL functions into Python functions #63

Closed lambdamusic closed 3 years ago

lambdamusic commented 4 years ago

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

johnichiban commented 4 years ago

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.
lambdamusic commented 3 years ago

Soon to be released with v 0.8