duckdb 1.4.1.dev125__cp313-cp313-win_amd64.whl → 1.5.0.dev94__cp313-cp313-win_amd64.whl

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.

Potentially problematic release.


This version of duckdb might be problematic. Click here for more details.

duckdb/__init__.py CHANGED
@@ -1,123 +1,75 @@
1
- # ruff: noqa: D104, F401, E402
2
- from importlib.metadata import version
1
+ # ruff: noqa: F401
2
+ """The DuckDB Python Package.
3
3
 
4
- from _duckdb import __version__ as duckdb_version
4
+ This module re-exports the DuckDB C++ extension (`_duckdb`) and provides DuckDB's public API.
5
5
 
6
- import duckdb.functional as functional
7
- import duckdb.typing as typing
6
+ Note:
7
+ - Some symbols exposed here are implementation details of DuckDB's C++ engine.
8
+ - They are kept for backwards compatibility but are not considered stable API.
9
+ - Future versions may move them into submodules with deprecation warnings.
10
+ """
8
11
 
9
- # duckdb.__version__ returns the version of the distribution package, i.e. the pypi version
10
- __version__ = version("duckdb")
11
-
12
-
13
- # version() is a more human friendly formatted version string of both the distribution package and the bundled duckdb
14
- def version() -> str:
15
- return f"{__version__} (with duckdb {duckdb_version})"
16
-
17
-
18
- _exported_symbols = ["__version__", "version"]
19
-
20
- _exported_symbols.extend(["typing", "functional"])
21
-
22
-
23
- class DBAPITypeObject:
24
- def __init__(self, types: list[typing.DuckDBPyType]) -> None:
25
- self.types = types
26
-
27
- def __eq__(self, other: object) -> bool:
28
- if isinstance(other, typing.DuckDBPyType):
29
- return other in self.types
30
- return False
31
-
32
- def __repr__(self) -> str:
33
- return f"<DBAPITypeObject [{','.join(str(x) for x in self.types)}]>"
34
-
35
-
36
- # Define the standard DBAPI sentinels
37
- STRING = DBAPITypeObject([typing.VARCHAR])
38
- NUMBER = DBAPITypeObject(
39
- [
40
- typing.TINYINT,
41
- typing.UTINYINT,
42
- typing.SMALLINT,
43
- typing.USMALLINT,
44
- typing.INTEGER,
45
- typing.UINTEGER,
46
- typing.BIGINT,
47
- typing.UBIGINT,
48
- typing.HUGEINT,
49
- typing.UHUGEINT,
50
- typing.DuckDBPyType("BIGNUM"),
51
- typing.DuckDBPyType("DECIMAL"),
52
- typing.FLOAT,
53
- typing.DOUBLE,
54
- ]
55
- )
56
- DATETIME = DBAPITypeObject(
57
- [
58
- typing.DATE,
59
- typing.TIME,
60
- typing.TIME_TZ,
61
- typing.TIMESTAMP,
62
- typing.TIMESTAMP_TZ,
63
- typing.TIMESTAMP_NS,
64
- typing.TIMESTAMP_MS,
65
- typing.TIMESTAMP_S,
66
- ]
67
- )
68
- BINARY = DBAPITypeObject([typing.BLOB])
69
- ROWID = None
70
-
71
- # Classes
72
12
  from _duckdb import (
13
+ BinderException,
73
14
  CaseExpression,
15
+ CatalogException,
74
16
  CoalesceOperator,
75
17
  ColumnExpression,
18
+ ConnectionException,
76
19
  ConstantExpression,
20
+ ConstraintException,
21
+ ConversionException,
77
22
  CSVLineTerminator,
23
+ DatabaseError,
24
+ DataError,
78
25
  DefaultExpression,
26
+ DependencyException,
79
27
  DuckDBPyConnection,
80
28
  DuckDBPyRelation,
29
+ Error,
81
30
  ExpectedResultType,
82
31
  ExplainType,
83
32
  Expression,
33
+ FatalException,
84
34
  FunctionExpression,
35
+ HTTPException,
36
+ IntegrityError,
37
+ InternalError,
38
+ InternalException,
39
+ InterruptException,
40
+ InvalidInputException,
41
+ InvalidTypeException,
42
+ IOException,
85
43
  LambdaExpression,
44
+ NotImplementedException,
45
+ NotSupportedError,
46
+ OperationalError,
47
+ OutOfMemoryException,
48
+ OutOfRangeException,
49
+ ParserException,
50
+ PermissionException,
51
+ ProgrammingError,
86
52
  PythonExceptionHandling,
87
53
  RenderMode,
54
+ SequenceException,
55
+ SerializationException,
88
56
  SQLExpression,
89
57
  StarExpression,
90
58
  Statement,
91
59
  StatementType,
92
- )
93
-
94
- _exported_symbols.extend(
95
- [
96
- "DuckDBPyRelation",
97
- "DuckDBPyConnection",
98
- "ExplainType",
99
- "PythonExceptionHandling",
100
- "Expression",
101
- "ConstantExpression",
102
- "ColumnExpression",
103
- "DefaultExpression",
104
- "CoalesceOperator",
105
- "LambdaExpression",
106
- "StarExpression",
107
- "FunctionExpression",
108
- "CaseExpression",
109
- "SQLExpression",
110
- ]
111
- )
112
-
113
- # These are overloaded twice, we define them inside of C++ so pybind can deal with it
114
- _exported_symbols.extend(["df", "arrow"])
115
- # NOTE: this section is generated by tools/pythonpkg/scripts/generate_connection_wrapper_methods.py.
116
- # Do not edit this section manually, your changes will be overwritten!
117
- # START OF CONNECTION WRAPPER
118
- from _duckdb import (
60
+ SyntaxException,
61
+ TransactionException,
62
+ TypeMismatchException,
63
+ Warning,
64
+ __formatted_python_version__,
65
+ __git_revision__,
66
+ __interactive__,
67
+ __jupyter__,
68
+ __standard_vector_size__,
69
+ _clean_default_connection,
119
70
  aggregate,
120
71
  alias,
72
+ apilevel,
121
73
  append,
122
74
  array_type,
123
75
  arrow,
@@ -125,9 +77,11 @@ from _duckdb import (
125
77
  checkpoint,
126
78
  close,
127
79
  commit,
80
+ connect,
128
81
  create_function,
129
82
  cursor,
130
83
  decimal_type,
84
+ default_connection,
131
85
  description,
132
86
  df,
133
87
  distinct,
@@ -162,6 +116,7 @@ from _duckdb import (
162
116
  load_extension,
163
117
  map_type,
164
118
  order,
119
+ paramstyle,
165
120
  pl,
166
121
  project,
167
122
  query,
@@ -176,6 +131,7 @@ from _duckdb import (
176
131
  rollback,
177
132
  row_type,
178
133
  rowcount,
134
+ set_default_connection,
179
135
  sql,
180
136
  sqltype,
181
137
  string_type,
@@ -183,6 +139,9 @@ from _duckdb import (
183
139
  table,
184
140
  table_function,
185
141
  tf,
142
+ threadsafety,
143
+ token_type,
144
+ tokenize,
186
145
  torch,
187
146
  type,
188
147
  union_type,
@@ -193,220 +152,19 @@ from _duckdb import (
193
152
  write_csv,
194
153
  )
195
154
 
196
- _exported_symbols.extend(
197
- [
198
- "cursor",
199
- "register_filesystem",
200
- "unregister_filesystem",
201
- "list_filesystems",
202
- "filesystem_is_registered",
203
- "create_function",
204
- "remove_function",
205
- "sqltype",
206
- "dtype",
207
- "type",
208
- "array_type",
209
- "list_type",
210
- "union_type",
211
- "string_type",
212
- "enum_type",
213
- "decimal_type",
214
- "struct_type",
215
- "row_type",
216
- "map_type",
217
- "duplicate",
218
- "execute",
219
- "executemany",
220
- "close",
221
- "interrupt",
222
- "query_progress",
223
- "fetchone",
224
- "fetchmany",
225
- "fetchall",
226
- "fetchnumpy",
227
- "fetchdf",
228
- "fetch_df",
229
- "df",
230
- "fetch_df_chunk",
231
- "pl",
232
- "fetch_arrow_table",
233
- "arrow",
234
- "fetch_record_batch",
235
- "torch",
236
- "tf",
237
- "begin",
238
- "commit",
239
- "rollback",
240
- "checkpoint",
241
- "append",
242
- "register",
243
- "unregister",
244
- "table",
245
- "view",
246
- "values",
247
- "table_function",
248
- "read_json",
249
- "extract_statements",
250
- "sql",
251
- "query",
252
- "from_query",
253
- "read_csv",
254
- "from_csv_auto",
255
- "from_df",
256
- "from_arrow",
257
- "from_parquet",
258
- "read_parquet",
259
- "from_parquet",
260
- "read_parquet",
261
- "get_table_names",
262
- "install_extension",
263
- "load_extension",
264
- "project",
265
- "distinct",
266
- "write_csv",
267
- "aggregate",
268
- "alias",
269
- "filter",
270
- "limit",
271
- "order",
272
- "query_df",
273
- "description",
274
- "rowcount",
275
- ]
155
+ from duckdb._dbapi_type_object import (
156
+ BINARY,
157
+ DATETIME,
158
+ NUMBER,
159
+ ROWID,
160
+ STRING,
161
+ DBAPITypeObject,
276
162
  )
277
-
278
- # END OF CONNECTION WRAPPER
279
-
280
- # Enums
281
- from _duckdb import ANALYZE, COLUMNS, DEFAULT, RETURN_NULL, ROWS, STANDARD
282
-
283
- _exported_symbols.extend(["ANALYZE", "DEFAULT", "RETURN_NULL", "STANDARD"])
284
-
285
-
286
- # read-only properties
287
- from _duckdb import (
288
- __formatted_python_version__,
289
- __interactive__,
290
- __jupyter__,
291
- __standard_vector_size__,
292
- apilevel,
293
- comment,
294
- identifier,
295
- keyword,
296
- numeric_const,
297
- operator,
298
- paramstyle,
299
- string_const,
300
- threadsafety,
301
- token_type,
302
- tokenize,
303
- )
304
-
305
- _exported_symbols.extend(
306
- [
307
- "__standard_vector_size__",
308
- "__interactive__",
309
- "__jupyter__",
310
- "__formatted_python_version__",
311
- "apilevel",
312
- "comment",
313
- "identifier",
314
- "keyword",
315
- "numeric_const",
316
- "operator",
317
- "paramstyle",
318
- "string_const",
319
- "threadsafety",
320
- "token_type",
321
- "tokenize",
322
- ]
323
- )
324
-
325
-
326
- from _duckdb import (
327
- connect,
328
- default_connection,
329
- set_default_connection,
330
- )
331
-
332
- _exported_symbols.extend(
333
- [
334
- "connect",
335
- "default_connection",
336
- "set_default_connection",
337
- ]
338
- )
339
-
340
- # Exceptions
341
- from _duckdb import (
342
- BinderException,
343
- CatalogException,
344
- ConnectionException,
345
- ConstraintException,
346
- ConversionException,
347
- DataError,
348
- Error,
349
- FatalException,
350
- HTTPException,
351
- IntegrityError,
352
- InternalError,
353
- InternalException,
354
- InterruptException,
355
- InvalidInputException,
356
- InvalidTypeException,
357
- IOException,
358
- NotImplementedException,
359
- NotSupportedError,
360
- OperationalError,
361
- OutOfMemoryException,
362
- OutOfRangeException,
363
- ParserException,
364
- PermissionException,
365
- ProgrammingError,
366
- SequenceException,
367
- SerializationException,
368
- SyntaxException,
369
- TransactionException,
370
- TypeMismatchException,
371
- Warning,
372
- )
373
-
374
- _exported_symbols.extend(
375
- [
376
- "Error",
377
- "DataError",
378
- "ConversionException",
379
- "OutOfRangeException",
380
- "TypeMismatchException",
381
- "FatalException",
382
- "IntegrityError",
383
- "ConstraintException",
384
- "InternalError",
385
- "InternalException",
386
- "InterruptException",
387
- "NotSupportedError",
388
- "NotImplementedException",
389
- "OperationalError",
390
- "ConnectionException",
391
- "IOException",
392
- "HTTPException",
393
- "OutOfMemoryException",
394
- "SerializationException",
395
- "TransactionException",
396
- "PermissionException",
397
- "ProgrammingError",
398
- "BinderException",
399
- "CatalogException",
400
- "InvalidInputException",
401
- "InvalidTypeException",
402
- "ParserException",
403
- "SyntaxException",
404
- "SequenceException",
405
- "Warning",
406
- ]
163
+ from duckdb._version import (
164
+ __duckdb_version__,
165
+ __version__,
166
+ version,
407
167
  )
408
-
409
- # Value
410
168
  from duckdb.value.constant import (
411
169
  BinaryValue,
412
170
  BitValue,
@@ -419,10 +177,13 @@ from duckdb.value.constant import (
419
177
  HugeIntegerValue,
420
178
  IntegerValue,
421
179
  IntervalValue,
180
+ ListValue,
422
181
  LongValue,
182
+ MapValue,
423
183
  NullValue,
424
184
  ShortValue,
425
185
  StringValue,
186
+ StructValue,
426
187
  TimestampMilisecondValue,
427
188
  TimestampNanosecondValue,
428
189
  TimestampSecondValue,
@@ -430,7 +191,9 @@ from duckdb.value.constant import (
430
191
  TimestampValue,
431
192
  TimeTimeZoneValue,
432
193
  TimeValue,
194
+ UnionType,
433
195
  UnsignedBinaryValue,
196
+ UnsignedHugeIntegerValue,
434
197
  UnsignedIntegerValue,
435
198
  UnsignedLongValue,
436
199
  UnsignedShortValue,
@@ -438,37 +201,181 @@ from duckdb.value.constant import (
438
201
  Value,
439
202
  )
440
203
 
441
- _exported_symbols.extend(
442
- [
443
- "Value",
444
- "NullValue",
445
- "BooleanValue",
446
- "UnsignedBinaryValue",
447
- "UnsignedShortValue",
448
- "UnsignedIntegerValue",
449
- "UnsignedLongValue",
450
- "BinaryValue",
451
- "ShortValue",
452
- "IntegerValue",
453
- "LongValue",
454
- "HugeIntegerValue",
455
- "FloatValue",
456
- "DoubleValue",
457
- "DecimalValue",
458
- "StringValue",
459
- "UUIDValue",
460
- "BitValue",
461
- "BlobValue",
462
- "DateValue",
463
- "IntervalValue",
464
- "TimestampValue",
465
- "TimestampSecondValue",
466
- "TimestampMilisecondValue",
467
- "TimestampNanosecondValue",
468
- "TimestampTimeZoneValue",
469
- "TimeValue",
470
- "TimeTimeZoneValue",
471
- ]
472
- )
473
-
474
- __all__ = _exported_symbols
204
+ __all__: list[str] = [
205
+ "BinaryValue",
206
+ "BinderException",
207
+ "BitValue",
208
+ "BlobValue",
209
+ "BooleanValue",
210
+ "CSVLineTerminator",
211
+ "CaseExpression",
212
+ "CatalogException",
213
+ "CoalesceOperator",
214
+ "ColumnExpression",
215
+ "ConnectionException",
216
+ "ConstantExpression",
217
+ "ConstraintException",
218
+ "ConversionException",
219
+ "DataError",
220
+ "DatabaseError",
221
+ "DateValue",
222
+ "DecimalValue",
223
+ "DefaultExpression",
224
+ "DependencyException",
225
+ "DoubleValue",
226
+ "DuckDBPyConnection",
227
+ "DuckDBPyRelation",
228
+ "Error",
229
+ "ExpectedResultType",
230
+ "ExplainType",
231
+ "Expression",
232
+ "FatalException",
233
+ "FloatValue",
234
+ "FunctionExpression",
235
+ "HTTPException",
236
+ "HugeIntegerValue",
237
+ "IOException",
238
+ "IntegerValue",
239
+ "IntegrityError",
240
+ "InternalError",
241
+ "InternalException",
242
+ "InterruptException",
243
+ "IntervalValue",
244
+ "InvalidInputException",
245
+ "InvalidTypeException",
246
+ "LambdaExpression",
247
+ "ListValue",
248
+ "LongValue",
249
+ "MapValue",
250
+ "NotImplementedException",
251
+ "NotSupportedError",
252
+ "NullValue",
253
+ "OperationalError",
254
+ "OutOfMemoryException",
255
+ "OutOfRangeException",
256
+ "ParserException",
257
+ "PermissionException",
258
+ "ProgrammingError",
259
+ "PythonExceptionHandling",
260
+ "RenderMode",
261
+ "SQLExpression",
262
+ "SequenceException",
263
+ "SerializationException",
264
+ "ShortValue",
265
+ "StarExpression",
266
+ "Statement",
267
+ "StatementType",
268
+ "StringValue",
269
+ "StructValue",
270
+ "SyntaxException",
271
+ "TimeTimeZoneValue",
272
+ "TimeValue",
273
+ "TimestampMilisecondValue",
274
+ "TimestampNanosecondValue",
275
+ "TimestampSecondValue",
276
+ "TimestampTimeZoneValue",
277
+ "TimestampValue",
278
+ "TransactionException",
279
+ "TypeMismatchException",
280
+ "UUIDValue",
281
+ "UnionType",
282
+ "UnsignedBinaryValue",
283
+ "UnsignedHugeIntegerValue",
284
+ "UnsignedIntegerValue",
285
+ "UnsignedLongValue",
286
+ "UnsignedShortValue",
287
+ "Value",
288
+ "Warning",
289
+ "__formatted_python_version__",
290
+ "__git_revision__",
291
+ "__interactive__",
292
+ "__jupyter__",
293
+ "__standard_vector_size__",
294
+ "__version__",
295
+ "_clean_default_connection",
296
+ "aggregate",
297
+ "alias",
298
+ "apilevel",
299
+ "append",
300
+ "array_type",
301
+ "arrow",
302
+ "begin",
303
+ "checkpoint",
304
+ "close",
305
+ "commit",
306
+ "connect",
307
+ "create_function",
308
+ "cursor",
309
+ "decimal_type",
310
+ "default_connection",
311
+ "description",
312
+ "df",
313
+ "distinct",
314
+ "dtype",
315
+ "duplicate",
316
+ "enum_type",
317
+ "execute",
318
+ "executemany",
319
+ "extract_statements",
320
+ "fetch_arrow_table",
321
+ "fetch_df",
322
+ "fetch_df_chunk",
323
+ "fetch_record_batch",
324
+ "fetchall",
325
+ "fetchdf",
326
+ "fetchmany",
327
+ "fetchnumpy",
328
+ "fetchone",
329
+ "filesystem_is_registered",
330
+ "filter",
331
+ "from_arrow",
332
+ "from_csv_auto",
333
+ "from_df",
334
+ "from_parquet",
335
+ "from_query",
336
+ "get_table_names",
337
+ "install_extension",
338
+ "interrupt",
339
+ "limit",
340
+ "list_filesystems",
341
+ "list_type",
342
+ "load_extension",
343
+ "map_type",
344
+ "order",
345
+ "paramstyle",
346
+ "paramstyle",
347
+ "pl",
348
+ "project",
349
+ "query",
350
+ "query_df",
351
+ "query_progress",
352
+ "read_csv",
353
+ "read_json",
354
+ "read_parquet",
355
+ "register",
356
+ "register_filesystem",
357
+ "remove_function",
358
+ "rollback",
359
+ "row_type",
360
+ "rowcount",
361
+ "set_default_connection",
362
+ "sql",
363
+ "sqltype",
364
+ "string_type",
365
+ "struct_type",
366
+ "table",
367
+ "table_function",
368
+ "tf",
369
+ "threadsafety",
370
+ "threadsafety",
371
+ "token_type",
372
+ "tokenize",
373
+ "torch",
374
+ "type",
375
+ "union_type",
376
+ "unregister",
377
+ "unregister_filesystem",
378
+ "values",
379
+ "view",
380
+ "write_csv",
381
+ ]