Skip to content

Commit b49e7ea

Browse files
Corrected and improved README.md
1 parent c2227d6 commit b49e7ea

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ pip install git+https://github.com/JustinOstrowsky/pythonOBIEE@v1.0.0#egg=python
2727
### Export reports and save to disk
2828

2929
```py
30-
from pythonOBIEE import build_client, OBIEEsession, OBIEEAnalysisExporter, Report
30+
from getpass import getpass
31+
from pythonOBIEE import build_client, OBIEESession, OBIEEAnalysisExporter, Report
3132

32-
# Set credentials
33-
username = "username"
34-
password = "password"
33+
# Get credentials
34+
username = input("Enter your username: ")
35+
password = getpass("Enter your password: ")
3536

3637
# Set output folder
3738
output_folder = "/your/local/path"
3839

40+
# Create our report objects
3941
reports = [
4042
Report("/shared/Report/Path/Report1", "CSV", output_folder),
4143
Report("/shared/Report/Path/Report2", "EXCEL2007", output_folder),
@@ -48,7 +50,7 @@ wsdl = "http://your-OBIEE-server/analytics-ws/saw.dll/wsdl/v10"
4850
client = build_client(wsdl)
4951

5052
# Create session
51-
with OBIEEsession(client, username, password):
53+
with OBIEESession(client, username, password):
5254
# Create analysis exporter
5355
analysis_exporter = OBIEEAnalysisExporter(client)
5456

@@ -63,14 +65,15 @@ with OBIEEsession(client, username, password):
6365
While this package does not directly allow you to export to a dataframe, you can get the exported file in memory, which you can then load with Pandas to a dataframe. You most likely want to export as a CSV for this use case.
6466

6567
```py
68+
from getpass import getpass
6669
import pandas as pd
67-
from pythonOBIEE import build_client, OBIEEsession, OBIEEAnalysisExporter, Report
70+
from pythonOBIEE import build_client, OBIEESession, OBIEEAnalysisExporter, Report
6871

69-
# Set credentials
70-
username = "username"
71-
password = "password"
72+
# Get credentials
73+
username = input("Enter your username: ")
74+
password = getpass("Enter your password: ")
7275

73-
# Set report
76+
# Create a Report object
7477
report = Report("/shared/Report/Path/Report1", "CSV")
7578

7679
# WSDL URL
@@ -80,7 +83,7 @@ wsdl = "http://your-OBIEE-server/analytics-ws/saw.dll/wsdl/v10"
8083
client = build_client(wsdl)
8184

8285
# Create session
83-
with OBIEEsession(client, username, password):
86+
with OBIEESession(client, username, password):
8487
# Create analysis exporter
8588
analysis_exporter = OBIEEAnalysisExporter(client)
8689

@@ -89,8 +92,24 @@ with OBIEEsession(client, username, password):
8992
report_file, file_extension = analysis_exporter.export_to_file_like_object(report)
9093

9194
df = pd.read_csv(report_file)
92-
95+
9396
# Print the first few lines of the dataframe
9497
print(df.head())
9598

9699
```
100+
101+
### Logging
102+
103+
pythonOBIEE supports logging. Setting the logging level to INFO provides useful detail. More detailed information is available at the DEBUG level.
104+
For DEBUG level logging, you will likely want to configure the log level specifically for pythonOBIEE to avoid flooding the console with messages from other modules.
105+
106+
```py
107+
import logging
108+
109+
# Set the general logging level to INFO
110+
logging.basicConfig(level=logging.INFO)
111+
112+
# Set the logging level specifically for the pythonOBIEE module to DEBUG
113+
logging.getLogger("pythonOBIEE").setLevel(logging.DEBUG)
114+
115+
```

0 commit comments

Comments
 (0)