querychat 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. querychat-0.2.0/.gitignore +262 -0
  2. querychat-0.2.0/PKG-INFO +71 -0
  3. querychat-0.2.0/pkg-py/README.md +20 -0
  4. querychat-0.2.0/pkg-py/src/querychat/__init__.py +13 -0
  5. querychat-0.2.0/pkg-py/src/querychat/_utils.py +48 -0
  6. querychat-0.2.0/pkg-py/src/querychat/datasource.py +363 -0
  7. {querychat-0.1.0 → querychat-0.2.0/pkg-py}/src/querychat/prompt/prompt.md +14 -2
  8. querychat-0.2.0/pkg-py/src/querychat/querychat.py +664 -0
  9. querychat-0.2.0/pkg-py/src/querychat/static/css/styles.css +15 -0
  10. querychat-0.2.0/pyproject.toml +204 -0
  11. querychat-0.1.0/.gitignore +0 -4
  12. querychat-0.1.0/PKG-INFO +0 -165
  13. querychat-0.1.0/README.md +0 -118
  14. querychat-0.1.0/pyproject.toml +0 -48
  15. querychat-0.1.0/src/querychat/__about__.py +0 -0
  16. querychat-0.1.0/src/querychat/__init__.py +0 -3
  17. querychat-0.1.0/src/querychat/querychat.py +0 -467
  18. querychat-0.1.0/src/querychat/static/css/styles.css +0 -93
  19. querychat-0.1.0/venv/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE +0 -21
  20. querychat-0.1.0/venv/lib/python3.12/site-packages/anyio-4.9.0.dist-info/LICENSE +0 -20
  21. querychat-0.1.0/venv/lib/python3.12/site-packages/anywidget-0.9.18.dist-info/licenses/LICENSE +0 -21
  22. querychat-0.1.0/venv/lib/python3.12/site-packages/asgiref-3.8.1.dist-info/LICENSE +0 -27
  23. querychat-0.1.0/venv/lib/python3.12/site-packages/asttokens-3.0.0.dist-info/LICENSE +0 -201
  24. querychat-0.1.0/venv/lib/python3.12/site-packages/certifi-2025.4.26.dist-info/licenses/LICENSE +0 -20
  25. querychat-0.1.0/venv/lib/python3.12/site-packages/charset_normalizer-3.4.2.dist-info/licenses/LICENSE +0 -21
  26. querychat-0.1.0/venv/lib/python3.12/site-packages/chatlas-0.7.1.dist-info/licenses/LICENSE +0 -21
  27. querychat-0.1.0/venv/lib/python3.12/site-packages/comm-0.2.2.dist-info/licenses/LICENSE +0 -29
  28. querychat-0.1.0/venv/lib/python3.12/site-packages/distro-1.9.0.dist-info/LICENSE +0 -202
  29. querychat-0.1.0/venv/lib/python3.12/site-packages/duckdb/experimental/spark/LICENSE +0 -260
  30. querychat-0.1.0/venv/lib/python3.12/site-packages/htmltools-0.6.0.dist-info/LICENSE +0 -21
  31. querychat-0.1.0/venv/lib/python3.12/site-packages/ipython-9.2.0.dist-info/licenses/LICENSE +0 -33
  32. querychat-0.1.0/venv/lib/python3.12/site-packages/ipython_pygments_lexers-1.1.1.dist-info/LICENSE +0 -30
  33. querychat-0.1.0/venv/lib/python3.12/site-packages/ipywidgets-8.1.7.dist-info/licenses/LICENSE +0 -27
  34. querychat-0.1.0/venv/lib/python3.12/site-packages/jedi/third_party/typeshed/LICENSE +0 -238
  35. querychat-0.1.0/venv/lib/python3.12/site-packages/jupyter_core-5.7.2.dist-info/licenses/LICENSE +0 -30
  36. querychat-0.1.0/venv/lib/python3.12/site-packages/jupyterlab_widgets-3.0.15.dist-info/licenses/LICENSE +0 -292
  37. querychat-0.1.0/venv/lib/python3.12/site-packages/linkify_it_py-2.0.3.dist-info/LICENSE +0 -48
  38. querychat-0.1.0/venv/lib/python3.12/site-packages/markdown_it_py-3.0.0.dist-info/LICENSE +0 -21
  39. querychat-0.1.0/venv/lib/python3.12/site-packages/matplotlib_inline-0.1.7.dist-info/LICENSE +0 -29
  40. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/admon/LICENSE +0 -24
  41. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/container/LICENSE +0 -22
  42. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/container/README.md +0 -95
  43. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/deflist/LICENSE +0 -22
  44. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/deflist/README.md +0 -38
  45. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/footnote/LICENSE +0 -22
  46. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/front_matter/LICENSE +0 -22
  47. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/texmath/LICENSE +0 -21
  48. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins/texmath/README.md +0 -137
  49. querychat-0.1.0/venv/lib/python3.12/site-packages/mdit_py_plugins-0.4.2.dist-info/LICENSE +0 -21
  50. querychat-0.1.0/venv/lib/python3.12/site-packages/mdurl-0.1.2.dist-info/LICENSE +0 -46
  51. querychat-0.1.0/venv/lib/python3.12/site-packages/numpy/ma/LICENSE +0 -24
  52. querychat-0.1.0/venv/lib/python3.12/site-packages/openai-1.82.0.dist-info/licenses/LICENSE +0 -201
  53. querychat-0.1.0/venv/lib/python3.12/site-packages/packaging-25.0.dist-info/licenses/LICENSE +0 -3
  54. querychat-0.1.0/venv/lib/python3.12/site-packages/pandas-2.2.3.dist-info/LICENSE +0 -1250
  55. querychat-0.1.0/venv/lib/python3.12/site-packages/pexpect-4.9.0.dist-info/LICENSE +0 -20
  56. querychat-0.1.0/venv/lib/python3.12/site-packages/platformdirs-4.3.8.dist-info/licenses/LICENSE +0 -21
  57. querychat-0.1.0/venv/lib/python3.12/site-packages/prompt_toolkit-3.0.51.dist-info/licenses/LICENSE +0 -27
  58. querychat-0.1.0/venv/lib/python3.12/site-packages/psygnal-0.13.0.dist-info/licenses/LICENSE +0 -26
  59. querychat-0.1.0/venv/lib/python3.12/site-packages/ptyprocess-0.7.0.dist-info/LICENSE +0 -16
  60. querychat-0.1.0/venv/lib/python3.12/site-packages/pydantic-2.11.5.dist-info/licenses/LICENSE +0 -21
  61. querychat-0.1.0/venv/lib/python3.12/site-packages/pydantic_core-2.33.2.dist-info/licenses/LICENSE +0 -21
  62. querychat-0.1.0/venv/lib/python3.12/site-packages/pygments-2.19.1.dist-info/licenses/LICENSE +0 -25
  63. querychat-0.1.0/venv/lib/python3.12/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE +0 -54
  64. querychat-0.1.0/venv/lib/python3.12/site-packages/questionary-2.1.0.dist-info/LICENSE +0 -19
  65. querychat-0.1.0/venv/lib/python3.12/site-packages/requests-2.32.3.dist-info/LICENSE +0 -175
  66. querychat-0.1.0/venv/lib/python3.12/site-packages/rich-14.0.0.dist-info/LICENSE +0 -19
  67. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/LICENSE +0 -166
  68. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/LICENSE +0 -17
  69. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/importlib_metadata-8.0.0.dist-info/LICENSE +0 -202
  70. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/inflect-7.3.1.dist-info/LICENSE +0 -17
  71. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.collections-5.1.0.dist-info/LICENSE +0 -17
  72. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.context-5.3.0.dist-info/LICENSE +0 -17
  73. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/LICENSE +0 -17
  74. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/LICENSE +0 -17
  75. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/LICENSE +0 -19
  76. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/packaging-24.2.dist-info/LICENSE +0 -3
  77. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/platformdirs-4.2.2.dist-info/licenses/LICENSE +0 -21
  78. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/LICENSE +0 -21
  79. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/LICENSE +0 -19
  80. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/typing_extensions-4.12.2.dist-info/LICENSE +0 -279
  81. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/wheel/vendored/packaging/LICENSE +0 -3
  82. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools/_vendor/zipp-3.19.2.dist-info/LICENSE +0 -17
  83. querychat-0.1.0/venv/lib/python3.12/site-packages/setuptools-80.8.0.dist-info/licenses/LICENSE +0 -17
  84. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/bookmark/README.md +0 -582
  85. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/templates/app/04-dashboard-tips/README.md +0 -1
  86. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/templates/package/js-input/README.md +0 -63
  87. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/templates/package/js-output/README.md +0 -63
  88. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/templates/package/js-react/README.md +0 -63
  89. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/www/shared/busy-indicators/spinners/LICENSE +0 -20
  90. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny/www/shared/highlight/LICENSE +0 -24
  91. querychat-0.1.0/venv/lib/python3.12/site-packages/shiny-1.4.0.dist-info/licenses/LICENSE +0 -21
  92. querychat-0.1.0/venv/lib/python3.12/site-packages/shinywidgets-0.6.2.dist-info/licenses/LICENSE +0 -22
  93. querychat-0.1.0/venv/lib/python3.12/site-packages/six-1.17.0.dist-info/LICENSE +0 -18
  94. querychat-0.1.0/venv/lib/python3.12/site-packages/sniffio-1.3.1.dist-info/LICENSE +0 -3
  95. querychat-0.1.0/venv/lib/python3.12/site-packages/traitlets-5.14.3.dist-info/licenses/LICENSE +0 -30
  96. querychat-0.1.0/venv/lib/python3.12/site-packages/typing_extensions-4.13.2.dist-info/licenses/LICENSE +0 -279
  97. querychat-0.1.0/venv/lib/python3.12/site-packages/typing_inspection-0.4.1.dist-info/licenses/LICENSE +0 -21
  98. querychat-0.1.0/venv/lib/python3.12/site-packages/tzdata-2025.2.dist-info/licenses/LICENSE +0 -15
  99. querychat-0.1.0/venv/lib/python3.12/site-packages/uc_micro_py-1.0.3.dist-info/LICENSE +0 -46
  100. querychat-0.1.0/venv/lib/python3.12/site-packages/watchfiles-1.0.5.dist-info/licenses/LICENSE +0 -21
  101. querychat-0.1.0/venv/lib/python3.12/site-packages/wcwidth-0.2.13.dist-info/LICENSE +0 -27
  102. querychat-0.1.0/venv/lib/python3.12/site-packages/websockets-15.0.1.dist-info/LICENSE +0 -24
  103. querychat-0.1.0/venv/lib/python3.12/site-packages/widgetsnbextension-4.0.14.dist-info/licenses/LICENSE +0 -27
  104. /querychat-0.1.0/LICENSE → /querychat-0.2.0/LICENSE.md +0 -0
  105. {querychat-0.1.0/venv/lib/python3.12/site-packages/querychat-0.1.0.dist-info/licenses → querychat-0.2.0/pkg-py}/LICENSE +0 -0
@@ -0,0 +1,262 @@
1
+ __pycache__/
2
+ animation.screenflow/
3
+ README_files/
4
+ README.html
5
+ .DS_Store
6
+ python-package/examples/titanic.db
7
+ .quarto
8
+ *.db
9
+
10
+ docs/r
11
+ docs/py
12
+
13
+ !pkg-py/docs
14
+
15
+ # Byte-compiled / optimized / DLL files
16
+ __pycache__/
17
+ *.py[cod]
18
+ *$py.class
19
+
20
+ # C extensions
21
+ *.so
22
+
23
+ # Distribution / packaging
24
+ .Python
25
+ build/
26
+ develop-eggs/
27
+ dist/
28
+ downloads/
29
+ eggs/
30
+ .eggs/
31
+ lib/
32
+ lib64/
33
+ parts/
34
+ sdist/
35
+ var/
36
+ wheels/
37
+ share/python-wheels/
38
+ *.egg-info/
39
+ .installed.cfg
40
+ *.egg
41
+ MANIFEST
42
+
43
+ # PyInstaller
44
+ # Usually these files are written by a python script from a template
45
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
46
+ *.manifest
47
+ *.spec
48
+
49
+ # Installer logs
50
+ pip-log.txt
51
+ pip-delete-this-directory.txt
52
+
53
+ # Unit test / coverage reports
54
+ htmlcov/
55
+ .tox/
56
+ .nox/
57
+ .coverage
58
+ .coverage.*
59
+ .cache
60
+ nosetests.xml
61
+ coverage.xml
62
+ *.cover
63
+ *.py,cover
64
+ .hypothesis/
65
+ .pytest_cache/
66
+ cover/
67
+
68
+ # Translations
69
+ *.mo
70
+ *.pot
71
+
72
+ # Django stuff:
73
+ *.log
74
+ local_settings.py
75
+ db.sqlite3
76
+ db.sqlite3-journal
77
+
78
+ # Flask stuff:
79
+ instance/
80
+ .webassets-cache
81
+
82
+ # Scrapy stuff:
83
+ .scrapy
84
+
85
+ # Sphinx documentation
86
+ docs/_build/
87
+
88
+ # PyBuilder
89
+ .pybuilder/
90
+ target/
91
+
92
+ # Jupyter Notebook
93
+ .ipynb_checkpoints
94
+
95
+ # IPython
96
+ profile_default/
97
+ ipython_config.py
98
+
99
+ # pyenv
100
+ # For a library or package, you might want to ignore these files since the code is
101
+ # intended to run in multiple environments; otherwise, check them in:
102
+ # .python-version
103
+
104
+ # pipenv
105
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
106
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
107
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
108
+ # install all needed dependencies.
109
+ #Pipfile.lock
110
+
111
+ # UV
112
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ #uv.lock
116
+
117
+ # poetry
118
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
119
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
120
+ # commonly ignored for libraries.
121
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
122
+ #poetry.lock
123
+
124
+ # pdm
125
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
126
+ #pdm.lock
127
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
128
+ # in version control.
129
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
130
+ .pdm.toml
131
+ .pdm-python
132
+ .pdm-build/
133
+
134
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
135
+ __pypackages__/
136
+
137
+ # Celery stuff
138
+ celerybeat-schedule
139
+ celerybeat.pid
140
+
141
+ # SageMath parsed files
142
+ *.sage.py
143
+
144
+ # Environments
145
+ .env
146
+ .venv
147
+ env/
148
+ venv/
149
+ ENV/
150
+ env.bak/
151
+ venv.bak/
152
+
153
+ # Spyder project settings
154
+ .spyderproject
155
+ .spyproject
156
+
157
+ # Rope project settings
158
+ .ropeproject
159
+
160
+ # mkdocs documentation
161
+ /site
162
+
163
+ # mypy
164
+ .mypy_cache/
165
+ .dmypy.json
166
+ dmypy.json
167
+
168
+ # Pyre type checker
169
+ .pyre/
170
+
171
+ # pytype static type analyzer
172
+ .pytype/
173
+
174
+ # Cython debug symbols
175
+ cython_debug/
176
+
177
+ # PyCharm
178
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
179
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
180
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
181
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
182
+ #.idea/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the enitre vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # History files
205
+ .Rhistory
206
+ .Rapp.history
207
+
208
+ # Session Data files
209
+ .RData
210
+ .RDataTmp
211
+
212
+ # User-specific files
213
+ .Ruserdata
214
+
215
+ # Example code in package build process
216
+ *-Ex.R
217
+
218
+ # Output files from R CMD build
219
+ /*.tar.gz
220
+
221
+ # Output files from R CMD check
222
+ /*.Rcheck/
223
+
224
+ # RStudio files
225
+ .Rproj.user/
226
+
227
+ # produced vignettes
228
+ vignettes/*.html
229
+ vignettes/*.pdf
230
+
231
+ # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
232
+ .httr-oauth
233
+
234
+ # knitr and R markdown default cache directories
235
+ *_cache/
236
+ /cache/
237
+
238
+ # Temporary files created by R markdown
239
+ *.utf8.md
240
+ *.knit.md
241
+
242
+ # R Environment Variables
243
+ .Renviron
244
+
245
+ # pkgdown site
246
+ #docs/
247
+
248
+ # translation temp files
249
+ po/*~
250
+
251
+ # RStudio Connect folder
252
+ rsconnect/
253
+ python-package/CLAUDE.md
254
+
255
+ uv.lock
256
+ _dev
257
+
258
+ # R ignores
259
+ /.quarto/
260
+ .Rprofile
261
+ renv/
262
+ renv.lock
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: querychat
3
+ Version: 0.2.0
4
+ Summary: Chat with your data using natural language
5
+ Project-URL: Homepage, https://github.com/posit-dev/querychat
6
+ Project-URL: Repository, https://github.com/posit-dev/querychat
7
+ Project-URL: Issues, https://github.com/posit-dev/querychat/issues
8
+ Project-URL: Source, https://github.com/posit-dev/querychat/tree/main/pkg-py
9
+ Author-email: Joe Cheng <joe@posit.co>, Garrick Aden-Buie <garrick@posit.co>, Dan Chen <daniel.chen@posit.co>, Barret Schloerke <barret@posit.co>
10
+ Maintainer-email: Garrick Aden-Buie <garrick@posit.co>
11
+ License: # MIT License
12
+
13
+ Copyright (c) 2025 Posit Software, PBC
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ License-File: LICENSE.md
33
+ Classifier: Programming Language :: Python
34
+ Classifier: Programming Language :: Python :: 3.8
35
+ Classifier: Programming Language :: Python :: 3.9
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
+ Requires-Python: >=3.9
41
+ Requires-Dist: chatlas
42
+ Requires-Dist: chevron
43
+ Requires-Dist: duckdb
44
+ Requires-Dist: htmltools
45
+ Requires-Dist: narwhals
46
+ Requires-Dist: pandas
47
+ Requires-Dist: shiny
48
+ Requires-Dist: shinywidgets
49
+ Requires-Dist: sqlalchemy>=2.0.0
50
+ Description-Content-Type: text/markdown
51
+
52
+ # querychat for Python
53
+
54
+ Please see [the package documentation site](https://posit-dev.github.io/querychat/py/index.html) for installation, setup, and usage.
55
+
56
+ If you are looking for querychat python examples,
57
+ you can find them in the `examples/` directory.
58
+
59
+ ## Installation
60
+
61
+ You can install the package from PyPI using pip:
62
+
63
+ ```bash
64
+ pip install querychat
65
+ ```
66
+
67
+ Or you can install querychat directly from GitHub:
68
+
69
+ ```bash
70
+ pip install "querychat @ git+https://github.com/posit-dev/querychat"
71
+ ```
@@ -0,0 +1,20 @@
1
+ # querychat for Python
2
+
3
+ Please see [the package documentation site](https://posit-dev.github.io/querychat/py/index.html) for installation, setup, and usage.
4
+
5
+ If you are looking for querychat python examples,
6
+ you can find them in the `examples/` directory.
7
+
8
+ ## Installation
9
+
10
+ You can install the package from PyPI using pip:
11
+
12
+ ```bash
13
+ pip install querychat
14
+ ```
15
+
16
+ Or you can install querychat directly from GitHub:
17
+
18
+ ```bash
19
+ pip install "querychat @ git+https://github.com/posit-dev/querychat"
20
+ ```
@@ -0,0 +1,13 @@
1
+ from querychat.querychat import (
2
+ init,
3
+ sidebar,
4
+ system_prompt,
5
+ )
6
+ from querychat.querychat import (
7
+ mod_server as server,
8
+ )
9
+ from querychat.querychat import (
10
+ mod_ui as ui,
11
+ )
12
+
13
+ __all__ = ["init", "server", "sidebar", "system_prompt", "ui"]
@@ -0,0 +1,48 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ from contextlib import contextmanager
5
+ from typing import Optional
6
+
7
+
8
+ @contextmanager
9
+ def temp_env_vars(env_vars: dict[str, Optional[str]]):
10
+ """
11
+ Temporarily set environment variables and restore them when exiting.
12
+
13
+ Parameters
14
+ ----------
15
+ env_vars : Dict[str, str]
16
+ Dictionary of environment variable names to values to set temporarily
17
+
18
+ Example
19
+ -------
20
+ with temp_env_vars({"FOO": "bar", "BAZ": "qux"}):
21
+ # FOO and BAZ are set to "bar" and "qux"
22
+ do_something()
23
+ # FOO and BAZ are restored to their original values (or unset if they weren't set)
24
+
25
+ """
26
+ original_values: dict[str, Optional[str]] = {}
27
+ for key in env_vars:
28
+ original_values[key] = os.environ.get(key)
29
+
30
+ for key, value in env_vars.items():
31
+ if value is None:
32
+ # If value is None, remove the variable
33
+ os.environ.pop(key, None)
34
+ else:
35
+ # Otherwise set the variable to the specified value
36
+ os.environ[key] = value
37
+
38
+ try:
39
+ yield
40
+ finally:
41
+ # Restore original values
42
+ for key, original_value in original_values.items():
43
+ if original_value is None:
44
+ # Variable wasn't set originally, so remove it
45
+ os.environ.pop(key, None)
46
+ else:
47
+ # Restore original value
48
+ os.environ[key] = original_value