News for hackers. Stuff that matters.
Re:Show HN: A simple lazy Python calculation engine, with sp... by bsdz on Thursday July 08, 2021 @01:54AM (#27768827)
This is something I built a little while ago. It's a proof-of-concept and inspired by what I was doing in my day job.

To play with the demo spreadsheet you'll need to clone the repo and run the demo script, ie:

  git clone [email protected]:bsdz/calcengine.git
  cd calcengine
  python3 -mvenv --prompt calceng .venv
  . ./.venv/bin/activate
  poetry install -E demo
  python demo/spreadsheet/main.py
There's an inline gif showing the spreadsheet in use.

Hope it's interesting :)

Re:Show HN: A simple lazy Python calculation engine, with sp... by maleldil on Thursday July 08, 2021 @11:21AM (#27773122)
Why create a venv and then run poetry install? Poetry already manages virtual environments.
Re:Show HN: A simple lazy Python calculation engine, with sp... by bsdz on Thursday July 08, 2021 @07:17PM (#27778779)
True. Just an old habit.
Re:Show HN: A simple lazy Python calculation engine, with sp... by doovd on Thursday July 08, 2021 @04:39AM (#27769566)
This is a core principle in a lot of the dependency-graph-based frameworks seen in banks (secdb, Athena, quartz) etc. Inspired by those?
Re:Show HN: A simple lazy Python calculation engine, with sp... by bsdz on Thursday July 08, 2021 @04:53AM (#27769625)
Indeed. Actually with-in the demo samples folder you can find a simple QuantLib example (quantlib.json). Although you'll need to install the QuantLib package separately as I didn't include it in the dependencies.
Re:Show HN: A simple lazy Python calculation engine, with sp... by timkpaine on Thursday July 08, 2021 @05:21AM (#27769786)
Re:Show HN: A simple lazy Python calculation engine, with sp... by bsdz on Thursday July 08, 2021 @07:47AM (#27770709)
Yes I am. Thanks for sharing.
Re:Show HN: A simple lazy Python calculation engine, with sp... by wirthjason on Thursday July 08, 2021 @11:29AM (#27773236)
The Dag/graph is one of the best parts of those tool chains. That is one library I wish had a good open source equivalent. Partly because it would be nice to use in any project / environment, but also because there would be a lot more documentation and examples. Take Pandas for example, if it stayed internal then it wouldn’t be the powerhouse that it is today.

Most dependency graph examples are based around calculations but it’s a versatile pattern and not limited to just math. I find the JS community has really taken hold of the dependency tracking and “reactive framework” idea to build UIs.

Re:Show HN: A simple lazy Python calculation engine, with sp... by phkahler on Thursday July 08, 2021 @01:34PM (#27775271)
Why QT and not tkinter?
Re:Show HN: A simple lazy Python calculation engine, with sp... by bsdz on Thursday July 08, 2021 @07:19PM (#27778790)
No reason in particular. Qt has some easy to use widgets and is well documented. I've also some experience with Qt.