ServerPortfolio
2.0
Python parsers and server
|
This is the entry page of the documentation of the python ServerPortfolio package.
Follow this link to access the the C++ ROOT_application documentation.
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:
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
To use all the python tools, the shared library wrapPyStock.so
must be compiled first.
See the ROOT_application documentation.
Some paths must be edited manually before the compilation:
serverportfolio/GlobalDicts.py
: set the directories containing the data and the configuration file for the parser (dictstocks.txt
), as well as the TCP ports used for the communication with the server and the GUIThis documentation has been generated with:
doxygen path_to_mycstock/ServerPortfolio/trunk/ServerPortfolio/DoxyServerPortfolio
A single file (default PATH_DICT/dictstocks.txt
) contains the definition of the assets.
data/
.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:
The server is run in executing:
./Server_Portfolio.py
It is stopped in executing:
./SocketServer_Client.py BYE
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.