Dash & XLwings. Attempting to pre-load Excel before Dash callback to save load time.
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- HTML
- Estrelas
- 758
- Forks
- 1.6k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/datasets
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
-
Connecticut issueAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 25/100
Todas as issues de plotly/datasets
Issues semelhantes
-
area:harness enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
evarness-ai/iris-harness#420 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
datamodel-code-generator/datamodel-code-generator#6136 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
PrestaShopCorp/ps_eventbus#505 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
The-PR-Agent/pr-agent#4644 · 1 comentário ·
Mantenedores costumam responder em até 1 dia