Skip to main content

AHL Research Versioned TimeSeries and Tick store

Project description

Circle CI Coverage Status Join the chat at https://gitter.im/manahl/arctic

Arctic is a high performance datastore for numeric data. It supports Pandas, numpy arrays and pickled objects out-of-the-box, with pluggable support for other data types and optional versioning.

Arctic can query millions of rows per second per client, achieves ~10x compression on network bandwidth, ~10x compression on disk, and scales to hundreds of millions of rows per second per MongoDB instance.

Arctic has been under active development at Man AHL since 2012.

Quickstart

Install Arctic

pip install git+https://github.com/manahl/arctic.git

Run a MongoDB

mongod --dbpath <path/to/db_directory>

Using VersionStore

from arctic import Arctic

# Connect to Local MONGODB
store = Arctic('localhost')

# Create the library - defaults to VersionStore
store.initialize_library('NASDAQ')

# Access the library
library = store['NASDAQ']

# Load some data - maybe from Quandl
aapl = Quandl.get("NASDAQ/AAPL", authtoken="your token here")

# Store the data in the library
library.write('AAPL', aapl, metadata={'source': 'Quandl'})

# Reading the data
item = library.read('AAPL')
aapl = item.data
metadata = item.metadata

VersionStore supports much more: See the HowTo!

Adding your own storage engine

Plugging a custom class in as a library type is straightforward. This example shows how.

Concepts

Libraries

Arctic provides namespaced libraries of data. These libraries allow bucketing data by source, user or some other metric (for example frequency: End-Of-Day; Minute Bars; etc.).

Arctic supports multiple data libraries per user. A user (or namespace) maps to a MongoDB database (the granularity of mongo authentication). The library itself is composed of a number of collections within the database. Libraries look like:

  • user.EOD

  • user.ONEMINUTE

A library is mapped to a Python class. All library databases in MongoDB are prefixed with ‘arctic_’

Storage Engines

Arctic includes two storage engines:

  • VersionStore: a key-value versioned TimeSeries store. It supports:

    • Pandas data types (other Python types pickled)

    • Multiple versions of each data item. Can easily read previous versions.

    • Create point-in-time snapshots across symbols in a library

    • Soft quota support

    • Hooks for persisting other data types

    • Audited writes: API for saving metadata and data before and after a write.

    • a wide range of TimeSeries data frequencies: End-Of-Day to Minute bars

    • See the HowTo

  • TickStore: Column oriented tick database. Supports dynamic fields, chunks aren’t versioned. Designed for large continuously ticking data.

Arctic storage implementations are pluggable. VersionStore is the default.

Requirements

Arctic currently works with:

  • Python 2.7

  • pymongo >= 3.0

  • Pandas

  • MongoDB >= 2.4.x

Acknowledgements

Arctic has been under active development at Man AHL since 2012.

It wouldn’t be possible without the work of the AHL Data Engineering Team including:

Contributions welcome!

License

Arctic is licensed under the GNU LGPL v2.1. A copy of which is included in LICENSE

Changelog

1.6 (2015-09-16)

  • Feature: Add support for multi-index Bitemporal DataFrame storage. This allows persisting data and changes within the DataFrame making it easier to see how old data has been revised over time.

  • Bugfix: Ensure we call the error logging hook when exceptions occur

1.5 (2015-09-02)

  • Always use the primary cluster node for ‘has_symbol()’, it’s safer

1.4 (2015-08-19)

  • Bugfixes for timezone handling, now ensures use of non-naive datetimes

  • Bugfix for tickstore read missing images

1.3 (2015-08-011)

  • Improvements to command-line control scripts for users and libraries

  • Bugfix for pickling top-level Arctic object

1.2 (2015-06-29)

  • Allow snapshotting a range of versions in the VersionStore, and snapshot all versions by default.

1.1 (2015-06-16)

  • Bugfix for backwards-compatible unpickling of bson-encoded data

  • Added switch for enabling parallel lz4 compression

1.0 (2015-06-14)

  • Initial public release

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

arctic-1.6.0-py2.7-linux-x86_64.egg (357.6 kB view details)

Uploaded Source

File details

Details for the file arctic-1.6.0-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for arctic-1.6.0-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 2f0e3b7309047540871907977a9eedd05acec598934f7775299630ac9349a005
MD5 a9067ae126c15ee75bc8aa9f00dcfd6c
BLAKE2b-256 ca9fe45f33f7017aef0b09894c80b8952982d1cb1e07c63136011b6d96962e07

See more details on using hashes here.

Supported by

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