devel:brewerjsonpythonmodule
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| devel:brewerjsonpythonmodule [2015/09/21 08:09] – created ajberjon | devel:brewerjsonpythonmodule [2022/10/20 08:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Brewer JSON Python Module ====== | ====== Brewer JSON Python Module ====== | ||
| - | We describe here the functions | + | The Brewer JSON Python Module provides the functions to connect to the RBCC-E database and to download data of the different Brewer equipments. |
| + | |||
| + | We describe here the functions implemented in brewerjson.py module. The last version of the python module is available from [[http:// | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | Brewer JSON library can be imported from python code adding the path to brewerjson.py module to the Python path (list of directories Python goes through to search for modules and files): | ||
| + | |||
| + | import sys | ||
| + | sys.path.append("/ | ||
| + | |||
| + | By default the sys.path variable includes the current directory, so if brewerjson.py is in the same directory as the Python script, the module can be directly imported. | ||
| + | |||
| + | Alternatively, | ||
| + | |||
| + | ^ Platform ^ Standard installation location ^ | ||
| + | ^ Windows | C: | ||
| + | ^ Unix | / | ||
| + | |||
| + | ===== Functions ===== | ||
| + | |||
| + | The functions of this module are: | ||
| + | |||
| + | ^ Field ^ Description ^ | ||
| + | ^ [[devel: | ||
| + | ^ [[devel: | ||
| + | ^ [[devel: | ||
| + | |||
| + | |||
| + | === getDataList() === | ||
| + | |||
| + | This function retrieve a list of [[http:// | ||
| + | |||
| + | The returned dictionaries structures depend on the // | ||
| + | |||
| + | ^ // | ||
| + | ^ ' | ||
| + | ^ ' | ||
| + | ^ ' | ||
| + | |||
| + | **Example** | ||
| + | import brewerjson | ||
| + | import datetime | ||
| + | |||
| + | d1=datetime.date(2014, | ||
| + | d2=datetime.date(2014, | ||
| + | data=brewerjson.getDataList(185,' | ||
| + | |||
| + | |||
| + | === writejson() === | ||
| + | |||
| + | This function save a list of [[http:// | ||
| + | |||
| + | **Example** | ||
| + | import brewerjson | ||
| + | import datetime | ||
| + | |||
| + | d1=datetime.date(2014, | ||
| + | d2=datetime.date(2014, | ||
| + | data=brewerjson.getDataList(185,' | ||
| + | brewerjson.getdata(data,' | ||
| + | |||
| + | This function accepts two input parameters: //' | ||
| + | |||
| + | * //' | ||
| + | * //' | ||
| + | |||
| + | |||
| + | === readjson() === | ||
| + | |||
| + | This function read a file containing a list of [[http:// | ||
| + | |||
| + | **Example** | ||
| + | import brewerjson | ||
| + | import datetime | ||
| + | |||
| + | brewerjson.getdata(' | ||
| + | |||
devel/brewerjsonpythonmodule.1442822995.txt.gz · Last modified: 2015/09/21 08:09 by ajberjon