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

Allow to save/load query results

lambdamusic opened this issue · comments

res = dsl.query(q)

# save

import pickle
with open('filename.pickle', 'wb') as handle:
    pickle.dump(res, handle)

# => can be packed into res.save(filename) 

Then loading

# full syntax
with open('filename.pickle', 'rb') as handle:
    b = pickle.load(handle)

# => can be packed into 

dsl.load(b) # => returns a dimcli.core.api.Result() object preloaded with data