Clean looking engineering calculations for IPython
Project description
ipycalc
Simple Engineering Calculations in Python
Turn the contents of a Jupyter cell into a formatted calculation by following the steps below:
- Install
ipycalc
usingpip install ipycalc
- Use
import ipycalc
to bringipycalc
into your notebook's namespace. - Use
%%calc
as the first line of a cell to indicate that you want to runipycalc
on the contents of a cell.
The basic calculation syntax is:
Variable Description: variable_name
= python_expression
-> result_decimal_places
*result_unit
# Reference Text
Key components of the ipycalc
syntax are:
:
(required) The description must come before this character.=
(optional) Used to assign a python expression to a variable name. Omit this if you simply want to reprint a previously defined variable.->
(optional) Separates the python expression from the results formatting rules.*
(optional) Indicate the number of decimals you want to see in the result to the left of the*
, and the units you want to see in the result to the right.#
(optional) Indicates reference text to the side of the calculation - handy for equation references or code references.
Here are a few useful things to keep in mind when using ipycalc
:
- Subscripts can be added by using the
_
character to indicate the start of a subscript. - To stack fractions place the numerator and denominater in parentheses: (num)/(denom) yields $\dfrac{num}{denom}$.
If
statements andelse
statements are available using python's inlineif
statement notation.- Square roots can be displayed using
sqrt
. - Prime characters can be displayed using
^prime
. - US units are built in via
Pint
. Metric units are not yet supported.
IPycalc is still in its infancy. I'm sure there are bugs, so be cautious and use your head. A special thanks to @connorferster for handcalcs
which inspired this project: https://github.com/connorferster/handcalcs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ipycalc-0.0.23.tar.gz
.
File metadata
- Download URL: ipycalc-0.0.23.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a66270993905a1db13111062744d27ebd8042dd183ce61679476af78d1c418b |
|
MD5 | 1e1653239e74353780f9177862185eb5 |
|
BLAKE2b-256 | 1a1451e1e3ff733ddaa3ca4cb48a1de4de433f4c0db2aaed8767c8efb388b05b |
File details
Details for the file ipycalc-0.0.23-py3-none-any.whl
.
File metadata
- Download URL: ipycalc-0.0.23-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e945301115fecd7a17eff1b8fd0b55ac0a723b667bcd08f5c2741197a9ebd8ed |
|
MD5 | 9f0a919a1c71690874e8cc8c9b75c28b |
|
BLAKE2b-256 | ab49b3c15a1e87cdc2f3d9306e0eabfca4ea2f39d928e762136980630d1a3ccf |