Skip to main content

pcalc

Basic math operations for Unix pipes.

https://travis-ci.org/geowurster/pcalc.svg?branch=master https://coveralls.io/repos/geowurster/pcalc/badge.svg?branch=master
$ pcalc --help
Usage: pcalc [OPTIONS] COMMAND [ARGS]...

  Basic math operations for Unix pipes.

  When working with a negative positional argument: '$ pcalc mul -- -1'

  All commands read from 'stdin' and write to 'stdout'.  Most commands
  stream but a few (like median) hold all values in memory.  Empty or all
  whitespace lines are skipped.

  Some commands (typically prefixed with 'r') reduce all input values to a
  single value.  For instance, '$ pcalc add 3' adds 3 to all input values,
  but '$ pcalc radd' adds all the values together like:

      output = 0
      for v in values:
          output = output + v

  For the most part it doesn't matter, but this tool is implemented in
  Python with floating point division enabled when running in Python 2.

Options:
  --help  Show this message and exit.

Commands:
  abs     Compute absolute value.
  add     Add a constant to values.
  ceil    Ceiling values.
  div     Divide values by a constant.
  floor   Floor values.
  mean    Compute mean.
  median  Compute median.
  mod     Modulo values by a single divisor.
  mode    Compute mode.
  mul     Multiply values by a constant.
  pow     Exponentiation of values by a constant.
  radd    Reduce by addition.
  rdiv    Reduce by division.
  rmod    Reduce by modulo.
  rmul    Reduce by multiplication.
  round   Round values.
  rsub    Reduce by subtraction.
  sub     Subtract a constant from values.
  sum     Compute sum.

Developing

$ git clone https://github.com/geowurster/pcalc.git
$ cd tpcalc
$ pip install -e .\[dev\]
$ py.test --cov pcalc --cov-report term-missing

License

See LICENSE.txt

Changelog

See CHANGES.md

Metadata

Release files for pcalc 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pcalc 1.0
File Size Uploaded
pcalc-1.0.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pcalc 1.0
File Interpreter ABI Platform
pcalc-1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 14.5 kB

Release files / pcalc-1.0.tar.gz

Download URL pcalc-1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
514fd094e931526e7263b0bc23931bb36fe334baab73ce56e6b403e928ad9e8b
BLAKE2b-256 checksum
How to use checksums
6ae329b1b14dc20816c7cb4231d31f8cf5b099ecb9d455e3c2dd2abcebc0a271
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pcalc-1.0-py2.py3-none-any.whl

Download URL pcalc-1.0-py2.py3-none-any.whl
Size 7.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f3d2ee8471f52ed46652e48d620e64f3da68798490fa5a5e56c7a397f63cf462
BLAKE2b-256 checksum
How to use checksums
4631d5cb06a70a458b44de3a3d921f6325a5afefe41b01f33621ce9c0aec430f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page