Search

Connectors

Contact support

Helpdesk portal

Running apps (manual, schedule etc.)

Run modes

You can run a Peliqan script (data app) in different ways:

  • Interactive run: click the “Save & Run” button in the top menu above the script editor in Peliqan > Run interactively (Streamlit)
  • Background run (manual or scheduled): configure a schedule for your script or use the “Run in background” option from the “Save & Run” button
  • Publish API endpoint: make your script available as a public API endpoint. More info:
  • Publish APIs
  • Run outside of Peliqan: use the Peliqan pip module. Click here for more info on local development.
  • Published apps & apps pinned to homepage: these also use Interactive runs (Streamlit).
image

Scheduling runs

Use the “Schedule” menu option in the top menu of the script editor, activate the schedule and choose an interval:

  • 1 minute
  • 5 minutes
  • 15 minutes
  • 30 minutes
  • 1 hour
  • 6 hours
  • 12 hours
  • 24 hours

image

If your script takes a long time to complete and is still running when the next interval arrives, the next run will be queued. The scheduler will make sure that your script is never running twice at the same time (no parallel runs).

View logs

For each run of your script, you can view the logs under the “Logs” menu item:

image

Write to logs

Use print() statements in your apps to write to the logs. This will work in any type of app: Streamlit interactive apps, background runs, API handlers scripts.

Inside Peliqan, Streamlit is automatically imported as st. If you use Streamlit for output in your script, it will automatically be converted to print() statements when using background runs. Examples:

  • st.write()
  • st.json()
  • st.text()
  • st.title()
  • st.header()
  • st.subheader()
  • st.table()

All these Streamlit functions will be converted to a print() statement which writes to the logs, when using a background run. If you want to also do logging in interactive mode, you need to add additional print() statements in your code.

print() statements in interactive Streamlit runs will write to the log, but will not show up to the user in the UI so you need to use a combination of both if needed.

Detect run mode inside a script

You can use the predefined constant RUN_CONTEXT in your script to detect the run mode (run context):