sp.py sp.py is a Python utility, enabling you to access all the Screen Player's functionality rapidly Works with Python >= 2.5
sp.py sp.py by itself does not provide and does not implement any functionality, instead it provides a set of tasks, each of which can handle different work arguments sp.py
sp.py Screen Player provides multi-level config system. Any command line option for a specified task can be stored in config section, named after the task. Options at the level with higher priority override the same options at The level with lower priority. For example to set option -s STEP, --step=STEP for 'sp.py play': [play] step = 10 Levels priority order (ascending) Config system in Screen Player Execute task sp.py -с (--config) for any task
Adapting to screen's logging system How does Screen Player play back the logs saving the nature of the interaction and time characteristics? Time stamps allow you to restore the real speed, tempo and load of the 'screen' terminal, when the logs where being written. Two ways of how Screen Player plays back:
Uses time stamps, built into log file by 'screen'
Writes it's own time stamps, tracking the changes to the size of the log file (needs the utility to be launched while logging)
Adapting to screen's logging system Time line 0 Stamp, 200 bytes Stamp, 800 bytes Stamp, 2000 bytes Stamp, 2100 bytes Structure of time stamps: Time stamp here is an exact moment of time and the size of the log file in this moment of time. Stamps data can be stored in different, yet 3 formats:
Adapting to screen's logging system Track log file size and writing time stamps manually, sp.py track This command shows help for the task : To start tracking a file logfile.txt and producing stamps to logfile.txt.times , use this: To start tracking a file logfile.txt and producing stamps to custom stamps file, use this: Option --storage enables you to choose a type of the storage for the time-stamps: pickle, csv etc.
Adapting to screen's logging system Splitting the log file with built-in stamps to separate time stamps storage and clean log data, sp.py split Let us split the log file logfile_dirty.txt with built-in stamps, produce the clean log to logfile_clean.txt and store time stamps In logfile_clean.txt.times (adjusted implicitly): If you need just to clean up the log file from the built-in time stamps, use flag – c . In this case time stamps won't be stored. Type of the time stamps storage can be set by a flag --storage
Player in action Playback of the log file, having separate time-stamps and log files, sp.py play To start playing back a log file logfile.txt , when the time stamps storage is logfile.times, use this: -t option will let you set the time stamps storage explicitly. Start from the specified moment of time, defining a start point using a --jump(-j) option. A value has to be a screen player's ISO 8601 time stamp.
Playback of the log file with built-in time-stamps Player in action Assume, that you have a large log file, produced by screen with “ logtstamp” option on, and you want to play it back easily, not having to worry about the separate time-stamps storage and “clean” log file. Use -d (--dirty) option:
Player in action Screen player's ISO 8601 date/time format A basic format of the date/time in ISO 8601 is: Screen player offers optional ISO 8601 format, when any count of the parameter can be omitted and inherited from the default date/time. For example: In ' sp.py play' our stamp is based on a default stamp – first one from the time stamps storage, here we omitted the month, day, hour and Time zone – all this parameters will be inherited from the default stamp
Adapting to screen's logging system Investigating the time line, sp.py tinfo Let us retrieve the information about the time line, using time stamps storage logfile.times. The command shows the start & end points, count of stamps, full duration of the time line: To write all the time stamps to a file as CSV values, use flag -- all :
Player in action List of the shortcuts can be retrieved using this command: Controlling the playback. Player shortcuts To adjust the size of the step, made when jumping back/forward: --step <seconds> option
Charts builder Screen player allows you to investigate the load and busyness of the 'screen' terminal in visual mode – drawing the statistics chart. This facility enables you to compare busyness of terminal in different periods of time, assess rise and falls in terminal activity, make conclusions.
Charts builder Chart building functionality can be accessed by sp.py 'chart' task. Let us build a chart, showing the activity of the terminal, which was being logged. Let us save the image, produced to a file image.png, with size 800x100 Our image.png may look like this now:
Charts builder Google charts sp.py chart functionality is based on Google Charts service from Google Inc. 
Structure sp.py – Python executable module, uses “screenlog” Python package. A package encapsulates the Screen Player functionality. Consists of several modules. Inside of the Screen Player sp.py screenlog package Gathering tasks – modules with __task__ attribute player.py timeparser.py tracker.py splitter.py statchart.py util.py __init__.py
Code documentation Doctests Screen Player code is well documented, doctests are included in the code into the docstrings. Screen Player offers an uility to test all the modules of “screenlog” by once:
Code documentation Epydoc Screen Player supports 'epydoc' documentation, it enables you to generate documentation in PDF or HTML format For example to generate HTML documentation for “screenlog” package, install Epydoc  and type: