The program ebstat.py creates price vs. time diagrams, with moving median price over a configurable period of time. It is a command line program, but the diagram is displayed in an interactive window. The diagram can be scaled, moved and saved as an image.
The program analyzes files created by the Ebay bidding program JBidwatcher. For information on JBidwatcher go to:
This program is written in the Python programming language, and uses additional libraries for numerical computations and drawing graphs. The dependencies are:
- Python: programming language (http://www.python.org/) The program has only been tested on Python version 2.6
- Numpy: library for numerical computations (http://numpy.scipy.org/)
- Matplotlib: library for drawing graphs (http://matplotlib.sourceforge.net/)
Python is usually not present on Windows. The most easy way for Windows users to install all dependencies at once, is Python XY a (giant) Python distribution for scientists:
Python is usually installed on all Linux distributions, Numpy and Matplotlib are not. However packages for Numpy and Matplotlib exist for most distributions. To install these libraries, use the installation program(s) for your Linux distribution.
The most easy way to install Numpy and Matplotlib on openSuse, is through openSuse’s website:
You need to install: python-matplotlib, python-matplotlib-tk, and python-numpy all from the same repository.
The science repository can also be added to the package management with the administration program Yast. Open the Software Repositories dialog and add the repository that matches your version of openSuse. The repositories are here:
The packages (python-matplotlib, python-matplotlib-tk, python-numpy) will then appear in the Software Management dialog.
Numpy and Matplotlib are in the Universe component. Universe must be enabled, for Matplotlib and Numpy to appear in the package manager (Add/Remove Applications or Synaptic). This is explained here:
If you can’t find Numpy and Matplotlib for your operating system, look at these (somewhat cryptic) directions:
Hm... ?
There are several ways to install the program.
JBidwatcher Companion can be installed with the program easy_install, which downloads the necessary package from the Pyhon Package Index (http://pypi.python.org/pypi), and installs it.
Get administrative privileges, then open a shell window / DOS box and type:
easy_install jbidwatcher-companion
If you have already installed JBidwatcher Companion, you can upgrade to the latest version of by typing:
easy_install -U jbidwatcher-companion
The classical installation from sources is possible too.
- Download a *.zip or *.tar.gz source archive/package from one of the sites below:
- Extract the contents of the archive.
- Open a shell window / DOS box.
- Get administrator privileges.
- Change to the folder that contains the archive’s contents. (JBidwatcher-Companion-*).
- Type the following command:
python setup.py install
If you have an RPM based (Linux) system, you can click on a *.rpm package to install software. Currently only RPMs for my particular openSuse system are built. They might work on other RPM based systems too.
The program consists only of the single file ebstat.py, and therefore needs no installation to run. The file can be stored in any directory and run there. To behave like a regular command, you must make the file executable, and put it into the path.
If you don’t want to make the file executable, for example for a quick test, you can run it like so:
python ebstat.py ls
For detailed usage instructions see section Usage below.
To get the file download a source archive/package (*.zip or *.tar.gz) from one of the sites below, and unpack it.
The program reads files from JBidwatcher in *.xml and *.csv format. By default it reads ~/.jbidwatcher/auctions.xml, which is regularly updated by JBidwatcher (every 10 minutes).
Auctions can be selected for graphing based on two criteria: the tab where they reside (options -t, -T), and their comment (options -c, -C). The same criteria are also used to group the auctions into the lines of the diagram (option -g).
ebstat.py [gr] -t <tab name> [<options>]
ebstat.py ls [<options>]
The program understands four commands: gr, ls, save-defaults and clear-defaults. If no command is given, gr is assumed.
--version Show program’s version number and exit -h, --help Show a help message and exit -t <tab name,...>, --include-tabs=<tab name,...> Tabs that should be analyzed. Shell-style wildcards can be used. For example "Nikon*" matches all names that start with “Nikon”. Default: "*" (All tabs) -T <tab name,...>, --exclude-tabs=<tab name,...> Tabs that should NOT be analyzed. Shell-style wildcards can be used. Default: Exclude no auction. -c <comment name,...>, --include-comments=<comment name,...> Comments that should be analyzed. Shell-style wildcards can be used. Default: "*"; (All comments) -C <comment name,...>, --exclude-comments=<comment name,...> Comments that should NOT be analyzed. Shell-style wildcards can be used. Default: Exclude no auction. -u <column>, --analyze-column=<column> Column that should be analyzed. Default: Total -g <format string>, --group-auctions=<format string> Group auctions into lines.
- t: auctions from different tabs get into different lines
- c: use comments to group auctions
- tc: both criteria
- _: all selected auctions get in one line.
Default: tc
-w <number of days>, --window=<number of days> Length of the window for computing the moving median. Default: 31 -i <file name>, --input-file=<file name> Name of input file that contains price information. Default: ~/.jbidwatcher/auctions.xml -o <file name>, --output-image=<file name> Store generated graph as (PNG) image in the current directory. Default: do not store image. -b, --batch Batch operation. Do not show any graph windows. Default: False -l, --long-output Show more information. Default: False --title=<title string> Title of the chart. Default: Program creates title. --legend-position=<position> Position of the legend. Possible values are: upper-left, upper-center, upper-right, center-left, center, center-right, lower-left, lower-center, lower-right, best. Default: best (Best position is chosen automatically.) --double-click-command=<command> Command that is executed when the user performs a double click. The string {ID} is replaced by the auction’s Ebay ID.Default: (Start Firefox)
firefox "http://cgi.ebay.de/ws/eBayISAPI.dll?ViewItem&item={ID}"
The usage of the interactive graph window is mostly self explanatory. Some features however can’t be discovered through the GUI. The most important features are:
A detailed description is in the documentation of Matplotlib:
List the tabs in ~/.jbidwatcher/auctions.xml:
ebstat.py ls
Create a graph from the tab “Nikon SB”:
ebstat.py gr -t "Nikon SB"
Create a graph from all tabs that contain the word “Lens”; use only the comments to group auctions into lists; use a window of 50 days to compute the moving median:
ebstat.py gr -t "*Lens*" -g c -w 50
Create a graph from a .csv file in the data directory; exclude auctions with the comments “SB 600” or “SB 800”; use a window of 50 days to compute the moving median.
ebstat.py gr -i data/nikon-flash.csv -C "SB 600,SB 800" -w 50
Bugs and feature requests (set importance to wishlist) can be reported on the development website: