KCMath 0.0.1
A small mathematics package including an expression parser
Requires Python: >=3.6

=================
KCMath for Python
=================

***************
KCParser
***************
KCParser is a class that allows for the parsing of mathematical expressions as strings. KCParser currently supports 21 mathematical functions, such as summation, products, and trigonometry, as well as supporting 37 mathematical constants, such as pi, e, and the golden ratio.

In all cases of KCParser, the implementation structure is relatively similar. Firstly, declare an object of the KCParser() class. Next, set the expression of that object. Finally, parse the object. The code blocks below highlight this process, both for single and multiple objects.

**Basic implementation**

.. code-block:: python

 import KCMath
 
 p = KCMath.KCParser()
 p.set_expr("1 + 2")
 result = p.parse()
 print(result)  # prints "3" to the console

**Further implementation**

.. code-block:: python
 
 import KCMath
 
 p1, p2 = KCMath.KCParser(), KCMath.KCParser()
 p1.set_expr("1")
 p2.set_expr("2")
 p3 = p1 + p2
 result = p3.parse()
 print(result)  # prints "3" to the console 

**Mathematical functions parsable by KCParser**

The syntax for functions can be found in the docs folder (see GitHub). The following is a list of functions included in the KCParser class.

- abs, sqrt, root, ncr, npr, sigma, pi, ln, log, sin, asin, csc, sinh, cos, acos, sec, cosh, tan, atan, cot, tanh.

**Using mathematical constants in KCParser**

The syntax for mathematical constants can be found in the docs folder (see GitHub). The following is a list of constants included in the KCParser class.

.. list-table:: 
   :widths: 4 1
   :header-rows: 1

   * - Constant
     - Code

   * - Pi
     - pi
   * - Euler's Number
     - e
   * - Euler–Mascheroni constant
     - em
   * - The golden ratio
     - golden
   * - Meissel-Mertens constant
     - mm
   * - Bernstein's constant
     - bernstein
   * - Gauss-Kuzmin-Wirsing constant
     - gkw
   * - Hafner-Sarnak-McCurley constant
     - hsm
   * - Omega constant
     - omega
   * - Golomb-Dickman constant
     - gd
   * - Cahen's constant
     - cahen
   * - The twin prime constant
     - tp
   * - The laplace limit
     - laplace
   * - Embree-Trefethen constant
     - et
   * - Landau-Ramanujan constant
     - lr
   * - Brun's constant for prime quadruplets
     - brunpq
   * - Brun's constant for prime twins
     - brunpt
   * - Catalan's constant
     - catalan
   * - Viswanath's constant
     - viswanath
   * - Apéry's constant
     - apery
   * - Conway's constant
     - conway
   * - Mills' constant
     - mills
   * - The plastic number
     - plastic
   * - Ramanujan-Soldner constant
     - rs
   * - Backhouse's constant
     - backhouse
   * - Porter's constant
     - porter
   * - Lieb's square ice constant
     - lieb
   * - Erdős–Borwein constant
     - eb
   * - Niven's constant
     - niven
   * - The universal parabolic constant
     - upc
   * - Feigenbaum's α constant
     - feigenbauma
   * - Feigenbaum's δ constant
     - feigenbaumd
   * - Sierpinski's constant
     - sierpinski
   * - Khinchin's constant
     - khinchin
   * - Fransén–Robinson constant
     - fr
   * - Lévy's constant
     - levy
   * - The reciprocal Fibonacci constant
     - rf