Skip to main content

Persistent Objectified Indexed Data

Project description

Join the chat at https://gitter.im/Equitable/trump Documentation Status Travis CI Status Coveralls.io

Persistent Objectification of Indexed Data

Trump is a framework for objectifying data, with the goal of centralizing the responsibility of managing feeds, munging, calculating and validating data, upstream of any application or user requirement.

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

  • Prioritized, flexibly - a symbol can be associated with multiple data source for a variety of reasons including redundancy, calculations, or optionality.

  • Modified, reliably - a symbol’s data feeds can be changed out, without any changes requiring testing to the downstream application or user.

  • Verified, systematically - a variety of common data processing checks are performed as the symbol’s data is cached.

  • Audited, quickly - alerts and reports all become possible to assess integrity or inspect where manual over-rides have been performed.

  • Aggregated, intelligently - on a symbol by symbol basis, feeds can be combined and used in an extensible number of ways.

  • Customized, dynamically - extensibility is possible at the templating, munging, aggregation, and validity steps.

Planning

See docs/planning.md for the direction of the project.

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()

Installation

See the latest Installation instructions on ReadTheDocs.org

Requirements

  • Python 2.7; Support for Python 3.3 or 3.4 is do-able, if there is demand.

  • A Relational Database Supported by SQLAlchemy should work, however the following is tested: * PostgreSQL 9.4 * Persistent SQLite (ie, file-based). Certain features of Trump, wouldn’t make sense with an in-memory implementation)

Dependencies

Data Source Dependencies

Documentation

Read the latest on ReadTheDocs.org

Communication

License

BSD-3 clause. See the actual License.

Background

The prototype for Trump was built at Equitable Life of Canada in 2014 by Jeffrey McLarty, CFA and Derek Vinke, CFA. Jeffrey McLarty currently leads the Open Source initiative.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Trump-0.0.2.zip (57.5 kB view details)

Uploaded Source

File details

Details for the file Trump-0.0.2.zip.

File metadata

  • Download URL: Trump-0.0.2.zip
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Trump-0.0.2.zip
Algorithm Hash digest
SHA256 58da58428a442b77dc09a1e826e0a51183de1f001604a52a6a57084394297032
MD5 5c6a80fe3e0310c3162208836c7462bb
BLAKE2b-256 ab16762ee83ecfca637ba9290d368b044e99ed4736f3fe31e4985ebaa8e8418d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page