ServerPortfolio  2.0
Python parsers and server
 All Classes Namespaces Files Functions Variables Properties Pages
ServerPortfolio Documentation

This is the entry page of the documentation of the python ServerPortfolio package.
Follow this link to access the the C++ ROOT_application documentation.

Contents

Overview of the package

The aim of ServerPortfolio is to retrieve and store financial data from the internet.
A server is provided to update periodically the value of assets and can be queried from python or C++ modules through a TCP/IP connection.

Different types of financial data can be retrieved, they are referred as Action in the rest of the documentation:

Data are stored either in a XML or Comma-Separated Values format:

The python package provides:

Dependencies and installation

The installation of lxml is required.
The other modules are available by default with python 2.7:

There is not (yet) the possibility to install or distribute the package. So it is needed to set up the PYTHONPATH variable:
export PYTHONPATH=path_to_mycstock/ServerPortfolio/trunk/ServerPortfolio

before using any of the tools or importing the package in a python script with:
import serverportfolio

Compiling the wrapper to the C++ code

To use all the python tools, the shared library wrapPyStock.so must be compiled first.
See the ROOT_application documentation.

Configuration

Some paths must be edited manually before the compilation:

This documentation has been generated with:
doxygen path_to_mycstock/ServerPortfolio/trunk/ServerPortfolio/DoxyServerPortfolio

Asset configuration

A single file (default PATH_DICT/dictstocks.txt) contains the definition of the assets.

## code market code_bourso code_yahoo format_bourso
CAC40 FR 1rPCAC ^FCHI Pts
ORA FR 1rPORA ORA.PA EURO
LVC FR 1rTLVC lvc EURO
FSLR US FSLR FSLR DOLLAR
FAZ US 1yFAZ faz DOLLAR
DJ US %24INDU DJ Pts
DAX DE 5pDAX dax Pts
CBK DE 1zCBK CBK EURO
SP500 US %24INX ^GSPC Pts
EURUS DEVISE 1xEURUS toto2 Pts
Brent MP 8xBRN brent DOLLAR
AUX MP 1xGLDAM or Pts
# can add comment with '#'
# it is a future, code always changing, commented
#OIL MP CLJN10 petrole Pts

The codes (code_bourso and code_yahoo) must be edited manually by the user. The only way at this moment is to visit the respective websites and check the URL. They must follow the format:

Usage of the tools

Running the ServerPortfolio for real time update

The server is run in executing:

It is stopped in executing:

Using the Python parsers as a command line

The tool Run_Parsers.py group all options. Action available for parsing instantaneous values with –source=Boursorama:

Actions available for updating historical data with –source=Yahoo:

Run RunParsers.py -h to get the help and examples.