Dash & XLwings. Attempting to pre-load Excel before Dash callback to save load time.
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
Línea de trabajo
The issue names the Dash finalFxn callback and its xlwings App setup, but no repository file or test. Start by tracing the callback registration and per-client Excel connection behavior described in the example. Done means establishing whether the requested preload and callback lifecycle can be supported without converting the workbook or VBA.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Windows 10 Enterprise for local. Windows Server 2022 Standard for the server
3.10 Python, Microsoft 365 Apps for enterprise, 0.28.7 xlwings
I have a web interface project that is using a connection between XLwings and Dash. The Excel file is large and takes about 15 seconds to load, while the calc only takes 5 seconds. Since it is setup to run over the web, each client will have their own instance of Excel. XLwings has a way to handle this.
Currently the setup is that once the user enters their setup and clicks submit, only then does the connection start.
If this was normal python, I could just start the connection earlier. However, with Dash the only connection between the layout, and the function definition is the Dash callback.
The goal is to load the Excel file as soon as the page is loaded, while that is happening the user would enter their parameters, the time that takes to load would be saved and the result return time would be shortened by that time.
*
I would like to use a chained callback. The first callback would load on page load with the xlWings connection. 'prevent_initial_call' would be false.
The final callback I have setup the 'prevent_initial_call' to True because I don't want this to run until they hit submit.
*
If I setup the connection as a variable or function, it doesn't look like you can pass these through the callback in anyway.
Project requirements are that the Excel and its VBA not be converted to Python/Dash.
Possible to launch one, or a few, Excels' on launch, and have XLwings grab the PID somehow? Would another Excel extension handle this? I know we're not supposed to use 'Global' variables, but that might fit this particular need.
Above this code part is the layout setup for Dash
@callback(
#many Output and Inputs. Removed most for clarity.
Output(component_id='table', component_property='data'),
Input(component_id='yearSlider', component_property='value'),
)
def finalFxn(
#many parameters. Removed most for clarity.
parameter1,
parameter2
):
with xw.App(visible=True) as app:
wb = app.books.open(r"C:\Users\mike\Downloads\modified3-31.xlsm")
#logic
# excel cells = parameters from web
#logic
# parameters to web = excel
return results, graph, etc.
- Lenguaje dominante
- HTML
- Estrellas
- 758
- Forks
- 1.6k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de plotly/datasets
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
-
Connecticut issueAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
Todos los issues de plotly/datasets
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
micronaut-projects/micronaut-redis#844 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/onnxscript#3155 ·
Los mantenedores suelen responder en 4 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anomalyco/opencode#61640 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kubecost/ibm-finops-agent#289 ·
Los mantenedores suelen responder en 2 días