← All notesPortfolio

Disclaimer: Data may be delayed, incomplete or inaccurate. For education and research only. Use at your own risk. Not financial advice.

November 2026 · 5 min read

Building a palm oil news pipeline from LSEG

A palm oil desk gets hundreds of headlines a day: Malaysian export estimates, Indonesian levy changes, Indian import duties, biodiesel mandates and weather. Only a handful move the market. This is how I built a small pipeline that finds those, stores them, and delivers them without anyone scrolling a terminal.

1. Extract: the LSEG Data Library

The lseg.data Python library opens a session to LSEG Workspace and queries headlines and story bodies by search terms and date range. Story bodies come back as HTML, so BeautifulSoup strips them to clean text.

import lseg.data as ld
ld.open_session()
heads = ld.news.get_headlines("palm oil OR CPO OR FCPO", count=100)

2. Filter: rules before models

I started with keyword rules rather than machine learning. They are easy to explain and easy to fix when they go wrong:

3. Load: Parquet, not CSV

Filtered stories go into Parquet files partitioned by date. Parquet keeps the data types, compresses news text well, and loads in a fraction of the time CSV takes once you have months of history. It also feeds straight into pandas or a BI tool for counting topics over time.

4. Deliver: a digest people actually read

The daily email is plain HTML, one line per story with the time, source and headline, sent over SMTP. A small JSON state file records which story IDs have already been sent, so a re-run never sends duplicates. That one detail made the job safe to schedule every few minutes.

What made it reliable