picopyn 0.2.12__tar.gz → 0.3.0.dev1__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.
- {picopyn-0.2.12/picopyn.egg-info → picopyn-0.3.0.dev1}/PKG-INFO +11 -20
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/README.md +7 -17
- picopyn-0.3.0.dev1/picopyn/synchronous/__init__.py +47 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/synchronous/connection.py +11 -4
- picopyn-0.3.0.dev1/picopyn/synchronous/cursor.py +100 -0
- picopyn-0.3.0.dev1/picopyn/synchronous/errors.py +38 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1/picopyn.egg-info}/PKG-INFO +11 -20
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn.egg-info/SOURCES.txt +2 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/pyproject.toml +6 -6
- picopyn-0.2.12/picopyn/synchronous/__init__.py +0 -5
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/AUTHORS.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/LICENSE +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/MANIFEST.in +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/README.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/bench.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/examples/10k_rows_1_thread_1_batch/overall_speed_time.png +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/examples/10k_rows_1_thread_1_batch/threads_speed_time.png +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/examples/1m_rows_10_threads_100_batch/errors_cumulative.png +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/examples/1m_rows_10_threads_100_batch/overall_speed_time.png +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/examples/1m_rows_10_threads_100_batch/threads_speed_time.png +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/benchmark/generate_data_to_csv.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/docs/async.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/docs/explain.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/docs/index.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/docs/installation.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/docs/sync.md +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/__init__.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/asynchronous/__init__.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/asynchronous/client.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/asynchronous/connection.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/asynchronous/pool.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/explain.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/ssl.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/utils/__init__.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/utils/discovery.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/utils/dsn.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn/utils/queries.py +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn.egg-info/dependency_links.txt +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn.egg-info/requires.txt +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/picopyn.egg-info/top_level.txt +0 -0
- {picopyn-0.2.12 → picopyn-0.3.0.dev1}/setup.cfg +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: picopyn
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev1
|
|
4
4
|
Summary: Python connector for working with the distributed Picodata database.
|
|
5
|
-
Author-email: Asya Lomakina <a.lomakina@picodata.io>, Igor Kuznetsov <i.kuznetsov@picodata.io>, Dmitriy Кoltsov <dkoltsov@picodata.io>
|
|
5
|
+
Author-email: Asya Lomakina <a.lomakina@picodata.io>, Igor Kuznetsov <i.kuznetsov@picodata.io>, Dmitriy Кoltsov <dkoltsov@picodata.io>, Daniil Gorlyakov <d.gorlyakov@picodata.io>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
7
|
-
Project-URL:
|
|
7
|
+
Project-URL: Source, https://git.picodata.io/solution/picopyn
|
|
8
8
|
Project-URL: Documentation, https://picopyn.readthedocs.io/en/stable/
|
|
9
|
+
Project-URL: Changelog, https://git.picodata.io/core/drivers/picopyn/-/blob/main/CHANGELOG.md
|
|
9
10
|
Keywords: database,picodata
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
12
|
Classifier: Operating System :: OS Independent
|
|
@@ -43,7 +44,7 @@ Dynamic: license-file
|
|
|
43
44
|
[](https://pypi.org/project/picopyn)
|
|
44
45
|
[](https://picopyn.readthedocs.io)
|
|
45
46
|
|
|
46
|
-
# Picopyn - Picodata
|
|
47
|
+
# Picopyn - Picodata Python driver
|
|
47
48
|
|
|
48
49
|
**Picopyn** is a Python package for working with the distributed [Picodata](https://picodata.io/en/) database.
|
|
49
50
|
|
|
@@ -104,18 +105,9 @@ asyncio.run(main())
|
|
|
104
105
|
```
|
|
105
106
|
|
|
106
107
|
## Development
|
|
108
|
+
For development we use [uv](https://docs.astral.sh/uv/getting-started/installation/) as package manager and [docker compose](https://docs.docker.com/compose/install/) for test environment.
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Also you need docker compose (example installation for ubuntu):
|
|
114
|
-
```bash
|
|
115
|
-
sudo apt-get install -y docker-compose-plugin
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Install development dependencies:
|
|
110
|
+
To install development dependencies:
|
|
119
111
|
```bash
|
|
120
112
|
uv sync --extra test
|
|
121
113
|
```
|
|
@@ -131,7 +123,7 @@ make install
|
|
|
131
123
|
|
|
132
124
|
The documentation is written in Markdown and built with [MkDocs](https://www.mkdocs.org/) using the [Material theme](https://squidfunk.github.io/mkdocs-material/). API reference is generated automatically from docstrings via [mkdocstrings](https://mkdocstrings.github.io/).
|
|
133
125
|
|
|
134
|
-
Published documentation is available at **[picopyn.readthedocs.io](https://picopyn.readthedocs.io/en/stable/)
|
|
126
|
+
Published documentation is available at **[picopyn.readthedocs.io](https://picopyn.readthedocs.io/en/stable/)**.
|
|
135
127
|
|
|
136
128
|
Source files are located in the `docs/` directory. To work on docs locally, install the docs dependencies and start the live-reload server:
|
|
137
129
|
|
|
@@ -140,8 +132,6 @@ uv sync --extra docs
|
|
|
140
132
|
make doc
|
|
141
133
|
```
|
|
142
134
|
|
|
143
|
-
The local server will be available at http://127.0.0.1:8000/.
|
|
144
|
-
|
|
145
135
|
### How to write code
|
|
146
136
|
|
|
147
137
|
We use several tools to ensure code style and type safety.
|
|
@@ -152,7 +142,7 @@ We use several tools to ensure code style and type safety.
|
|
|
152
142
|
To check code style and static types:
|
|
153
143
|
```bash
|
|
154
144
|
make lint
|
|
155
|
-
|
|
145
|
+
```
|
|
156
146
|
|
|
157
147
|
To automatically fix formatting and style issues:
|
|
158
148
|
|
|
@@ -161,6 +151,7 @@ make fmt
|
|
|
161
151
|
```
|
|
162
152
|
|
|
163
153
|
### How to test
|
|
154
|
+
We use [docker compose](https://docs.docker.com/compose/install/) for test environment.
|
|
164
155
|
|
|
165
156
|
Run the general test suite:
|
|
166
157
|
|
|
@@ -182,7 +173,7 @@ This will:
|
|
|
182
173
|
|
|
183
174
|
|
|
184
175
|
### How to debug
|
|
185
|
-
Do not forget run environment via `make env`
|
|
176
|
+
Do not forget to run the environment via `make env`
|
|
186
177
|
|
|
187
178
|
For debugging purposes:
|
|
188
179
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://pypi.org/project/picopyn)
|
|
3
3
|
[](https://picopyn.readthedocs.io)
|
|
4
4
|
|
|
5
|
-
# Picopyn - Picodata
|
|
5
|
+
# Picopyn - Picodata Python driver
|
|
6
6
|
|
|
7
7
|
**Picopyn** is a Python package for working with the distributed [Picodata](https://picodata.io/en/) database.
|
|
8
8
|
|
|
@@ -63,18 +63,9 @@ asyncio.run(main())
|
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
## Development
|
|
66
|
+
For development we use [uv](https://docs.astral.sh/uv/getting-started/installation/) as package manager and [docker compose](https://docs.docker.com/compose/install/) for test environment.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Also you need docker compose (example installation for ubuntu):
|
|
73
|
-
```bash
|
|
74
|
-
sudo apt-get install -y docker-compose-plugin
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Install development dependencies:
|
|
68
|
+
To install development dependencies:
|
|
78
69
|
```bash
|
|
79
70
|
uv sync --extra test
|
|
80
71
|
```
|
|
@@ -90,7 +81,7 @@ make install
|
|
|
90
81
|
|
|
91
82
|
The documentation is written in Markdown and built with [MkDocs](https://www.mkdocs.org/) using the [Material theme](https://squidfunk.github.io/mkdocs-material/). API reference is generated automatically from docstrings via [mkdocstrings](https://mkdocstrings.github.io/).
|
|
92
83
|
|
|
93
|
-
Published documentation is available at **[picopyn.readthedocs.io](https://picopyn.readthedocs.io/en/stable/)
|
|
84
|
+
Published documentation is available at **[picopyn.readthedocs.io](https://picopyn.readthedocs.io/en/stable/)**.
|
|
94
85
|
|
|
95
86
|
Source files are located in the `docs/` directory. To work on docs locally, install the docs dependencies and start the live-reload server:
|
|
96
87
|
|
|
@@ -99,8 +90,6 @@ uv sync --extra docs
|
|
|
99
90
|
make doc
|
|
100
91
|
```
|
|
101
92
|
|
|
102
|
-
The local server will be available at http://127.0.0.1:8000/.
|
|
103
|
-
|
|
104
93
|
### How to write code
|
|
105
94
|
|
|
106
95
|
We use several tools to ensure code style and type safety.
|
|
@@ -111,7 +100,7 @@ We use several tools to ensure code style and type safety.
|
|
|
111
100
|
To check code style and static types:
|
|
112
101
|
```bash
|
|
113
102
|
make lint
|
|
114
|
-
|
|
103
|
+
```
|
|
115
104
|
|
|
116
105
|
To automatically fix formatting and style issues:
|
|
117
106
|
|
|
@@ -120,6 +109,7 @@ make fmt
|
|
|
120
109
|
```
|
|
121
110
|
|
|
122
111
|
### How to test
|
|
112
|
+
We use [docker compose](https://docs.docker.com/compose/install/) for test environment.
|
|
123
113
|
|
|
124
114
|
Run the general test suite:
|
|
125
115
|
|
|
@@ -141,7 +131,7 @@ This will:
|
|
|
141
131
|
|
|
142
132
|
|
|
143
133
|
### How to debug
|
|
144
|
-
Do not forget run environment via `make env`
|
|
134
|
+
Do not forget to run the environment via `make env`
|
|
145
135
|
|
|
146
136
|
For debugging purposes:
|
|
147
137
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Sync API based on psycopg for connection management"""
|
|
2
|
+
|
|
3
|
+
from .connection import Connection
|
|
4
|
+
from .cursor import Cursor
|
|
5
|
+
from .errors import (
|
|
6
|
+
DatabaseError,
|
|
7
|
+
DataError,
|
|
8
|
+
Error,
|
|
9
|
+
IntegrityError,
|
|
10
|
+
InterfaceError,
|
|
11
|
+
InternalError,
|
|
12
|
+
NotSupportedError,
|
|
13
|
+
OperationalError,
|
|
14
|
+
ProgrammingError,
|
|
15
|
+
Warning,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def connect(dsn: str) -> Connection:
|
|
20
|
+
connection = Connection(dsn)
|
|
21
|
+
connection.connect()
|
|
22
|
+
return connection
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# DBAPI compliance
|
|
26
|
+
apilevel = "2.0"
|
|
27
|
+
threadsafety = 1
|
|
28
|
+
paramstyle = "format"
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"Connection",
|
|
32
|
+
"Cursor",
|
|
33
|
+
"connect",
|
|
34
|
+
"apilevel",
|
|
35
|
+
"threadsafety",
|
|
36
|
+
"paramstyle",
|
|
37
|
+
"Warning",
|
|
38
|
+
"Error",
|
|
39
|
+
"InterfaceError",
|
|
40
|
+
"DatabaseError",
|
|
41
|
+
"DataError",
|
|
42
|
+
"OperationalError",
|
|
43
|
+
"IntegrityError",
|
|
44
|
+
"InternalError",
|
|
45
|
+
"ProgrammingError",
|
|
46
|
+
"NotSupportedError",
|
|
47
|
+
]
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import psycopg
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
paramstyle = "format"
|
|
3
|
+
from .cursor import Cursor
|
|
4
|
+
from .errors import InterfaceError
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class Connection:
|
|
@@ -27,7 +26,6 @@ class Connection:
|
|
|
27
26
|
"""
|
|
28
27
|
if self.conn and not self.conn.closed:
|
|
29
28
|
self.close()
|
|
30
|
-
|
|
31
29
|
try:
|
|
32
30
|
self.conn = psycopg.connect(self.dsn)
|
|
33
31
|
except Exception as e:
|
|
@@ -53,3 +51,12 @@ class Connection:
|
|
|
53
51
|
) from e
|
|
54
52
|
finally:
|
|
55
53
|
self.conn = None
|
|
54
|
+
|
|
55
|
+
def cursor(self) -> Cursor:
|
|
56
|
+
"""
|
|
57
|
+
Return a new cursor object using the connection.
|
|
58
|
+
"""
|
|
59
|
+
if self.conn is None or self.conn.closed:
|
|
60
|
+
raise InterfaceError("No active connection. Call .connect() before creating a cursor.")
|
|
61
|
+
|
|
62
|
+
return Cursor(self.conn.cursor())
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from collections.abc import Iterator
|
|
2
|
+
from typing import TypeAlias
|
|
3
|
+
|
|
4
|
+
import psycopg
|
|
5
|
+
|
|
6
|
+
from .errors import InterfaceError, ProgrammingError
|
|
7
|
+
|
|
8
|
+
DescriptionItem: TypeAlias = tuple[
|
|
9
|
+
str, # name
|
|
10
|
+
int, # type_code
|
|
11
|
+
int | None, # display_size
|
|
12
|
+
int | None, # internal_size
|
|
13
|
+
int | None, # precision
|
|
14
|
+
int | None, # scale
|
|
15
|
+
bool | None, # null_ok
|
|
16
|
+
]
|
|
17
|
+
Description: TypeAlias = tuple[DescriptionItem, ...]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Cursor:
|
|
21
|
+
"""
|
|
22
|
+
DB-API cursor wrapper for reading DQL result sets.
|
|
23
|
+
|
|
24
|
+
Supports cursor metadata and fetch methods.
|
|
25
|
+
Query execution is intentionally implemented later.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(self, cursor: psycopg.Cursor[tuple[object, ...]]) -> None:
|
|
29
|
+
self._cursor = cursor
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def description(self) -> Description | None:
|
|
33
|
+
"""
|
|
34
|
+
Return DB-API column metadata for the current result set.
|
|
35
|
+
"""
|
|
36
|
+
self._ensure_open()
|
|
37
|
+
|
|
38
|
+
description = self._cursor.description
|
|
39
|
+
if description is None:
|
|
40
|
+
return None
|
|
41
|
+
|
|
42
|
+
return tuple(
|
|
43
|
+
(
|
|
44
|
+
column.name,
|
|
45
|
+
column.type_code,
|
|
46
|
+
column.display_size,
|
|
47
|
+
column.internal_size,
|
|
48
|
+
column.precision,
|
|
49
|
+
column.scale,
|
|
50
|
+
column.null_ok,
|
|
51
|
+
)
|
|
52
|
+
for column in description
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def rowcount(self) -> int:
|
|
57
|
+
"""
|
|
58
|
+
Return the number of rows produced or affected by the last operation.
|
|
59
|
+
"""
|
|
60
|
+
self._ensure_open()
|
|
61
|
+
return self._cursor.rowcount
|
|
62
|
+
|
|
63
|
+
def fetchone(self) -> tuple[object, ...] | None:
|
|
64
|
+
"""
|
|
65
|
+
Fetch the next row from the current result set.
|
|
66
|
+
"""
|
|
67
|
+
self._ensure_result_set()
|
|
68
|
+
return self._cursor.fetchone()
|
|
69
|
+
|
|
70
|
+
def fetchall(self) -> list[tuple[object, ...]]:
|
|
71
|
+
"""
|
|
72
|
+
Fetch all remaining rows from the current result set.
|
|
73
|
+
"""
|
|
74
|
+
self._ensure_result_set()
|
|
75
|
+
return self._cursor.fetchall()
|
|
76
|
+
|
|
77
|
+
def __iter__(self) -> Iterator[tuple[object, ...]]:
|
|
78
|
+
"""
|
|
79
|
+
Iterate over the current result set.
|
|
80
|
+
"""
|
|
81
|
+
self._ensure_result_set()
|
|
82
|
+
return iter(self._cursor)
|
|
83
|
+
|
|
84
|
+
def close(self) -> None:
|
|
85
|
+
"""
|
|
86
|
+
Close the cursor.
|
|
87
|
+
"""
|
|
88
|
+
self._cursor.close()
|
|
89
|
+
|
|
90
|
+
def _ensure_open(self) -> None:
|
|
91
|
+
if self._cursor.closed:
|
|
92
|
+
raise InterfaceError("Cursor is closed.")
|
|
93
|
+
|
|
94
|
+
def _ensure_result_set(self) -> None:
|
|
95
|
+
self._ensure_open()
|
|
96
|
+
|
|
97
|
+
if self._cursor.description is None:
|
|
98
|
+
raise ProgrammingError(
|
|
99
|
+
"No result set is available. Execute a query that returns rows before fetching."
|
|
100
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
class Warning(Exception): # noqa: N818 - required by PEP 249
|
|
2
|
+
"""Exception raised for important warnings."""
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Error(Exception):
|
|
6
|
+
"""Base class for all synchronous DB-API errors."""
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class InterfaceError(Error):
|
|
10
|
+
"""Error related to the database interface rather than the database itself."""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DatabaseError(Error):
|
|
14
|
+
"""Error related to the database."""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class DataError(DatabaseError):
|
|
18
|
+
"""Error due to problems with processed data."""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class OperationalError(DatabaseError):
|
|
22
|
+
"""Error related to database operation."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class IntegrityError(DatabaseError):
|
|
26
|
+
"""Error related to relational integrity."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class InternalError(DatabaseError):
|
|
30
|
+
"""Internal database error."""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ProgrammingError(DatabaseError):
|
|
34
|
+
"""Programming error, such as invalid SQL or invalid API usage."""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class NotSupportedError(DatabaseError):
|
|
38
|
+
"""Error raised when an unsupported DB-API feature is requested."""
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: picopyn
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev1
|
|
4
4
|
Summary: Python connector for working with the distributed Picodata database.
|
|
5
|
-
Author-email: Asya Lomakina <a.lomakina@picodata.io>, Igor Kuznetsov <i.kuznetsov@picodata.io>, Dmitriy Кoltsov <dkoltsov@picodata.io>
|
|
5
|
+
Author-email: Asya Lomakina <a.lomakina@picodata.io>, Igor Kuznetsov <i.kuznetsov@picodata.io>, Dmitriy Кoltsov <dkoltsov@picodata.io>, Daniil Gorlyakov <d.gorlyakov@picodata.io>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
7
|
-
Project-URL:
|
|
7
|
+
Project-URL: Source, https://git.picodata.io/solution/picopyn
|
|
8
8
|
Project-URL: Documentation, https://picopyn.readthedocs.io/en/stable/
|
|
9
|
+
Project-URL: Changelog, https://git.picodata.io/core/drivers/picopyn/-/blob/main/CHANGELOG.md
|
|
9
10
|
Keywords: database,picodata
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
12
|
Classifier: Operating System :: OS Independent
|
|
@@ -43,7 +44,7 @@ Dynamic: license-file
|
|
|
43
44
|
[](https://pypi.org/project/picopyn)
|
|
44
45
|
[](https://picopyn.readthedocs.io)
|
|
45
46
|
|
|
46
|
-
# Picopyn - Picodata
|
|
47
|
+
# Picopyn - Picodata Python driver
|
|
47
48
|
|
|
48
49
|
**Picopyn** is a Python package for working with the distributed [Picodata](https://picodata.io/en/) database.
|
|
49
50
|
|
|
@@ -104,18 +105,9 @@ asyncio.run(main())
|
|
|
104
105
|
```
|
|
105
106
|
|
|
106
107
|
## Development
|
|
108
|
+
For development we use [uv](https://docs.astral.sh/uv/getting-started/installation/) as package manager and [docker compose](https://docs.docker.com/compose/install/) for test environment.
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Also you need docker compose (example installation for ubuntu):
|
|
114
|
-
```bash
|
|
115
|
-
sudo apt-get install -y docker-compose-plugin
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Install development dependencies:
|
|
110
|
+
To install development dependencies:
|
|
119
111
|
```bash
|
|
120
112
|
uv sync --extra test
|
|
121
113
|
```
|
|
@@ -131,7 +123,7 @@ make install
|
|
|
131
123
|
|
|
132
124
|
The documentation is written in Markdown and built with [MkDocs](https://www.mkdocs.org/) using the [Material theme](https://squidfunk.github.io/mkdocs-material/). API reference is generated automatically from docstrings via [mkdocstrings](https://mkdocstrings.github.io/).
|
|
133
125
|
|
|
134
|
-
Published documentation is available at **[picopyn.readthedocs.io](https://picopyn.readthedocs.io/en/stable/)
|
|
126
|
+
Published documentation is available at **[picopyn.readthedocs.io](https://picopyn.readthedocs.io/en/stable/)**.
|
|
135
127
|
|
|
136
128
|
Source files are located in the `docs/` directory. To work on docs locally, install the docs dependencies and start the live-reload server:
|
|
137
129
|
|
|
@@ -140,8 +132,6 @@ uv sync --extra docs
|
|
|
140
132
|
make doc
|
|
141
133
|
```
|
|
142
134
|
|
|
143
|
-
The local server will be available at http://127.0.0.1:8000/.
|
|
144
|
-
|
|
145
135
|
### How to write code
|
|
146
136
|
|
|
147
137
|
We use several tools to ensure code style and type safety.
|
|
@@ -152,7 +142,7 @@ We use several tools to ensure code style and type safety.
|
|
|
152
142
|
To check code style and static types:
|
|
153
143
|
```bash
|
|
154
144
|
make lint
|
|
155
|
-
|
|
145
|
+
```
|
|
156
146
|
|
|
157
147
|
To automatically fix formatting and style issues:
|
|
158
148
|
|
|
@@ -161,6 +151,7 @@ make fmt
|
|
|
161
151
|
```
|
|
162
152
|
|
|
163
153
|
### How to test
|
|
154
|
+
We use [docker compose](https://docs.docker.com/compose/install/) for test environment.
|
|
164
155
|
|
|
165
156
|
Run the general test suite:
|
|
166
157
|
|
|
@@ -182,7 +173,7 @@ This will:
|
|
|
182
173
|
|
|
183
174
|
|
|
184
175
|
### How to debug
|
|
185
|
-
Do not forget run environment via `make env`
|
|
176
|
+
Do not forget to run the environment via `make env`
|
|
186
177
|
|
|
187
178
|
For debugging purposes:
|
|
188
179
|
|
|
@@ -30,6 +30,8 @@ picopyn/asynchronous/connection.py
|
|
|
30
30
|
picopyn/asynchronous/pool.py
|
|
31
31
|
picopyn/synchronous/__init__.py
|
|
32
32
|
picopyn/synchronous/connection.py
|
|
33
|
+
picopyn/synchronous/cursor.py
|
|
34
|
+
picopyn/synchronous/errors.py
|
|
33
35
|
picopyn/utils/__init__.py
|
|
34
36
|
picopyn/utils/discovery.py
|
|
35
37
|
picopyn/utils/dsn.py
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "picopyn"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0.dev1"
|
|
4
4
|
description = "Python connector for working with the distributed Picodata database."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Asya Lomakina", email = "a.lomakina@picodata.io" },
|
|
7
7
|
{ name = "Igor Kuznetsov", email = "i.kuznetsov@picodata.io" },
|
|
8
|
-
{ name = "Dmitriy Кoltsov", email = "dkoltsov@picodata.io" }
|
|
8
|
+
{ name = "Dmitriy Кoltsov", email = "dkoltsov@picodata.io" },
|
|
9
|
+
{ name = "Daniil Gorlyakov", email = "d.gorlyakov@picodata.io" }
|
|
9
10
|
]
|
|
10
11
|
license = "BSD-2-Clause"
|
|
11
12
|
requires-python = '>=3.10'
|
|
@@ -32,16 +33,15 @@ dependencies = [
|
|
|
32
33
|
]
|
|
33
34
|
|
|
34
35
|
[project.urls]
|
|
35
|
-
|
|
36
|
+
Source = "https://git.picodata.io/solution/picopyn"
|
|
36
37
|
Documentation = "https://picopyn.readthedocs.io/en/stable/"
|
|
37
|
-
|
|
38
|
+
Changelog = "https://git.picodata.io/core/drivers/picopyn/-/blob/main/CHANGELOG.md"
|
|
38
39
|
|
|
39
40
|
[build-system]
|
|
40
41
|
requires = ["setuptools>=60.0.0"]
|
|
41
42
|
build-backend = "setuptools.build_meta"
|
|
42
43
|
|
|
43
44
|
|
|
44
|
-
|
|
45
45
|
[project.optional-dependencies]
|
|
46
46
|
test = [
|
|
47
47
|
'pytest==8.3.5',
|
|
@@ -97,4 +97,4 @@ allow_untyped_decorators = true
|
|
|
97
97
|
disallow_untyped_calls = true
|
|
98
98
|
|
|
99
99
|
[tool.setuptools]
|
|
100
|
-
packages = ["picopyn", "picopyn.utils", "picopyn.asynchronous", "picopyn.synchronous"]
|
|
100
|
+
packages = ["picopyn", "picopyn.utils", "picopyn.asynchronous", "picopyn.synchronous"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|