ServerPortfolio  2.0
Python parsers and server
 All Classes Namespaces Files Functions Variables Properties Pages
Functions | Variables
Run_Parsers Namespace Reference

Standalone program, implement all possible functions with or without the Server running. More...

Functions

def send_to_server
 Get the last instantaneous data of the list of stocks. More...
 
def CallYahooCSV
 Make calls to YahooAPI module. More...
 

Variables

 verbose = None
 
tuple arg_parser = argparse.ArgumentParser(description="Main executable for parsing data from web page")
 
string help = 'method GET / FORCE / UPDATE_CSV / TEST_SERVER'
 
tuple option = arg_parser.parse_args()
 
tuple logger = logging.getLogger('SP')
 
tuple main_logger = logging.getLogger("SP.run_parser")
 
tuple server_running = SocketServer_Client.Connect()
 
tuple received = send_to_server( option.method, option.action, option.list_stock )
 

Detailed Description

Standalone program, implement all possible functions with or without the Server running.


If the server is running call the server functions (not always need to query the web page)
or make a call to Parserstocks through UpdateStocks
Should be called simply from apache/ROOT_application with a minimum wrapper
Return a simple string to the caller

Last Changed $Id$

Function Documentation

def Run_Parsers.CallYahooCSV (   dict_stocks,
  stock,
  action 
)

Make calls to YahooAPI module.

Not tested yet, work only for one stock

Implements:

  • LAST_CSV_UPDATE :
  • UPDATE_CSV : Download stock values from last in file to today
  • INTRO : Download stock data from first available to first in file

Definition at line 208 of file Run_Parsers.py.

def Run_Parsers.send_to_server (   method,
  action,
  list_stock,
  header = False 
)

Get the last instantaneous data of the list of stocks.

Only used with Boursorama at this point

method

Parameters
list_stockof the stock symbols
action
headerif True print a header before the data

Definition at line 154 of file Run_Parsers.py.

Variable Documentation

tuple Run_Parsers.arg_parser = argparse.ArgumentParser(description="Main executable for parsing data from web page")

Definition at line 255 of file Run_Parsers.py.

string Run_Parsers.help = 'method GET / FORCE / UPDATE_CSV / TEST_SERVER'

Definition at line 262 of file Run_Parsers.py.

tuple Run_Parsers.logger = logging.getLogger('SP')

Definition at line 293 of file Run_Parsers.py.

tuple Run_Parsers.main_logger = logging.getLogger("SP.run_parser")

Definition at line 294 of file Run_Parsers.py.

tuple Run_Parsers.option = arg_parser.parse_args()

Definition at line 276 of file Run_Parsers.py.

tuple Run_Parsers.received = send_to_server( option.method, option.action, option.list_stock )

Definition at line 328 of file Run_Parsers.py.

tuple Run_Parsers.server_running = SocketServer_Client.Connect()

Definition at line 303 of file Run_Parsers.py.

Run_Parsers.verbose = None

Definition at line 42 of file Run_Parsers.py.