Trump is a framework for objectifying data, with the goal of centralizing the management of data feeds to enable quicker deployment of analytics, applications, and reporting. Munging data, common calculations, validation of data, can all be handled by Trump, upstream of any application or user requirement.

Inside the Trump framework, a symbol refers to one or more data feeds, each with their own instructions saved for retrieving data from a specific source. Once it’s retrieved by Trump, depending on the attributes of the symbol, it gets munged, aggregated, checked, and cached. Downstream users are free to query the existing cache, force a re-cache, or check any property of the data prior to using it.

System Admins can systematically detect problems in advance, via common integrity checks of the data, then optionally schedule the re-cache by tag or symbol name. Users and admins have the ability to manually override problems if they exist, with a specific feed, in a way that is centralized, auditable, and backed-up efficiently.

With a focus on business processes, Trump’s long run goals enable data feeds to be:

Basic Usage

This example dramatically understates the utility of Trump's long term feature set.

Adding a Symbol

from trump.orm import SymbolManager
from trump.templating import QuandlFT, GoogleFinanceFT, YahooFinanceFT

sm = SymbolManager()

TSLA = sm.create(name = "TSLA",
                 description = "Tesla Closing Price USD")

TSLA.add_tags(["stocks","US"])

#Try Google First
#If Google's feed has a problem, try Quandl's backup
#If all else fails, use Yahoo's data...

TSLA.add_feed(GoogleFinanceFT("TSLA"))
TSLA.add_feed(QuandlFT("GOOG/NASDAQ_TSLA",fieldname='Close'))
TSLA.add_feed(YahooFinanceFT("TSLA"))

#Optional munging, validity checks and aggregation settings would be
#implemented here...

#All three feeds are cached...
TSLA.cache()

#But only a clean version of the data is served up...
print TSLA.df.tail()

              TSLA
dateindex
2015-03-20  198.08
2015-03-23  199.63
2015-03-24  201.72
2015-03-25  194.30
2015-03-26  190.40

sm.finish()

Using a Symbol

from trump.orm import SymbolManager

sm = SymbolManager()

TSLA = sm.get("TSLA")

#optional
TSLA.cache()

print TSLA.df.tail()

              TSLA
dateindex
2015-03-20  198.08
2015-03-23  199.63
2015-03-24  201.72
2015-03-25  194.30
2015-03-26  190.40

sm.finish()

More Information

Checkout the main repo's README for up to date information surrounding planning, installation, and more.