0

Hi,

I am a new user and I want to show you my Python library.

*pypol*

pypol is a Python library that allows you to manipulate monomials, polynomials and algebraic fractions.

An example:

```
>>> import pypol
>>> a = pypol.polynomial('3xy - 3a^2 + 2b')
>>> a
- 3a² + 3xy + 2b
>>> a.append('-2')
>>> a.right_hand_side
-2
>>> del a[-1]
>>> a.right_hand_side
False
>>> a.append('-2')
>>> a.letters
('a', 'b', 'x', 'y')
>>> a.powers()
{'a': [2, 0], 'b': [1, 0], 'x': [1, 0], 'y': [1, 0]}
>>> a.iscomplete('x')
True
>>> a.iscomplete('a')
False
>>> a._make_complete('a')
True
>>> a.iscomplete('a')
True
>>> a.monomials
((-3, {'a': 2}), (0, {'a': 1}), (3, {'x': 1, 'y': 1}), (2, {'b': 1}), (-2, {}))
>>> a
- 3a² + 3xy + 2b - 2
>>> a.max_power('a')
2
>>> a.min_power('a')
0
>>> a.isordered('a')
True
>>> b = pypol.polynomial('3a - 1')
>>> b.zeros
()
>>> b.print_format = False
>>> b
+ 3a - 1
>>> b.append('2x2')
>>> b
+ 2x^2 + 3a - 1
>>> b.print_format = True
>>> b
+ 2x² + 3a - 1
>>> p = pypol.Polynomial(((3, {'a': 2}), (-2, {'a': 1}), (2, {})))
>>> p
+ 3a² - 2a + 2
>>> a
- 3a² + 3xy + 2b - 2
>>> p
+ 3a² - 2a + 2
>>> a + p
+ 3xy + 2b - 2a
>>> a - p
- 6a² + 3xy + 2b + 2a - 4
>>> a * p
- 9a⁴ + 6a³ + 9a²xy + 6a²b - 12a² - 6axy + 6xy - 4ab + 4b + 4a - 4
>>> p(2)
10
>>> pp = pypol.polynomial('3x4 - 2x3 + x - 4')
>>> ppp = pypol.polynomial('x - 2')
>>> divmod(pp, ppp)
(+ 3x³ + 4x² + 8x + 17, + 30)
>>> c, d = divmod(pp, ppp) # quotient and remainder
>>> c * ppp + d
+ 3x⁴ - 2x³ + x - 4
>>> c * ppp + d == pp
True
```

There are many others features...

The project is at http://github.com/rubik/pypol

and

Python Package Index

and here is the documentation:

http://pypol.altervista.org/

What do you think?

Thanks,

rubik-pypol