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
Calculator
==========

A simple calculator library.

This module is now a Python package. You can install it using:

$ sudo pip install simplecalculator

Examples of usage:

* `simplecalculator.py` -- a command-line utility

* `tornadoweb.py` -- a TornadoWeb applications with a minimalistic RESTful API. Do you math with curl!

How?
----

Clone this repo and tests:

$ python -m unittest test

All good?

Usage (in your script)
-----------------------

1. Import `calculator`

2. Instantiate `SimpleCalculator()`

3. Call `run()` with the list of values, operands, and functions you want to process.

4. The history of operations, results, and unprocessed input is stored in `SimpleCalculator.log`.

Here's a short sample:

from calculator.simple import SimpleCalculator

c = SimpleCalculator()
c.run('1 + 1')
print c.log

If you want to read the state of the LCD (no kidding!), use

print c.lcd

Usage (on the command line)
---------------------------

Run:

$ ./simplecalculator.py -s "1 + 2 / 6 acv 1 + 1 / 33 fmod 0.01"

then


$ ./simplecalculator.py -s "1 + 2 / 6 acv 1 + 1 / 33 ceil fmod"

then

$ ./simplecalculator.py -s "1 + 2 / 6 acv 1 + 1 / 33 fmod 0.01 1 2 3 4"

This calculator is as forgiving as a simple desktop calculator, it will ignore what it does not know, try to compute what it can treating the given string as a list of keystrokes. You may see one or more `status` entries after the last result, that's intended.

Usage (via curl)
----------------

If you want to implement this alculator as a RESTful API, install [TornadoWeb](http://tornadoweb.org 'TornadoWeb') and run `tornadoweb.py', then use curl:

$ curl -X POST http://localhost:8888/v1/calculate -d '1 + 2 / 6 acv 1 + 1 / 33 fmod 0.01 1 2 3 4'

You can easily extend this calculator to support any number of one- and two-argument functions, search calculator/simple.py for `fmod` and `ceil` to see what modifications you need to make.

Why?
----

I got asked to provide samples of my work, proof I know Python, etc. This project is way more than what I was asked to deliver, but I had more time to spare. There is more coming.

Who?
----

Jacek Artymiak
Release History

Release History

0.0.4

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.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.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.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
simplecalculator-0.0.4.tar.gz (2.8 kB) Copy SHA256 Checksum SHA256 Source Oct 12, 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