This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

BP Diag parses blood preasure statistics from data files, generates some statistics and prints them to STDERR. You can export the data (and the gathered statistics) to JSON (dump to STDOUT). And you can also generate SVG or PNG charts from it.

To see a list of possible command line options run:

bpdiag.py --help

Examples

Lets say we got a file called bp.csv containing the following values:

136/83/65, 132/82/70
144/82/86, 137/81/75, -,         143/80/68
131/82/60, 144/82/64, 136/79/67, 140/80/62
136/83/68, 138/80/99, -,         133/74/65
136/79/67, 131/76/64, 135/81/72, 136/75/61
127/79/72

BP Diag first tries to split multiple entries on each line using the string given with the --delimiter option (default is ,). Each entry found is then split into sys, dia and pulse values with the string given with the --seperator option (default: /).

So if we run BP Diag on the file like this bpdiag.py bp.csv, we got the following results:

Read 17 value(s) from 1 file(s)...
Statistics (min, max, avg):
:: SYS...: 127, 144, 136
:: DIA...:  74,  83,  79
:: PULSE.:  60,  99,  69

Dump JSON

As you see parsing errors are ignored. We can dump JSON with the --json option. Only the JSON dump is written to STDOUT, other output goes to STDERR, so we can redirect the dump to a file (use --compact to prevent spaces after , and :):

bpdiag.py --json --compact bp.csv > bp.json

The file bp.json will then contain one long line with the JSON data. You can also dump the statistic gatherd from the data to JSON with the --json- stats option. Use the --sort and --indent 2 options if you want a more readable output.

Generate Charts

To generate SVG charts, you need to have PyGal installed (see below). Other than that, just use the --chart option to have a chart called bp.svg generated in your current directory. There are more options to this, take a look at the --help output.

Instead of the interactive SVG charts you can use PNG as output format. Just use the --png option along with --chart. You need a couple more dependencies for that though, take a look below.

Number of measurements per line

Per default all values are gathered one after the other and parsing errors are ignored. But you can use the --entries option to set a fixed number of measurements per line.

What this means is that only that much values are used per line (even if there are more) and if a line contains less than entries values, the remaining ones are filled with None values. Also values that conatin - (or any other combination of characters that does not parse to a three integer tuple) are not ignored but stored as a None value too.

This can be helpful in cases where you have a given number of measurements per line and you want to keep them aligned even if sometimes a measurement is skipped / missing.:

bpdiag.py --json --compact --entries 4 bp.csv

Will result in the following JSON:

[[136,83,65],[132,82,70],null,null,[144,82,86],[137,81,75],null,[143,80,68],[131,82,60],[144,82,64],[136,79,67],[140,80,62],[136,83,68],[138,80,99],null,[133,74,65],[136,79,67],[131,76,64],[135,81,72],[136,75,61],[127,79,72],null,null,null]

Install

You can install BP Diag with pip or from source.

Install with pip

pip is “a tool for installing and managing Python packages”. If you don’t have it installed, see the pip install instructions:

pip install --user bpdiag

Install from source

You can fetch the latest sourceball from github and unpack it, or just clone this repository: git clone git://github.com/brutus/bpdiag. If you got the source, change into the directory and use setup.py:

python setup.py install

Dependencies

PyGal is used to generate the charts. If you want to generate charts, you need to install it. With pip it’s as easy as this:

pip install --user pygal

If you want to export to PNG files, you need CairoSVG, tinycss and cssselect too. You can install them like this:

pip install --user CairoSVG tinycss cssselect

Bugs and Contribution

BP Diag is at home at: https://github.com/brutus/bpdiag/

If you find any bugs, issues or anything, please use the issue tracker.

Release History

Release History

0.5

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bpdiag-0.5.tar.gz (23.4 kB) Copy SHA256 Checksum SHA256 Source Feb 10, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting