Urgent.News

What's breaking now, across thousands of outlets.

Tech

Write a Python function once, call it from anywhere

Every notebook or script I start begins the same way: copy-pasting the same helper functions from the last one. A Sharpe ratio here, a position-size calculator there, a small risk model… and when I fix a bug in one place, the other five copies still have the old version. So I built Fintech Hub : a free online library for your own Python functions. You write a function once, and call it by name…

Creating reusable Python functions can be a hassle when you have to copy-paste them across different notebooks and scripts. The Fintech Hub is a free online library that allows you to write a function once and call it by name from anywhere, be it Jupyter, Google Colab, VS Code, a plain script, or your own server. To use Fintech Hub, simply write your function in the online editor, test it, and then press "Go Live" to make it accessible.

Once published, you can call the function from any Python code by its name. For example, a sharpe_ratio function can be used everywhere with just a single import statement and subsequent call. Any bug fix you make on the Fintech Hub site will automatically update all your notebooks and scripts, as the function is live and gets updated in real-time.

Classes work as well and can be organized into folders for easy access. Any package you have installed on your system can also be used within Fintech Hub, such as using the yfinance package to fetch the last closing price of a stock. By default, functions are private, but you can choose to make them live and accessible with your unique key.

Other users cannot see or use your functions unless you share your key, which can be regenerated if needed. The Fintech Hub is free to use, with a client available on PyPI through pip install fintech-hub. Share your feedback on what functions you would include in your own library.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Monday 28 September →