Skip to main content

A package to communicate with MIA API

Project description

mia_api

QuickStart

  • If necessary you need insert PYTHONPATH variable in your bashrc
export PYTHONPATH='/home/user/scripts/mia_api:$PYTHONPATH'

First Login

  • Create the file .mia_api in your home directory with your credentials sent to you by a mia_api admin
username: MIA_API_USERNAME
password: MIA_API_PASSWORD
  • Alternatively you can set MIA_API_USERNAME and MIA_API_PASSWORD as environment variables

Using the API

  1. Import the package
import mia_api
  1. Connect
mia_api.connect()

by default, the API stayed connected during 30 min.

  1. knowing all the bar availables
mybar=mia_api.JuiceBar('test') 
JuiceBar.available_bars()
  1. Get bar
mybar=mia_api.JuiceBar('MIABAR_stable_v1.2_tom3')
  1. knowing all juice availables
mybar.show_menu()
  1. Get juice
myjuice=mybar.get_juice('ons_VazaoNat_usinas')
  1. Select if you want a historical or operational juice
myjuice.historical() --> returns data xarray if dataset=True returns dataset

from datetime import datetime
myjuice.operational(rundate=datetime(2022,6,22,0,0,0))
myjuice.operational(rundate=[datetime(2022,6,1,0,0,0), datetime(2022,6,22,0,0,0)])
myjuice.operational()

Function

Soon there will by examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mia_api-0.0.4.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mia_api-0.0.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file mia_api-0.0.4.tar.gz.

File metadata

  • Download URL: mia_api-0.0.4.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for mia_api-0.0.4.tar.gz
Algorithm Hash digest
SHA256 046c08ea960b266e02b18f25bf7aea94f4fad6cc35a8eeb39e97325725ce8df3
MD5 d7e341be2019df9ea9cdd92248930796
BLAKE2b-256 e6bf5f75970e46e4891d20742907f5306545d4a2cffedb8f76318cc00e84819e

See more details on using hashes here.

File details

Details for the file mia_api-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mia_api-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for mia_api-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c4a538ec4322a5241f670fbe9978659d7fa1a6566d00d275b4da75b711917813
MD5 23aee7b618508e5c8ea8262dc9ad4dd4
BLAKE2b-256 820896af311604c15b2e1671ef29c1c4df701cc3915971ea70664c6149528565

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page