Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tizz98/xl
Generate excel formulas in python
https://github.com/tizz98/xl
excel excel-formula-generator formula generator python
Last synced: 30 days ago
JSON representation
Generate excel formulas in python
- Host: GitHub
- URL: https://github.com/tizz98/xl
- Owner: tizz98
- License: mit
- Created: 2017-03-04T18:29:23.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T22:07:59.000Z (almost 8 years ago)
- Last Synced: 2024-11-06T15:57:18.610Z (3 months ago)
- Topics: excel, excel-formula-generator, formula, generator, python
- Language: Python
- Size: 12.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# xl
Create Excel formulas in python. The way some of the objects work was highly inspired
by Django's `Q` and `F` objects.# Examples
_All examples in `examples/` folder_### Basic
```python
from xl import *print(IF(Cell('a', 2) > Cell('a', 1), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2).gte(Cell('a', 1)), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2) == Cell('a', 1), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2) != Cell('a', 1), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2) < Cell('a', 1), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2).lte(Cell('a', 1)), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2) & Cell('a', 1), Cell('a', 3), Cell('a', 5)))
print(IF(Cell('a', 2) | Cell('a', 1), Cell('a', 3), Cell('a', 5)))print(Cell('a', 2) + Cell('a', 3))
print(Cell('a', 2) - Cell('a', 3))
print(Cell('a', 2) * Cell('a', 3))
print(Cell('a', 2) / Cell('a', 3))print(IFS(
Cell('a', 2, 'Sheet1') > Cell('a', 1, 'Sheet2'), Cell('a', 3),
Cell('a', 2) == Cell('a', 1), Cell('a', 5)
))print(IFERROR(Cell('a', 2) / Cell('a', 4), 0))
print(IF(
Cell('a', 2),
IF(Cell('a', 3) > Cell('b', 3), Cell('c', 3), Cell('d', 3)),
Cell('e', 3)
))print(SUM(Range(Cell('c', sheet='Sheet1'), Cell('c'))))
```