Git Product home page Git Product logo

dynts's Introduction

A statistic package for python with enphasis on timeseries analysis. Built around numpy, it provides several back-end timeseries classes including R-based objects via rpy2. It is shipped with a domain specific language for timeseries analysis and manipulation built on to of ply.


Badges:license pyversions status pypiversion
Master CI:master-build coverage-master
Documentation:http://quantmind.github.io/dynts/
Dowloads:http://pypi.python.org/pypi/dynts/
Source:http://github.com/quantmind/dynts
Platforms:Linux, OSX, Windows. Python 3.5 and above
Keywords:timeseries, quantitative, finance, statistics, numpy, R, web

To create a timeseries object directly:

>>> from dynts import timeseries
>>> ts = timeseries('test')
>>> ts.type
'numpy'
>>> ts.name
'test'
>>> ts
TimeSeries:numpy:test
>>> str(ts)
'test'

The package comes with a Domain-Specific-Language (DSL) dedicated to timeserie analysis and manipulation. This is a simple multiplication:

>>> from dynts import api
>>> e = api.parse('2*GOOG')
>>> e
2.0 * goog
>>> len(e)
2
>>> list(e)
[2.0, goog]
>>> ts = api.evaluate(e).unwind()
>>> ts
TimeSeries:numpy:2.0 * goog
>>> len(ts)
251

There are few requirements that must be met:

  • python 2.6 up to python 3.3.
  • numpy version 1.5.1 or higher for arrays and matrices.
  • ply version 3.3 or higher, the building block of the DSL.
  • ccy for date and currency manipulation.

Depending on the back-end used, additional dependencies need to be met. For example, there are back-ends depending on the following R packages:

Installing rpy2 on Linux is straightforward, on windows it requires the python for windows extension library.

  • cython for performance. The library is not strictly dependent on cython, however its usage is highly recommended. If available several python modules will be replaced by more efficient compiled C code.
  • xlwt to create spreadsheet from timeseries.
  • matplotlib for plotting.
  • djpcms for the web.views module.

There are three types of tests available:

  • regression for unit and regression tests.
  • profile for analysing performance of different backends and impact of cython.
  • bench same as profile but geared towards speed rather than profiling.

From the distribution directory type:

python setup.py test

This will run by default the regression tests. To run a profile test type:

python runtests.py -t profile <test-name>

where <test-name> is the name of a profile test. To obtain a list of available tests for each test type, run:

python setup.py test -l

for unit tests, or:

python runtests.py -t profile --list

for profile, or:

python runtests.py -t bench --list

from benchmarks.

It is needed since during tests some data is fetched from google finance.

To access coverage of tests you need to install the coverage package and run the tests using:

coverage run runtests.py

and to check out the coverage report:

coverage report -m

dynts's People

Contributors

lsbardel avatar nmarshall avatar

Watchers

James Cloos avatar Gururaghav Gopal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.