Your Machine SSH / SCP Eclipse Server
1
Your Machine
Generate BASIC Source Code
Python builds the BASIC program as a plain text string in memory. This is the program that will run inside UniVerse on the ERP server.
# Python function returns a string: build_basic_source()""" OPEN "INITIALS" TO INTF ELSE STOP SELECT INITIALS LOOP READNEXT IID ELSE EXIT READ IREC FROM INTF, IID PRINT IID, IREC<3>, IREC<37> ... REPEAT """
💡 Nothing has touched the server yet. This is just a Python string.
SSH pipe — text sent to server
2
SSH Transfer
Upload Source to Server
Python pipes the text string over SSH into a file in the BASIC Programs directory on the server.
ssh user@eclipse "cat > /eclipsedir/BP/SHEPOS.EMPLOYEE.EXPORT" # The BASIC source text is now sitting in BP/ as a record
3
Eclipse Server
Compile the Program
Python sends an SSH command that opens the UniVerse shell and tells it to compile the source into a runnable object.
# Python sends this via SSH: printf 'BASIC BP SHEPOS.EMPLOYEE.EXPORT\nQUIT\n' | uv # UniVerse reads the source and writes: BP/SHEPOS.EMPLOYEE.EXPORT ← source (already there) BP.O/SHEPOS.EMPLOYEE.EXPORT ← compiled object (NEW)
💾 Both persist on disk until deleted. The script overwrites them on the next run but never cleans up.
4
Eclipse Server
Launch via Wrapper Script
Python creates a small shell script on the server that runs the BASIC program and captures output to a file. Launched with nohup so SSH can disconnect.
# The wrapper script at /tmp/: #!/bin/sh cd /eclipsedir printf 'RUN BP SHEPOS.EMPLOYEE.EXPORT\nQUIT\n' | uv \ > /tmp/shepos_employee_export_output.txt touch /tmp/shepos_employee_export_done.flag # Launched detached: nohup /tmp/shepos_employee_export_run.sh &
The flag file is key — Python checks for it to know when the program finishes.
5
Eclipse Server — Inside UniVerse
BASIC Program Reads ERP Data
The compiled program runs inside UniVerse. It opens the INITIALS file, loops through every record, reads the fields, and prints tab-separated lines.
OPEN "INITIALS" → direct file handle SELECT INITIALS → queue up every record ID LOOP READNEXT IID → next employee initials (e.g. "JRB") READ IREC → full record into memory PRINT IID, name, dept, branch, title, email, active REPEAT # stdout → /tmp/shepos_employee_export_output.txt # done → touch /tmp/shepos_employee_export_done.flag
6
SSH Check
Poll for Completion
Python checks every 10 seconds — "does the flag file exist?" When it appears, the program is done.
# Every 10 seconds: ssh user@eclipse "test -f /tmp/shepos_employee_export_done.flag \ && echo DONE || echo RUNNING" [10s] RUNNING [20s] RUNNING [30s] DONE
SCP — output file pulled back
7
SCP Transfer
Fetch the Output File
Python uses SCP to copy the output file from the server back to the local machine.
scp user@eclipse:/tmp/shepos_employee_export_output.txt ./local_tmp # The file contains raw TSV: initials name department branch title email active JRB John Brown Sales 001 Sales Mgr jbrown@... Y KLM Kim Lee Warehouse 003 Picker klee@... Y XYZ Old Account ... 002 ... ... N
8
Your Machine
Parse TSV into Python Data
Python reads the text file line by line, splits on tabs, and builds a list of clean employee dictionaries.
parse_output(raw_text) → [ {"initials": "JRB", "name": "John Brown", "department": "Sales", "branch": "001", "active": true}, {"initials": "KLM", "name": "Kim Lee", "department": "Warehouse", "branch": "003", "active": true}, ... ]
9
Your Machine
Deliver the Results
Python outputs the data however you asked — JSON to screen, TSV to a file, or POST to the UET web app.
print(json.dumps(records)) # → stdout write_tsv(records, output_dir) # → employees.tsv post_to_uet(records, url) # → HTTP POST to app

Key Takeaways

💾
Programs persist on server
Source in BP/, compiled object in BP.O/. Overwritten each run, never cleaned up. Harmless — no load when idle.
📝
Generated fresh each time
Python rebuilds the BASIC source on every run. If you change the Python, the next run uploads the new version automatically.
🔒
Read-only extraction
These programs only READ from Eclipse files. They never write, update, or delete ERP data. Safe by design.
Why not just use the API?
Inside UniVerse, BASIC can read any file, resolve multivalue fields, and run computed logic the REST API doesn't expose.