Data apps on the Peliqan platform
Peliqan is an all-in-one data platform with a wide range of components, that can be controlled and used from within Data apps using Peliqan’spq module:
- Connectors (ETL pipelines that sync data from sources into a datawarehouse)
- Built-in datawarehouse, and ability to connect an external datawarehouse as ETL target
- Data explorer & SQL queries for data transformations (queries can be configured as views and/or can be materialized)
- Trino federated query engine
- Data replication
- Python IDE and runtime to develop, test, host, schedule & publish Data apps
Peliqan pq module
Thepq module exposes Peliqan’s low-code data-centric and data pipeline functions. The pq module is automatically available in Peliqan when you write Python code in Data apps and can be used in your local IDE by doing pip install peliqan and using import peliqan as pq in your code.
Constants
RUN_CONTEXT is always set when running a Data app in Peliqan.
Data apps can run interactively or in the background (e.g. scheduled). Streamlit is used to build UI’s for interactive apps.
Streamlit functions such as st.text(), st.write(), st.json(), st.table() etc. are converted to print statements in background runs.
Print statements are written to the log file of each run, visible in Peliqan.
Data warehouse, databases and tables
Connect to data warehouse or DB
Read
Insert
Update
Upsert
Inserts or updates based on therow_pk_value.
Write
Write implements full ELT pipeline logic: cast to schema (if given), upsert (insert or update based on pk value), and creates table and columns if needed.Execute query
Federated query engine Trino
Connect Trino
Read
Writeback (SaaS APIs)
Writeback functions are wrappers for the APIs of connected SaaS applications. Some SaaS connections in Peliqan are sources only (ELT pipelines), others are writeback only and some SaaS connections are both.SFTP
Connect SFTP
List files
Read file
State
State is stored and maintained across app runs. For session-state (within the scope of a single run), use Streamlit’s session state:st.session_state().
Get state
Set state
Sharing state between apps
Sharing state between two or more Data Apps running on Peliqan (e.g. in an orchestration pipeline):Note: when running a Data App outside of Peliqan, by default
pq.get_state() and pq.set_state(state)will read and write the state locally in a temporary file. The above code however, shares the state with a Data App running on Peliqan. Make sure that PELIQAN_INTERFACE_ID is set as a local environment variable, with the id of the Data App on Peliqan.