Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Iwin
Partner - Creator
Partner - Creator

Saving csv file as qvd using Python

Hi,

I have to save the cleaned csv file directly from python script to a qvd.

The csv file can be transformed from Qlik ,however user requires it from python itself

This is the code used to convert file to csv in python.

I want to store this final_dataframe file as qvd in python itself.

df_final.to_csv(r'D:\pythontoqlik\custom import files\final_dataframe.csv')

 

 

Labels (4)
2 Replies
marcus_sommer

AFAIK it's not possible - only Qlik could store data as a qvd because it's a special file-format.

- Marcus

jknjob_65
Contributor
Contributor

it is possible, to store data into QVD format using Python, you can utilize the PyQvd library. This library provides functionalities to interact with Qlik View Data (QVD) files.

Install using pip

pip install PyQvd

 

Storing Data to QVD

import pandas as pd
from pyqvd import QvdTable

# Create a sample Pandas DataFrame
data = {
'Column1': [1, 2, 3],
'Column2': ['A', 'B', 'C'],
'Column3': [True, False, True]
}
df = pd.DataFrame(data)

# Convert the Pandas DataFrame to a QvdTable object
qvd_table = QvdTable.from_pandas(df)

# Store the QvdTable object to a QVD file
qvd_table.to_qvd('output.qvd')

print("Data successfully stored to output.qvd")

 

Regards

Jay