Skip to content
klarareder edited this page Dec 19, 2018 · 18 revisions

Welcome to the oeplatform wiki!

This is the place to aderess your questions on how to use the OEP / oedb.


API

  • Q: How do I use the API?
  • A: Follow this instructions in order to setup up an environment to use the API tutorials
  1. Download and install Anaconda with Python 3

  2. Download the file requirement_oep-api.yml from this GitHub

  3. Create a new conda environment using the file conda env create -f requirement_oep-api.yml

  4. Activate the new env activate oep-api

  5. Register to the openmod Wiki and create an openmod profile

  6. Login on OEP and click your user name and receive your token

  7. Download the Jupyter Notebooks

  8. Start a Jupyter Notebook with jupyter notebook

  9. Enjoy the API tutorials


  • Q:
  • A:
  • Source:

  • Q: How do we handle/store the token in a secure way?
  • A: We definitely should not hard code it in our python scripts and push it to GitHub. Concerning the question: since tokens are issued on a per user basis, each user can make his own choice of how to access it from his scripts using the API. When it comes to providing infrastructure on how to store it in code that is intended to use the API, IMHO the choice depends on the package providing the infrastructure. For oemof.db I would put a suggestion in the documentation to put the token, the path to the file containing the token or the service/username pair under which the token is stored in the keyring into the configuration file. For ego.io it looks like going with keyring is a good option if keyring is used by the package anyway. Just one thing: always provide a way to explicitly pass the key to functions using the API. That way the user has the choice of using the default way you want him to use, or he can use the way he prefers, like e.g. just reading it from a text file.
  • Source: https://github.com/openego/oeplatform/issues/240

Clone this wiki locally