Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
fd74853b
Commit
fd74853b
authored
May 04, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config file docs
parent
96d344b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
0 deletions
+117
-0
docs/api.rst
docs/api.rst
+18
-0
olapy/core/mdx/tools/config_file_parser.py
olapy/core/mdx/tools/config_file_parser.py
+99
-0
No files found.
docs/api.rst
View file @
fd74853b
...
@@ -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``
------------------------------------
------------------------------------
...
...
olapy/core/mdx/tools/config_file_parser.py
View file @
fd74853b
...
@@ -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'
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment