ExcelAddin
Represents an Excel add-in deployment on Datatailr.
An Excel add-in exposes Python functions as Excel worksheet functions, allowing users to call server-side computations directly from Excel spreadsheets.
Example
from datatailr import ExcelAddin
def price_option(spot, strike, vol, rate, expiry):
# Black-Scholes pricing logic
...
addin = ExcelAddin(
name="Options Pricer",
entrypoint=price_option,
python_requirements="numpy,scipy",
)
addin.run()
__init__(name, entrypoint, environment=Environment.DEV, image=None, run_as=None, resources=Resources(), acl=None, python_version='3.12', python_requirements='', build_script_pre='', build_script_post='', env_vars={}, update_existing=False)
Initialize an Excel add-in deployment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Display name for the add-in. |
required |
entrypoint
|
Callable
|
The callable (function) to expose as an Excel function. |
required |
environment
|
Optional[Environment]
|
Target environment for the deployment. |
DEV
|
image
|
Optional[Image]
|
Pre-configured container Image. |
None
|
run_as
|
Optional[Union[str, User]]
|
User or username to run the add-in as. |
None
|
resources
|
Resources
|
CPU and memory resources for the container. |
Resources()
|
acl
|
Optional[ACL]
|
Access control list. |
None
|
python_version
|
str
|
Python version for the container image. |
'3.12'
|
python_requirements
|
str | List[str]
|
Python dependencies (see |
''
|
build_script_pre
|
str
|
Dockerfile commands to run before installing requirements. |
''
|
build_script_post
|
str
|
Dockerfile commands to run after installing requirements. |
''
|
env_vars
|
Dict[str, str | int | float | bool]
|
Environment variables passed to the running container. |
{}
|
update_existing
|
bool
|
If |
False
|