Commit fd74853b authored by mouadh's avatar mouadh

config file docs

parent 96d344b0
...@@ -46,6 +46,24 @@ to import the package use:: ...@@ -46,6 +46,24 @@ to import the package use::
update_columns_to_keep, update_columns_to_keep,
execute_mdx execute_mdx
Package ``olapy.core.mdx.tools``
--------------------------------
to import the package use::
import olapy.core.mdx.tools.config_file_parser
.. automodule:: olapy.core.mdx.tools.config_file_parser
.. autoclass:: ConfigParser
:members:
config_file_exist,
xmla_authentication,
get_cubes_names,
construct_cubes
Package ``olapy.core.services.xmla`` Package ``olapy.core.services.xmla``
------------------------------------ ------------------------------------
......
...@@ -10,6 +10,105 @@ from .models import Cube, Dimension, Facts ...@@ -10,6 +10,105 @@ from .models import Cube, Dimension, Facts
class ConfigParser: class ConfigParser:
""" """
Parse olapy config files Parse olapy config files
Config file used if you want to show only some measures, dimensions, columns... in excel
Config file should be under 'home-directory/olapy-data/cubes/cubes-config.xml'
Config file Structure::
<?xml version="1.0" encoding="UTF-8"?>
<cubes>
<!-- if you want to set an authentication mechanism in excel so to access cube,
user must set a token with login url like 'http://127.0.0.1/admin -->
<xmla_authentication>False</xmla_authentication>
<cube>
<!-- cube name => db name -->
<name>labster</name>
<!-- source : postgres | csv -->
<source>postgres</source>
<!-- star building customized star schema -->
<facts>
<!-- facts table name -->
<table_name>stats_line</table_name>
<keys>
<!-- ref = table_name.column -->
<column_name ref="orgunit.id">departement_id</column_name>
</keys>
<!-- specify measures explicitly -->
<measures>
<!-- by default, all number type columns in facts table, or you can specify them here -->
<name>montant</name>
<name>salaire_brut_mensuel</name>
<name>cout_total_mensuel</name>
</measures>
</facts>
<!-- end building customized star schema -->
<!-- star building customized dimensions display in excel from the star schema -->
<dimensions>
<dimension>
<!-- if you want to keep the same name for excel display, just use the same name in name and displayName -->
<name>stats_line</name>
<displayName>Demande</displayName>
<columns>
<!-- columns order matter -->
<name>type_demande</name>
<name>financeur</name>
<name>wf_state</name>
<name>type_recrutement</name>
</columns>
</dimension>
<dimension>
<!-- if you want to keep the same name for excel display, just use the same name in name and displayName -->
<name>orgunit</name>
<displayName>Organisation</displayName>
<columns>
<!-- columns order matter -->
<name>type</name>
<name>nom</name>
<name>sigle</name>
</columns>
</dimension>
</dimensions>
<!-- end building customized dimensions display in excel from the star schema -->
</cube>
</cubes>
""" """
def __init__(self, cube_path, file_name='cubes-config.xml'): def __init__(self, cube_path, file_name='cubes-config.xml'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment