A collection of tools, boilerplates, scripts, and functions often used in our Token Engineering and Software Engineering tasks.
Longtail Financial Token Engineering tools.
Usage:
importtokenengi.ltfteorfromtokenengiimportltfte[ NEED ASSISTANCE UPDATING THIS SECTION. ]
Longtail Financial Software Engineering tools.
ltfswe can be imported by the following lines.
importtokenengi.ltsweorfromtokenengiimportltfswetogglize - A decorator for Panel widget functions that gives you a toggle button to hide/unhide the widget. The decorator is able to accept two optional parameters — the button label (string), and the button color (string). By default, the default button label is "Hide / Unhide Widget" and the default button color is green.
Currently it supports three colors: red, green, and blue.
Usage:
importpanelaspnpn.extension()
fromtokenengi.ltfsweimporttogglize@togglize("Hide/Unhide Blue Square", "blue")defsome_panel_widget():
returnpn.pane.PNG('blue_square.png')clamp - A function that binds an int or float to a minimum or maximum value.
For example, if we clamped an int x to [0, 1000] and gave it a value of 1002, the int will remain at 1000. Inversely, if we assigned -2 to x, then x remains at 0.
Usage:
fromtokenengi.ltfsweimportclampx=1001clamp(x, 0, 1000)
print(x)
# X will be 1000.