Skip to main content

calc-rtd logo

calc-rtd

Use Excel RTD (RealTimeData) servers from LibreOffice Calc, with the formula you already know:

=RTD("Vendor.ProgID";;"TOPIC1";"TOPIC2")

Many market-data terminals and industrial tools publish live data to spreadsheets through an RTD server, a COM component that Microsoft Excel loads for its RTD() function. LibreOffice Calc has no such function. calc-rtd adds it: a Calc extension provides RTD(), and a small Windows bridge loads the vendor's RTD server and plays Excel's part of the conversation.

Status: experimental (0.1). Verified end to end on Windows with LibreOffice and a third-party .NET RTD server. Every commit is tested against LibreOffice and a sample RTD server, in 32 and 64 bits.

calc-rtd is an independent project. It is not affiliated with or endorsed by Microsoft or The Document Foundation. It contains no Microsoft code: it implements the client side of the publicly documented IRtdServer interface.

How it works

 LibreOffice Calc                      bridge (Windows process)             RTD server
+------------------+   local TCP     +--------------------------+  COM  +----------------+
| calc-rtd.oxt     |<--------------->| calc-rtd-bridge serve    |<----->| IRtdServer     |
| =RTD(...)        |  JSON lines     | acts as Excel would      |       | (vendor's own) |
+------------------+ 127.0.0.1:47365 +--------------------------+       +----------------+
  • Extension (extension/): a Python add-in that registers the RTD function and returns an XVolatileResult, Calc's mechanism for values that change on their own. Standard library only, so it runs on the Python bundled with LibreOffice.
  • Bridge (src/calc_rtd_bridge/): a separate process that creates the RTD server through COM and drives it the way Excel does (ServerStart, ConnectData, UpdateNotify, RefreshData, Heartbeat...). Keeping it outside LibreOffice means it can match the RTD server's bitness (32/64-bit), and a misbehaving server cannot take the spreadsheet down.

Install

Requirements: Windows and LibreOffice 4.0 or later.

  1. Download the extension from the Releases page:
    • calc-rtd-win64.oxt or calc-rtd-win32.oxt include the bridge as a standalone program; nothing else to install. Pick the one that matches your RTD server (see below).
    • calc-rtd.oxt contains no executable. It needs Python 3.9+ and pip install calc-rtd; choose it if you prefer not to run a downloaded .exe.
  2. In LibreOffice: Tools > Extensions > Add, select the file, then restart LibreOffice (including the Quickstarter, if you use it).

32-bit or 64-bit? An RTD server shipped as a DLL only loads into a process of the same bitness as the Excel it was installed for; that is the bridge you need (it does not have to match LibreOffice). If unsure, try win64 first. Out-of-process (EXE) servers work with both.

The bundled program is not code-signed. Windows SmartScreen or your antivirus may warn about it. It is built from this repository by GitHub Actions; use the Python-only extension if you would rather not run it.

Do not "Run as administrator". Run LibreOffice (and the bridge) at the same privilege level as the application that feeds the RTD server. An elevated process cannot see the COM objects of a normal one, and the server fails with "Class not registered".

Use

In Calc, type the formula as you would in Excel:

=RTD("Vendor.ProgID";;"ACME";"LAST")

The extension starts the bridge in the background the first time an RTD formula is calculated, and the bridge exits about a minute after LibreOffice closes. Cells show #N/A until the first value arrives, as in Excel; the very first start can take a few seconds. Server errors appear as text starting with #RTD:, and #RTD: bridge offline means the bridge could not be started or reached.

You can also run the bridge yourself, for example to see its log:

calc-rtd-bridge -v serve

Environment variables, read by the extension and the bridge:

Variable Meaning
CALC_RTD_PORT TCP port on 127.0.0.1 (default 47365)
CALC_RTD_AUTOSTART=0 the extension never starts the bridge
CALC_RTD_BRIDGE_CMD command line the extension uses to start the bridge
CALC_RTD_TOKEN_FILE location of the authentication token

Simulated source (any OS, no RTD server needed)

=RTD("calcrtd.sim";;"clock")               current time, every second
=RTD("calcrtd.sim";;"counter";0.2)         1, 2, 3... every 0.2 s
=RTD("calcrtd.sim";;"random";10;20)        random number between 10 and 20
=RTD("calcrtd.sim";;"walk";"ACME";38.5)    random walk starting at 38.5
=RTD("calcrtd.sim";;"echo";"hello")        fixed text

Try an RTD server without LibreOffice

monitor loads an RTD server directly and prints what Calc would receive. Use it to check that a given server works with the bridge:

calc-rtd-bridge monitor "=RTD(Vendor.ProgID;;ACME;LAST)" --seconds 30

The formula can be pasted from Excel (, or ; separators, quotes optional). For several formulas use --file formulas.txt (one per line) or --progid X --topics A B. Put -v before monitor for detailed logging. The exit code is 0 if updates were received.

calc-rtd-bridge watch ... does the same through the socket of a running bridge.

Sample RTD server

samples/rtd-server contains a minimal RTD server in C# (ProgID CalcRtd.Sample) that needs only the .NET Framework included with Windows. From an elevated PowerShell:

.\samples\rtd-server\build.ps1 -Arch x64      # add -Unregister to remove it
calc-rtd-bridge monitor "=RTD(CalcRtd.Sample;;counter)" --seconds 5

The CI uses it to test the COM layer, in 32 and 64 bits, on every commit.

Known limitations

  • Windows only for real servers: RTD is a COM technology.
  • Copying from Excel: cells copied from Excel arrive as =_xlfn.RTD(...) and show #NAME?, because that is how Excel puts the function on the clipboard. Fix them all at once with Edit > Find & Replace: search for _xlfn., replace with nothing, "Search in: Formulas". The same applies to RTD formulas in an opened .xlsx file. Saving to .xlsx does not produce a formula Excel understands; use .ods.
  • Some vendors tie their RTD server to their own Excel add-in (login, licensing) and may refuse a host other than Excel. Your data vendor's terms of use still apply.
  • Out-of-process RTD servers need the RTD interfaces registered for marshalling, which installing Excel does.
  • The bridge listens on 127.0.0.1 only and requires a random token stored in a file that only your user account can read (%APPDATA%\calc-rtd\token). Programs running under your own account can still read it; the token keeps other accounts on the machine out.
  • Updates are delivered at most every --throttle milliseconds (default 500; Excel uses 2000).

Development

pip install -e . pytest
pytest                                    # bridge, protocol, RTD host (COM tests need the sample server)
python tools/build_oxt.py                 # builds dist/calc-rtd.oxt (no LibreOffice SDK needed)
unopkg add -f dist/calc-rtd.oxt
python tests/integration_libreoffice.py   # end to end against a headless LibreOffice

To use the bridge from source instead of a release:

pip install git+https://github.com/andreydani/calc-rtd

tools/build_oxt.py writes the UNO type library (.rdb) directly in its binary format, so unoidl-write from the SDK is not required. The protocol between extension and bridge is documented in src/calc_rtd_bridge/protocol.py; any program can be a client of the bridge.

License

MIT. Microsoft and Excel are trademarks of the Microsoft group of companies; LibreOffice is a trademark of The Document Foundation.

Metadata

Release files for calc-rtd 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for calc-rtd 0.1.1
File Size Uploaded Provenance Actions
calc_rtd-0.1.1.tar.gz 23.2 kB With provenance Details for calc_rtd-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for calc-rtd 0.1.1
File Interpreter ABI Platform Actions
calc_rtd-0.1.1-py3-none-any.whl Python 3 none any Details for calc_rtd-0.1.1-py3-none-any.whl

Total release size: 47.0 kB

Release files / calc_rtd-0.1.1.tar.gz

Download URL calc_rtd-0.1.1.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b217dfddc9e5d8d680b926b0bb93a0bbff6f5de65be27fefe9d672e3b7964cb8
BLAKE2b-256 checksum
How to use checksums
1f36c6d34918d9a43f304d74936eb332ddeff18dfa9c29c1db6c3c588f6218bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / calc_rtd-0.1.1-py3-none-any.whl

Download URL calc_rtd-0.1.1-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5e4e80e19733cf2818b9ced793f01a3c06b8b4bde32d180c6b5c5c647c3fe46
BLAKE2b-256 checksum
How to use checksums
21b85e99737f3e9917b373d3fec626cec0fce48a64c353f084058185c320efc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for calc-rtd 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for calc_rtd-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page