Skip to content

Releases: TexteaInc/funix

Funix 0.6.1

15 May 08:08
Compare
Choose a tag to compare

0.6.1 (2025-05-15)

Highlights

  • A new examples syntax is available, where you can combine different arguments, like below:

    @funix(
        examples=[
            {"doc": "Fire", "sum": "Water"},
            {"doc": "Fire", "sum": "Fox"},
            {"sum": "Wood"},
            {"doc": "Golden", "sum": "Silver"},
            {"doc": "Day", "sum": "Night"},
        ]
    )
    def example_function(
        doc: str,
        sum: str,
    ) -> str:
        pass

    When user input Fire in the doc field, the sum field examples will be filtered to Water and Fox.

  • The front-end has been improved a little so that the left-hand list is not expanded under a single function.

  • The theme options funix.autorun_label, funix.run_button, funix.grid_height and funix.grid_checkbox are added.

    • funix.autorun_label is used to customize the autorun checkbox label, string.
    • funix.run_button is used to customize the run button text, string.
    • funix.grid_height is used to customize the DataGrid height, number.
    • funix.grid_checkbox is used to customize the DataGrid selection checkbox display or not, boolean.

Bug Fixes

Features

Funix 0.6.0

02 May 07:56
284ac2c
Compare
Choose a tag to compare

0.6.0 (2025-05-02)

Highlights

  • URLs and iframe codes can be copied from the Funix App interface, making it easier to share or embed.

  • The logging system, when enabled, can now record the user's IP address, the name of the function called, the server file accessed, and other information.

  • Now the sidebar functions have icons and are sorted by the order of definition.

  • Support just_run argument for @funix, you don't need to click run button, the Funix App will run the function automatically when you enter the function's page.

  • Header and footer strings can now be modified through the theme, and simple string templates are supported. The icons at the footer can be hidden at any time, and the function name can also be displayed in the input panel. Here is an example:

     from funix import import_theme, funix
     
     
     import_theme({
         "name": "example",
         "funix": {
             "header": "Example - {{functionName}}",
             "footer": "©️ {{year}} Example, Funix: {{funixLink}}",
         }
     })
     
     @funix(theme="example")
     def my_function():
         pass
  • Function jumping is supported, a funix decorated function can use typing.Callable to jump to another funix decorated function, examples are shown below:

     from typing import Callable
     
     
     def test_function(x: int, y: int) -> int:
         return x + y
     
     
     def normal_jump() -> Callable:
         return test_function

    If you want to jump with arguments, you can do like this:

     from typing import Callable
     
     
     def test_function(x: int, y: int) -> int:
         return x + y
     
     
     def args_jump() -> Callable:
         x = 1
         return lambda _: test_function(2, y=x)
  • You can use funix.generate_redirect_link to generate a <a> tag that can redirect to a funix function. Syntax: funix.generate_redirect_link(function_name, args, kwargs).

  • Support dynamic_defaults argument for @funix, you can use dynamic_defaults to generate default values for function arguments. For example:

     from funix import funix
     
     def get_x():
         return 1
     
     @funix(dynamic_defaults={
         "x": get_x
     })
     def my_function(x: int):
         return x

    Or you can use this with session class, use lambda self: ... to get the session object:

     from funix import funix_method
     
     class A:
         def __init__(self, x: int):
             self.x = x
         
         def get_x(self):
             return self.x
         
         @funix_method(
             dynamic_defaults={
                 "x": lambda self: self.get_x()
             }
         )
         def calc(self, x: int, y: int):
             return self.x + x
  • Auto read first line in function's __doc__ as title (Disabled by default, use GlobalSwitchOption.DOCSTRING_FIRST_LINE_TO_TITLE to turn it on).

  • Allow expression in whitelist, dynamic_defaults and example

Breaking Changes

There are major differences between the previous version and this version, so please be aware that some issues and features may break past code.

Bug Fixes

Features

Refactors

Chores

Reverts

Funix 0.5.9

29 Jul 00:09
Compare
Choose a tag to compare

0.5.9 (2024-07-29)

Highlights

  • Funix now parses the docstring of your function as a description of the app and its arguments.
  • Initial support for jupyter through a simple iframe.
  • It is now possible to use the List[Literal[...]] type to create dropdown menus.
  • The whitelist and example can be dynamically updated by functions.

Bug Fixes

Features

Refactors

Documents

Funix 0.5.8

17 May 13:36
Compare
Choose a tag to compare

0.5.8 (2024-05-17)

Highlights

This release brings some fixes and documentation changes:

  • Important Fixes: Form Height, CORS Requests, Secret Authentication
  • Now for dependencies, matplotlib, mpld3, pandera and pandas become mandatory.

Bug Fixes

Documents

Chores

Funix 0.5.7

27 Apr 10:30
94cc179
Compare
Choose a tag to compare

There are no feature updates or logic fixes compared to Funix 0.5.6. Only dependencies have been fixed.

Funix 0.5.6

21 Apr 08:58
Compare
Choose a tag to compare

0.5.6 (2024-04-21)

Highlights

  • You can now dynamically fetch variable as description from session, use session_description argument, fill your variable name in session
  • Provide a new boolean parameter: keep_last, whose function is to keep the last inputs and outputs of the session in the function page when it is opened again
  • Funix app that do not have a default function will now use one of the functions used in the list as the default function
  • Outdated hints will now be displayed when previewing historical functions

Bug Fixes

Features

Documentations

Funix 0.5.5

28 Feb 11:36
Compare
Choose a tag to compare

0.5.5 (2024-02-28)

Highlights

  • Initial implementation of autorun allows the frontend to automatically re-run the function as parameters are changed, you can use autorun=True in the decorator to enable this feature
  • Once again, any function or class will be decorated with funix or funix_class (default lazy is back again), which you can turn off with @funix(disable=True)
  • Now allowed to generate static images directly from the Figure type (if mpld3 doesn't work for you) by using figure_to_image=True in the parameter of the decorator
  • IPython.display.Javascript is now supported
  • You can now customize widgets with widgets and props in the widgets and theme
    theme = {
        "widgets": {
            "YOUR_WIDGET_NAME": {
                "widget": "WidgetComponent, e.g. '@mui/material/TextField'",
                "props": {
                    # props for the widget
                    "type": "password"
                }
            }
        }
    }
  • The privacy message can now be updated with funix.app.privacy_policy function

Bug Fixes

Features

Documentation

Refactors

Funix 0.5.4

23 Dec 02:07
Compare
Choose a tag to compare

0.5.4 (2023-12-23)

Highlights

  • Fixed issue where external scripts could not be loaded due to security checks in DOM updates
  • For users using @funix_class, the AST is now used to parse the source code
  • docstring is now used as a function description
  • HTML code now allows developers to embed JavaScript
  • Improved error message when limiter limit is exceeded and class is not initialized
  • Added reactive parameter to help update/calculate parameters in real time
  • For parameters such as label, the *, glob or regex are now supported
  • Camera (picture or video) and microphone inputs are supported on the front end

Bug Fixes

Features

Documents

Funix 0.5.3

28 Nov 15:28
Compare
Choose a tag to compare

0.5.3 (2023-11-28)

Highlights

  • Support class with funix, you can use funix.funix_class and funix.funix_method for class and class's method
  • Support generator function with websocket, and you can use yield to send message to frontend
  • For websocket, we add print_to_web option in decorator for printing message to frontend directly by print function
  • Normal pandas type is now supported
  • Now funix can run offline
  • The memory leak of web histories is fixed, and for any input with file, the history will be disabled

Bug Fixes

Features

Documents

Chores

Funix 0.5.2.1

01 Nov 08:20
Compare
Choose a tag to compare

The following changes have been made in this version relative to 0.5.2:

  • rollback of code that failed to run properly due to a merge error
  • automatic recursive mode

You can read here to see the changes in 0.5.2, but the release at PyPI has been removed.