kover 3.2.0__tar.gz → 3.3.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.
- {kover-3.2.0 → kover-3.3.0}/.gitignore +46 -46
- {kover-3.2.0 → kover-3.3.0}/CODE_OF_CONDUCT.md +128 -128
- {kover-3.2.0 → kover-3.3.0}/LICENSE +21 -21
- {kover-3.2.0 → kover-3.3.0}/PKG-INFO +90 -43
- {kover-3.2.0 → kover-3.3.0}/README.md +593 -547
- {kover-3.2.0 → kover-3.3.0}/docs/architecture.md +118 -118
- {kover-3.2.0 → kover-3.3.0}/docs/connections.md +206 -206
- {kover-3.2.0 → kover-3.3.0}/docs/development.md +155 -155
- {kover-3.2.0 → kover-3.3.0}/docs/documents.md +109 -109
- kover-3.3.0/docs/geo_json.md +271 -0
- {kover-3.2.0 → kover-3.3.0}/docs/read_preferences.md +163 -163
- {kover-3.2.0 → kover-3.3.0}/docs/transactions.md +157 -157
- {kover-3.2.0 → kover-3.3.0}/kover/__init__.py +157 -155
- {kover-3.2.0 → kover-3.3.0}/kover/__version__.py +6 -6
- {kover-3.2.0 → kover-3.3.0}/kover/_utils/__init__.py +21 -21
- {kover-3.2.0 → kover-3.3.0}/kover/_utils/mappings.py +101 -101
- {kover-3.2.0 → kover-3.3.0}/kover/_utils/protocols.py +15 -15
- {kover-3.2.0 → kover-3.3.0}/kover/_utils/representation.py +28 -28
- {kover-3.2.0 → kover-3.3.0}/kover/bootstrap.py +187 -186
- {kover-3.2.0 → kover-3.3.0}/kover/bulk_write_builder.py +101 -101
- {kover-3.2.0 → kover-3.3.0}/kover/client.py +479 -476
- {kover-3.2.0 → kover-3.3.0}/kover/collection.py +677 -676
- {kover-3.2.0 → kover-3.3.0}/kover/configuration/__init__.py +13 -11
- {kover-3.2.0 → kover-3.3.0}/kover/configuration/environment.py +103 -103
- {kover-3.2.0 → kover-3.3.0}/kover/cursor.py +376 -368
- {kover-3.2.0 → kover-3.3.0}/kover/database.py +340 -338
- {kover-3.2.0 → kover-3.3.0}/kover/error_codes.py +553 -553
- {kover-3.2.0 → kover-3.3.0}/kover/exceptions.py +122 -122
- {kover-3.2.0 → kover-3.3.0}/kover/execution/__init__.py +25 -23
- {kover-3.2.0 → kover-3.3.0}/kover/execution/context.py +52 -52
- {kover-3.2.0 → kover-3.3.0}/kover/execution/executor.py +120 -120
- {kover-3.2.0 → kover-3.3.0}/kover/execution/preparation.py +64 -64
- {kover-3.2.0 → kover-3.3.0}/kover/execution/protocols.py +63 -63
- {kover-3.2.0 → kover-3.3.0}/kover/execution/router.py +44 -44
- kover-3.3.0/kover/geo/__init__.py +29 -0
- kover-3.3.0/kover/geo/models.py +227 -0
- {kover-3.2.0 → kover-3.3.0}/kover/gridfs/__init__.py +15 -13
- {kover-3.2.0 → kover-3.3.0}/kover/gridfs/annotations.py +6 -6
- {kover-3.2.0 → kover-3.3.0}/kover/gridfs/exceptions.py +9 -9
- {kover-3.2.0 → kover-3.3.0}/kover/gridfs/gridfs.py +298 -293
- {kover-3.2.0 → kover-3.3.0}/kover/gridfs/models.py +43 -43
- {kover-3.2.0 → kover-3.3.0}/kover/models/__init__.py +45 -45
- {kover-3.2.0 → kover-3.3.0}/kover/models/address.py +12 -12
- {kover-3.2.0 → kover-3.3.0}/kover/models/collation.py +45 -45
- {kover-3.2.0 → kover-3.3.0}/kover/models/collection.py +10 -10
- {kover-3.2.0 → kover-3.3.0}/kover/models/concerns.py +29 -29
- {kover-3.2.0 → kover-3.3.0}/kover/models/credentials.py +53 -53
- {kover-3.2.0 → kover-3.3.0}/kover/models/hello.py +54 -54
- {kover-3.2.0 → kover-3.3.0}/kover/models/indexes.py +46 -45
- {kover-3.2.0 → kover-3.3.0}/kover/models/operations.py +112 -112
- {kover-3.2.0 → kover-3.3.0}/kover/models/options.py +46 -42
- {kover-3.2.0 → kover-3.3.0}/kover/models/parsed_uri.py +71 -70
- {kover-3.2.0 → kover-3.3.0}/kover/models/read_preference.py +85 -82
- {kover-3.2.0 → kover-3.3.0}/kover/models/replica_set.py +80 -80
- {kover-3.2.0 → kover-3.3.0}/kover/models/server.py +40 -40
- {kover-3.2.0 → kover-3.3.0}/kover/models/topology.py +69 -69
- {kover-3.2.0 → kover-3.3.0}/kover/models/tx_state.py +14 -14
- {kover-3.2.0 → kover-3.3.0}/kover/models/user.py +31 -31
- {kover-3.2.0 → kover-3.3.0}/kover/network/__init__.py +33 -31
- {kover-3.2.0 → kover-3.3.0}/kover/network/auth/__init__.py +5 -5
- {kover-3.2.0 → kover-3.3.0}/kover/network/auth/authenticator.py +40 -40
- {kover-3.2.0 → kover-3.3.0}/kover/network/auth/scram.py +144 -137
- {kover-3.2.0 → kover-3.3.0}/kover/network/connection.py +203 -200
- {kover-3.2.0 → kover-3.3.0}/kover/network/factory.py +99 -99
- {kover-3.2.0 → kover-3.3.0}/kover/network/lease.py +60 -59
- {kover-3.2.0 → kover-3.3.0}/kover/network/pool.py +297 -287
- {kover-3.2.0 → kover-3.3.0}/kover/network/probe.py +51 -50
- {kover-3.2.0 → kover-3.3.0}/kover/network/registry.py +90 -88
- {kover-3.2.0 → kover-3.3.0}/kover/network/transport.py +79 -77
- {kover-3.2.0 → kover-3.3.0}/kover/network/uri_parser/__init__.py +9 -7
- {kover-3.2.0 → kover-3.3.0}/kover/network/uri_parser/hosts.py +138 -124
- {kover-3.2.0 → kover-3.3.0}/kover/network/uri_parser/srv.py +153 -145
- {kover-3.2.0 → kover-3.3.0}/kover/network/uri_parser/uri.py +137 -127
- {kover-3.2.0 → kover-3.3.0}/kover/network/uri_parser/uri_options.py +362 -330
- {kover-3.2.0 → kover-3.3.0}/kover/network/wire/__init__.py +15 -13
- {kover-3.2.0 → kover-3.3.0}/kover/network/wire/codec.py +249 -235
- {kover-3.2.0 → kover-3.3.0}/kover/network/wire/compression.py +101 -98
- {kover-3.2.0 → kover-3.3.0}/kover/network/wire/error_codes.py +553 -553
- {kover-3.2.0 → kover-3.3.0}/kover/network/wire/error_mapper.py +92 -92
- {kover-3.2.0 → kover-3.3.0}/kover/network/wire/handshake.py +38 -38
- {kover-3.2.0 → kover-3.3.0}/kover/policies/__init__.py +23 -23
- {kover-3.2.0 → kover-3.3.0}/kover/policies/commands.py +59 -59
- {kover-3.2.0 → kover-3.3.0}/kover/policies/routing.py +110 -108
- {kover-3.2.0 → kover-3.3.0}/kover/schema/__init__.py +9 -7
- {kover-3.2.0 → kover-3.3.0}/kover/schema/_pipeline.py +336 -325
- {kover-3.2.0 → kover-3.3.0}/kover/schema/document.py +51 -51
- {kover-3.2.0 → kover-3.3.0}/kover/schema/generator.py +253 -250
- {kover-3.2.0 → kover-3.3.0}/kover/session.py +224 -220
- {kover-3.2.0 → kover-3.3.0}/kover/topology/__init__.py +16 -16
- {kover-3.2.0 → kover-3.3.0}/kover/topology/discovery.py +286 -284
- {kover-3.2.0 → kover-3.3.0}/kover/topology/protocols.py +63 -63
- {kover-3.2.0 → kover-3.3.0}/kover/topology/selector.py +360 -353
- {kover-3.2.0 → kover-3.3.0}/kover/topology/state.py +49 -49
- {kover-3.2.0 → kover-3.3.0}/pyproject.toml +147 -165
- {kover-3.2.0 → kover-3.3.0}/kover/py.typed +0 -0
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
# Python bytecode and caches
|
|
2
|
-
**/__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*$py.class
|
|
5
|
-
.pytest_cache/
|
|
6
|
-
.ruff_cache/
|
|
7
|
-
.mypy_cache/
|
|
8
|
-
.tox/
|
|
9
|
-
.nox/
|
|
10
|
-
.coverage
|
|
11
|
-
.coverage.*
|
|
12
|
-
htmlcov/
|
|
13
|
-
|
|
14
|
-
# Virtual environments and local Python configuration
|
|
15
|
-
.venv/
|
|
16
|
-
venv/
|
|
17
|
-
env/
|
|
18
|
-
.python-version
|
|
19
|
-
|
|
20
|
-
# Packaging and build artifacts
|
|
21
|
-
build/
|
|
22
|
-
dist/
|
|
23
|
-
*.egg-info/
|
|
24
|
-
pip-wheel-metadata/
|
|
25
|
-
|
|
26
|
-
# Project-specific generated files and scratch content
|
|
27
|
-
/_out/
|
|
28
|
-
/test.py
|
|
29
|
-
/badges.txt
|
|
30
|
-
/hatch_build.py
|
|
31
|
-
/rust/
|
|
32
|
-
|
|
33
|
-
# Local secrets and environment files
|
|
34
|
-
.token
|
|
35
|
-
.env
|
|
36
|
-
.env.*
|
|
37
|
-
!.env.example
|
|
38
|
-
|
|
39
|
-
# Editor and operating-system files
|
|
40
|
-
.vscode/
|
|
41
|
-
.idea/
|
|
42
|
-
.DS_Store
|
|
43
|
-
Thumbs.db
|
|
44
|
-
|
|
45
|
-
# Other
|
|
46
|
-
/target
|
|
1
|
+
# Python bytecode and caches
|
|
2
|
+
**/__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
.tox/
|
|
9
|
+
.nox/
|
|
10
|
+
.coverage
|
|
11
|
+
.coverage.*
|
|
12
|
+
htmlcov/
|
|
13
|
+
|
|
14
|
+
# Virtual environments and local Python configuration
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
.python-version
|
|
19
|
+
|
|
20
|
+
# Packaging and build artifacts
|
|
21
|
+
build/
|
|
22
|
+
dist/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
pip-wheel-metadata/
|
|
25
|
+
|
|
26
|
+
# Project-specific generated files and scratch content
|
|
27
|
+
/_out/
|
|
28
|
+
/test.py
|
|
29
|
+
/badges.txt
|
|
30
|
+
/hatch_build.py
|
|
31
|
+
/rust/
|
|
32
|
+
|
|
33
|
+
# Local secrets and environment files
|
|
34
|
+
.token
|
|
35
|
+
.env
|
|
36
|
+
.env.*
|
|
37
|
+
!.env.example
|
|
38
|
+
|
|
39
|
+
# Editor and operating-system files
|
|
40
|
+
.vscode/
|
|
41
|
+
.idea/
|
|
42
|
+
.DS_Store
|
|
43
|
+
Thumbs.db
|
|
44
|
+
|
|
45
|
+
# Other
|
|
46
|
+
/target
|
|
47
47
|
uv.lock
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
-
and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
-
diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
-
and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
-
overall community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
-
advances of any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
-
* Public or private harassment
|
|
34
|
-
* Publishing others' private information, such as a physical or email
|
|
35
|
-
address, without their explicit permission
|
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
-
professional setting
|
|
38
|
-
|
|
39
|
-
## Enforcement Responsibilities
|
|
40
|
-
|
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
-
or harmful.
|
|
45
|
-
|
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
-
decisions when appropriate.
|
|
50
|
-
|
|
51
|
-
## Scope
|
|
52
|
-
|
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public spaces.
|
|
55
|
-
Examples of representing our community include using an official e-mail address,
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
57
|
-
representative at an online or offline event.
|
|
58
|
-
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at
|
|
63
|
-
Telegram: @megawattka.
|
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
-
|
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
-
reporter of any incident.
|
|
68
|
-
|
|
69
|
-
## Enforcement Guidelines
|
|
70
|
-
|
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
-
|
|
74
|
-
### 1. Correction
|
|
75
|
-
|
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
-
unprofessional or unwelcome in the community.
|
|
78
|
-
|
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
|
82
|
-
|
|
83
|
-
### 2. Warning
|
|
84
|
-
|
|
85
|
-
**Community Impact**: A violation through a single incident or series
|
|
86
|
-
of actions.
|
|
87
|
-
|
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
-
like social media. Violating these terms may lead to a temporary or
|
|
93
|
-
permanent ban.
|
|
94
|
-
|
|
95
|
-
### 3. Temporary Ban
|
|
96
|
-
|
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
|
98
|
-
sustained inappropriate behavior.
|
|
99
|
-
|
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
-
communication with the community for a specified period of time. No public or
|
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
-
Violating these terms may lead to a permanent ban.
|
|
105
|
-
|
|
106
|
-
### 4. Permanent Ban
|
|
107
|
-
|
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
-
|
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
-
the community.
|
|
114
|
-
|
|
115
|
-
## Attribution
|
|
116
|
-
|
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
-
version 2.0, available at
|
|
119
|
-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
-
|
|
121
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
-
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
-
|
|
124
|
-
[homepage]: https://www.contributor-covenant.org
|
|
125
|
-
|
|
126
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
-
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
-
https://www.contributor-covenant.org/translations.
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
Telegram: @megawattka.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 megawattka
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, 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,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 megawattka
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, 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,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: kover
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: A fully asynchronous, strongly typed MongoDB driver for Python.
|
|
5
5
|
Project-URL: Homepage, https://github.com/megawattka/kover
|
|
6
6
|
Project-URL: Repository, https://github.com/megawattka/kover
|
|
@@ -9,24 +9,25 @@ Project-URL: Changelog, https://github.com/megawattka/kover/releases
|
|
|
9
9
|
Author-email: megawattka <gunter56741@gmail.com>
|
|
10
10
|
License-Expression: MIT
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Keywords: async,asyncio,bson,
|
|
12
|
+
Keywords: async,async-mongodb,asynchronous-database,asyncio,bson,geojson,gridfs,mongodb,mongodb-driver,mongodb-odm,motor-alternative,pydantic-mongodb,python-mongodb
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Framework :: AsyncIO
|
|
15
|
-
Classifier: Framework :: Pydantic
|
|
15
|
+
Classifier: Framework :: Pydantic
|
|
16
16
|
Classifier: Intended Audience :: Developers
|
|
17
17
|
Classifier: License :: OSI Approved :: MIT License
|
|
18
18
|
Classifier: Operating System :: OS Independent
|
|
19
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
22
|
Classifier: Topic :: Database
|
|
23
|
+
Classifier: Topic :: Database :: Database Engines/Servers
|
|
24
|
+
Classifier: Topic :: Internet
|
|
22
25
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
-
Classifier: Topic :: Software Development :: Quality Assurance
|
|
24
26
|
Classifier: Typing :: Typed
|
|
25
27
|
Requires-Python: >=3.12
|
|
26
|
-
Requires-Dist: bson>=0.4.0
|
|
27
28
|
Requires-Dist: dnspython>=2.7.0
|
|
29
|
+
Requires-Dist: elune>=0.5.0
|
|
28
30
|
Requires-Dist: pydantic>=2.14.3
|
|
29
|
-
Requires-Dist: typing-extensions>=4.16.0
|
|
30
31
|
Provides-Extra: snappy
|
|
31
32
|
Requires-Dist: python-snappy>=0.7.3; extra == 'snappy'
|
|
32
33
|
Provides-Extra: zstd
|
|
@@ -41,9 +42,37 @@ Description-Content-Type: text/markdown
|
|
|
41
42
|
[](https://pypi.org/project/kover/)
|
|
42
43
|
[](https://peps.python.org/pep-0561/)
|
|
43
44
|
|
|
44
|
-
**Kover
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
**Kover lets your Python application save, find, update, and delete data in
|
|
46
|
+
MongoDB using Python dictionaries or typed Pydantic models.**
|
|
47
|
+
|
|
48
|
+
For example, define a `User` model, save a user to the database, and read it
|
|
49
|
+
back as a `User` object with validated fields and editor autocomplete.
|
|
50
|
+
|
|
51
|
+
Use it for async applications such as a FastAPI backend storing users,
|
|
52
|
+
products, or messages. It requires Python **3.12+** and Pydantic **v2**.
|
|
53
|
+
|
|
54
|
+
### Where does Kover fit?
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
Your Python application (for example, a FastAPI backend)
|
|
58
|
+
→ Kover (validates models and sends database requests)
|
|
59
|
+
→ MongoDB (stores your data)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- **A MongoDB driver:** connects your application to MongoDB and runs database
|
|
63
|
+
operations asynchronously with `await`. No PyMongo or Motor dependency.
|
|
64
|
+
- **Pydantic integration:** define the shape of your data with Python classes,
|
|
65
|
+
validate it, and read database results back as model instances. Plain
|
|
66
|
+
dictionaries work too.
|
|
67
|
+
- **Optional database-side validation:** generate MongoDB validation rules
|
|
68
|
+
from your models so the database can reject invalid documents too.
|
|
69
|
+
|
|
70
|
+
Kover is a Python library, **not a database or a web framework**. You still
|
|
71
|
+
need a running MongoDB server, locally or hosted. It has its own API; it is
|
|
72
|
+
not a drop-in replacement for PyMongo or Motor.
|
|
73
|
+
|
|
74
|
+
Want to see it in an API? See the
|
|
75
|
+
[complete FastAPI CRUD application](https://github.com/megawattka/kover-fastapi-crud).
|
|
47
76
|
|
|
48
77
|
## Contents
|
|
49
78
|
|
|
@@ -63,6 +92,9 @@ for Python 3.12+. Networking uses `asyncio` streams and MongoDB's `OP_MSG` /
|
|
|
63
92
|
|
|
64
93
|
## Capabilities and requirements
|
|
65
94
|
|
|
95
|
+
Kover talks directly to MongoDB using `asyncio` streams and MongoDB's
|
|
96
|
+
`OP_MSG` / `OP_COMPRESSED` wire protocol, without thread-pool wrappers.
|
|
97
|
+
|
|
66
98
|
- Native asynchronous clients, per-server connection pools, and lazy cursors.
|
|
67
99
|
- All five read preference modes, ordered tag sets, max staleness, and latency windows.
|
|
68
100
|
- Pydantic `Document` models and strict MongoDB `$jsonSchema` generation.
|
|
@@ -78,31 +110,22 @@ Runtime dependencies:
|
|
|
78
110
|
|
|
79
111
|
| Dependency | Minimum version |
|
|
80
112
|
| --- | --- |
|
|
81
|
-
| `
|
|
113
|
+
| `elune` | `0.5.0` |
|
|
82
114
|
| `dnspython` | `2.7.0` |
|
|
83
115
|
| `pydantic` | `2.14.3` |
|
|
84
|
-
| `typing-extensions` | `4.16.0` |
|
|
85
116
|
|
|
86
|
-
Kover uses
|
|
87
|
-
including its native Pydantic integration.
|
|
88
|
-
it: both provide the `bson` import namespace.
|
|
117
|
+
Kover uses [Elune](https://github.com/megawattka/elune) for BSON serialization,
|
|
118
|
+
including its native Pydantic integration.
|
|
89
119
|
|
|
90
120
|
## Installation
|
|
91
121
|
|
|
92
|
-
|
|
122
|
+
Install Kover using pip:
|
|
93
123
|
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
bson = { index = "bson" }
|
|
97
|
-
|
|
98
|
-
[[tool.uv.index]]
|
|
99
|
-
name = "bson"
|
|
100
|
-
url = "https://python.wattka.dev/"
|
|
101
|
-
explicit = true
|
|
124
|
+
```bash
|
|
125
|
+
pip install kover
|
|
102
126
|
```
|
|
103
127
|
|
|
104
|
-
|
|
105
|
-
in its `pyproject.toml`, then add Kover:
|
|
128
|
+
Or using uv:
|
|
106
129
|
|
|
107
130
|
```bash
|
|
108
131
|
uv add kover
|
|
@@ -110,32 +133,55 @@ uv add kover
|
|
|
110
133
|
uv add "kover[snappy,zstd]"
|
|
111
134
|
```
|
|
112
135
|
|
|
113
|
-
`zlib` compression needs no extra dependency.
|
|
114
|
-
for packages mapped to it, rather than as a general package source.
|
|
136
|
+
`zlib` compression needs no extra dependency.
|
|
115
137
|
|
|
116
138
|
## Quick start
|
|
117
139
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
initial server discovery; application connections are opened lazily in pools.
|
|
140
|
+
With MongoDB running at `127.0.0.1:27017`, save this as `main.py` and run
|
|
141
|
+
`python main.py`. This example defines a user, saves it, and reads it back:
|
|
121
142
|
|
|
122
143
|
```python
|
|
123
144
|
import asyncio
|
|
124
145
|
|
|
125
|
-
from
|
|
146
|
+
from pydantic import Field
|
|
147
|
+
|
|
148
|
+
from kover import Document, from_uri
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class User(Document):
|
|
152
|
+
name: str
|
|
153
|
+
age: int = Field(ge=0)
|
|
126
154
|
|
|
127
155
|
|
|
128
156
|
async def main() -> None:
|
|
129
157
|
async with await from_uri("mongodb://127.0.0.1:27017/") as client:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
158
|
+
users = client.get_database("demo").get_collection("users")
|
|
159
|
+
|
|
160
|
+
# Validate the data with Pydantic, then save it to MongoDB.
|
|
161
|
+
user_id = await users.insert_one(User(name="Maksim", age=21))
|
|
162
|
+
|
|
163
|
+
# Read it back as a User object rather than a dictionary.
|
|
164
|
+
user = await users.find_one({"_id": user_id}, cls=User)
|
|
165
|
+
if user is not None:
|
|
166
|
+
print(user.name, user.age) # Maksim 21
|
|
133
167
|
|
|
134
168
|
|
|
135
169
|
if __name__ == "__main__":
|
|
136
170
|
asyncio.run(main())
|
|
137
171
|
```
|
|
138
172
|
|
|
173
|
+
`User(name="Maksim", age=-1)` raises a Pydantic validation error before any
|
|
174
|
+
database request. `cls=User` also validates documents when reading them back.
|
|
175
|
+
To enforce rules inside MongoDB itself, see
|
|
176
|
+
[MongoDB schema validation](#mongodb-schema-validation).
|
|
177
|
+
|
|
178
|
+
You can also pass dictionaries to `insert_one()` and omit `cls` when querying
|
|
179
|
+
to receive dictionaries instead. Each run of this example inserts a new user.
|
|
180
|
+
|
|
181
|
+
`from_uri()` and `make_client()` are **module-level factory functions** returning
|
|
182
|
+
a `Kover` client. They are not methods on the `Kover` class. Factories perform
|
|
183
|
+
initial server discovery; application connections are opened lazily in pools.
|
|
184
|
+
|
|
139
185
|
The remaining asynchronous snippets belong inside an async function. Unless a
|
|
140
186
|
snippet creates its own client, it assumes an open `client` and reuses models
|
|
141
187
|
and collection handles introduced earlier. Close clients with `async with`
|
|
@@ -281,7 +327,7 @@ Native UUIDs require an explicit BSON representation. Use this client for the
|
|
|
281
327
|
`User` schema and CRUD examples below:
|
|
282
328
|
|
|
283
329
|
```python
|
|
284
|
-
from
|
|
330
|
+
from elune import CodecOptions, UuidRepresentation
|
|
285
331
|
|
|
286
332
|
from kover import from_uri
|
|
287
333
|
|
|
@@ -306,7 +352,7 @@ UUIDs as binary subtype 4 and decodes them back to `UUID`. The default
|
|
|
306
352
|
| `Model.model_mongodb_schema()` | Generate a `{"$jsonSchema": ...}` validator |
|
|
307
353
|
|
|
308
354
|
```python
|
|
309
|
-
from
|
|
355
|
+
from elune import ObjectId
|
|
310
356
|
|
|
311
357
|
user = User(username="alice", age=27)
|
|
312
358
|
assert user.object_id is None
|
|
@@ -324,9 +370,9 @@ automatically converted to camelCase: declare aliases explicitly, as with
|
|
|
324
370
|
`externalId` above.
|
|
325
371
|
See [documents and serialization](docs/documents.md) for details.
|
|
326
372
|
|
|
327
|
-
Use Python-mode dumps for BSON, not `model_dump(mode="json")`.
|
|
328
|
-
Pydantic integration preserves BSON instances in Python mode.
|
|
329
|
-
globally patch
|
|
373
|
+
Use Python-mode dumps for BSON, not `model_dump(mode="json")`. Elune's native
|
|
374
|
+
Pydantic integration preserves BSON instances in Python mode.
|
|
375
|
+
Kover does not globally patch Elune's classes or `uuid.UUID`.
|
|
330
376
|
|
|
331
377
|
### Decimal values
|
|
332
378
|
|
|
@@ -335,10 +381,10 @@ produces a `decimal` schema, but `model_dump()` retains the Python `Decimal`;
|
|
|
335
381
|
it needs a codec or explicit conversion for BSON encoding.
|
|
336
382
|
|
|
337
383
|
For domain models using `Decimal`, prefer the `DecimalCodec` example in the
|
|
338
|
-
[
|
|
384
|
+
[Elune README](https://github.com/megawattka/elune#custom-codecs) over manual
|
|
339
385
|
conversion or model serializers. Define that codec in your application and
|
|
340
386
|
register it with `CodecOptions(type_registry=TypeRegistry([DecimalCodec()]))`
|
|
341
|
-
(`CodecOptions` and `TypeRegistry` are imported from `
|
|
387
|
+
(`CodecOptions` and `TypeRegistry` are imported from `elune.codec_options`).
|
|
342
388
|
Pass these options as `codec_options=` to `from_uri()` or `make_client()`;
|
|
343
389
|
if you also use UUIDs, include their representation in the same options.
|
|
344
390
|
The codec converts `Decimal` to BSON `Decimal128` on writes and back to
|
|
@@ -346,12 +392,12 @@ The codec converts `Decimal` to BSON `Decimal128` on writes and back to
|
|
|
346
392
|
fit the precision and range of Decimal128. `DecimalCodec` is an example to
|
|
347
393
|
define, not a built-in class to import.
|
|
348
394
|
|
|
349
|
-
Alternatively, use `
|
|
395
|
+
Alternatively, use `elune.Decimal128` directly for stored values:
|
|
350
396
|
|
|
351
397
|
```python
|
|
352
398
|
from decimal import Decimal
|
|
353
399
|
|
|
354
|
-
from
|
|
400
|
+
from elune import Decimal128
|
|
355
401
|
|
|
356
402
|
from kover import Document
|
|
357
403
|
|
|
@@ -569,6 +615,7 @@ Sharded tests are separately enabled by `KOVER_RUN_SHARDED=1`.
|
|
|
569
615
|
|
|
570
616
|
- [Architecture](docs/architecture.md)
|
|
571
617
|
- [Documents, IDs, serialization, and schema validation](docs/documents.md)
|
|
618
|
+
- [GeoJSON models, geospatial indexes, and queries](docs/geo_json.md)
|
|
572
619
|
- [Connections, authentication, pools, and deadlines](docs/connections.md)
|
|
573
620
|
- [Read preferences and routing limits](docs/read_preferences.md)
|
|
574
621
|
- [Transactions and session lifecycle](docs/transactions.md)
|