libsql-py 1.0.0__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.
- libsql/__init__.py +5 -0
- libsql/__init__.pyi +83 -0
- libsql/libsql.cp313-win_amd64.pyd +0 -0
- libsql/py.typed +0 -0
- libsql_py-1.0.0.dist-info/METADATA +84 -0
- libsql_py-1.0.0.dist-info/RECORD +9 -0
- libsql_py-1.0.0.dist-info/WHEEL +4 -0
- libsql_py-1.0.0.dist-info/licenses/LICENSE.md +20 -0
- libsql_py-1.0.0.dist-info/sboms/libsql.cyclonedx.json +7187 -0
libsql/__init__.py
ADDED
libsql/__init__.pyi
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
from types import TracebackType
|
|
3
|
+
from typing import Any, Final, Literal, TypeAlias, final
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Self
|
|
6
|
+
|
|
7
|
+
_Value: TypeAlias = int | float | str | bytes | None
|
|
8
|
+
_Parameters: TypeAlias = Sequence[_Value]
|
|
9
|
+
_Row: TypeAlias = tuple[Any, ...]
|
|
10
|
+
_Description: TypeAlias = tuple[tuple[str, None, None, None, None, None, None], ...]
|
|
11
|
+
|
|
12
|
+
LEGACY_TRANSACTION_CONTROL: Final[int]
|
|
13
|
+
paramstyle: Final = "qmark"
|
|
14
|
+
sqlite_version_info: Final[tuple[int, int, int]]
|
|
15
|
+
|
|
16
|
+
class Error(ValueError): ...
|
|
17
|
+
class InterfaceError(Error): ...
|
|
18
|
+
class DatabaseError(Error): ...
|
|
19
|
+
class DataError(DatabaseError): ...
|
|
20
|
+
class OperationalError(DatabaseError): ...
|
|
21
|
+
class IntegrityError(DatabaseError): ...
|
|
22
|
+
class InternalError(DatabaseError): ...
|
|
23
|
+
class ProgrammingError(DatabaseError): ...
|
|
24
|
+
class NotSupportedError(DatabaseError): ...
|
|
25
|
+
|
|
26
|
+
def connect(
|
|
27
|
+
database: str,
|
|
28
|
+
timeout: float = 5.0,
|
|
29
|
+
isolation_level: str | None = "DEFERRED",
|
|
30
|
+
_check_same_thread: bool = True,
|
|
31
|
+
_uri: bool = False,
|
|
32
|
+
sync_url: str | None = None,
|
|
33
|
+
sync_interval: float | None = None,
|
|
34
|
+
offline: bool = False,
|
|
35
|
+
auth_token: str = "",
|
|
36
|
+
encryption_key: str | None = None,
|
|
37
|
+
# Only accepted on Python 3.12+ (mirrors sqlite3.connect).
|
|
38
|
+
autocommit: int = ...,
|
|
39
|
+
) -> Connection: ...
|
|
40
|
+
|
|
41
|
+
@final
|
|
42
|
+
class Connection:
|
|
43
|
+
isolation_level: str | None
|
|
44
|
+
# Only available on Python 3.12+ (mirrors sqlite3.Connection.autocommit).
|
|
45
|
+
autocommit: int
|
|
46
|
+
@property
|
|
47
|
+
def in_transaction(self) -> bool: ...
|
|
48
|
+
def close(self) -> None: ...
|
|
49
|
+
def cursor(self) -> Cursor: ...
|
|
50
|
+
def sync(self) -> None: ...
|
|
51
|
+
def commit(self) -> None: ...
|
|
52
|
+
def rollback(self) -> None: ...
|
|
53
|
+
def execute(self, sql: str, parameters: _Parameters | None = None) -> Cursor: ...
|
|
54
|
+
def executemany(
|
|
55
|
+
self, sql: str, parameters: list[_Parameters] | None = None
|
|
56
|
+
) -> Cursor: ...
|
|
57
|
+
def executescript(self, script: str) -> None: ...
|
|
58
|
+
def __enter__(self) -> Self: ...
|
|
59
|
+
def __exit__(
|
|
60
|
+
self,
|
|
61
|
+
exc_type: type[BaseException] | None = None,
|
|
62
|
+
_exc_val: BaseException | None = None,
|
|
63
|
+
_exc_tb: TracebackType | None = None,
|
|
64
|
+
) -> Literal[False]: ...
|
|
65
|
+
|
|
66
|
+
@final
|
|
67
|
+
class Cursor:
|
|
68
|
+
arraysize: int
|
|
69
|
+
@property
|
|
70
|
+
def description(self) -> _Description | None: ...
|
|
71
|
+
@property
|
|
72
|
+
def lastrowid(self) -> int | None: ...
|
|
73
|
+
@property
|
|
74
|
+
def rowcount(self) -> int: ...
|
|
75
|
+
def close(self) -> None: ...
|
|
76
|
+
def execute(self, sql: str, parameters: _Parameters | None = None) -> Self: ...
|
|
77
|
+
def executemany(
|
|
78
|
+
self, sql: str, parameters: list[_Parameters] | None = None
|
|
79
|
+
) -> Self: ...
|
|
80
|
+
def executescript(self, script: str) -> Self: ...
|
|
81
|
+
def fetchone(self) -> _Row | None: ...
|
|
82
|
+
def fetchmany(self, size: int | None = None) -> list[_Row] | None: ...
|
|
83
|
+
def fetchall(self) -> list[_Row] | None: ...
|
|
Binary file
|
libsql/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: libsql-py
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
License-File: LICENSE.md
|
|
8
|
+
Summary: Python bindings for libSQL (Turso): a sqlite3-compatible DB-API driver for local, remote, and embedded-replica databases. Import as `libsql`.
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
11
|
+
Project-URL: Repository, https://github.com/New-Elysium/libsql-python
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://github.com/New-Elysium/libsql-python">
|
|
15
|
+
<img alt="Turso + Python" src="https://github.com/tursodatabase/libsql-python/assets/950181/3748f2b3-872e-4cdd-bbe3-78491fd81dfa" width="1000">
|
|
16
|
+
<h3 align="center">Turso + Python</h3>
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
SQLite for Production. Powered by <a href="https://turso.tech/libsql">libSQL</a>.
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://turso.tech"><strong>Turso</strong></a> ·
|
|
26
|
+
<a href="https://docs.turso.tech/quickstart"><strong>Quickstart</strong></a> ·
|
|
27
|
+
<a href="/examples"><strong>Examples</strong></a> ·
|
|
28
|
+
<a href="https://docs.turso.tech"><strong>Docs</strong></a> ·
|
|
29
|
+
<a href="https://github.com/New-Elysium/libsql-python"><strong>GitHub</strong></a> ·
|
|
30
|
+
<a href="https://discord.gg/turso"><strong>Discord</strong></a> ·
|
|
31
|
+
<a href="https://blog.turso.tech/"><strong>Blog & Tutorials</strong></a>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://pypi.org/project/libsql-py">
|
|
36
|
+
<img src="https://badge.fury.io/py/libsql-py.svg" alt="PyPI" title="PyPI" />
|
|
37
|
+
</a>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
The package is published to PyPI as **[`libsql-py`](https://pypi.org/project/libsql-py)**:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
pip install libsql-py
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The importable module stays **`libsql`**, so it is a drop-in replacement — any code, tutorial, or documentation written against `import libsql` keeps working unchanged:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import libsql
|
|
54
|
+
|
|
55
|
+
conn = libsql.connect("local.db")
|
|
56
|
+
conn.execute("CREATE TABLE users (id INTEGER, email TEXT)")
|
|
57
|
+
conn.execute("INSERT INTO users VALUES (1, 'alice@example.com')")
|
|
58
|
+
print(conn.execute("SELECT * FROM users").fetchall())
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> [!NOTE]
|
|
62
|
+
> If the original [`libsql`](https://pypi.org/project/libsql) distribution is installed, uninstall it first (`pip uninstall libsql`). Both distributions provide the same `libsql` module, and having both installed would leave the import target ambiguous.
|
|
63
|
+
|
|
64
|
+
## Source Code
|
|
65
|
+
|
|
66
|
+
Upstream repository: [New-Elysium/libsql-python](https://github.com/New-Elysium/libsql-python)
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
1. [Turso Quickstart](https://docs.turso.tech/quickstart) — Learn how create and connect your first database.
|
|
71
|
+
2. [SDK Quickstart](https://docs.turso.tech/sdk/python/quickstart) — Learn how to install and execute queries using the libSQL client.
|
|
72
|
+
3. [SDK Reference](https://docs.turso.tech/sdk/python/reference) — Dive deeper with the libSQL SDK reference and examples.
|
|
73
|
+
|
|
74
|
+
### What is Turso?
|
|
75
|
+
|
|
76
|
+
[Turso](https://turso.tech) is a SQLite-compatible database built on [libSQL](https://docs.turso.tech/libsql), the Open Contribution fork of SQLite. It enables scaling to hundreds of thousands of databases per organization and supports replication to any location, including your own servers, for microsecond-latency access.
|
|
77
|
+
|
|
78
|
+
Learn more about what you can do with Turso:
|
|
79
|
+
|
|
80
|
+
- [Embedded Replicas](https://docs.turso.tech/features/embedded-replicas)
|
|
81
|
+
- [Platform API](https://docs.turso.tech/features/platform-api)
|
|
82
|
+
- [Branching](https://docs.turso.tech/features/branching)
|
|
83
|
+
- [Point-in-Time Recovery](https://docs.turso.tech/features/point-in-time-recovery)
|
|
84
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
libsql/__init__.py,sha256=tp_7rP0wB3eFpa7WH950bYBUIgguriFigCggSEn8izY,107
|
|
2
|
+
libsql/__init__.pyi,sha256=kwWzXj5HmbXieUHgXdJi7pZL65eoOgHvtZ3OD36FQss,2899
|
|
3
|
+
libsql/libsql.cp313-win_amd64.pyd,sha256=Arqig64LOshsydug9smdkhc17ULuq9Ns70rFV41x6FI,10514432
|
|
4
|
+
libsql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
libsql_py-1.0.0.dist-info/METADATA,sha256=D1u7Zq_S7oYSbqNBDZXhO609aQ1UDJqqlnZGVB73oTs,3738
|
|
6
|
+
libsql_py-1.0.0.dist-info/WHEEL,sha256=1CCnYT4CkPGtkem-vV3hqFTPRTmfZy2aMkAyn2cGMqA,97
|
|
7
|
+
libsql_py-1.0.0.dist-info/licenses/LICENSE.md,sha256=cjXB4T7R42oZ11IhsW3YMy0cMv4XhApu89BoGL_n-nk,1096
|
|
8
|
+
libsql_py-1.0.0.dist-info/sboms/libsql.cyclonedx.json,sha256=FjWOs8tgvXwJ1BNCQThKt--C6CmgG-XsNG_qsd04PhM,230649
|
|
9
|
+
libsql_py-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2026 Srikanth Gopalakrishnan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|