patito 0.4.4__py3-none-any.whl → 0.5.0__py3-none-any.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.
- patito/__init__.py +12 -6
- patito/database.py +658 -0
- patito/duckdb.py +142 -179
- patito/polars.py +36 -44
- patito/pydantic.py +96 -85
- patito/sql.py +1 -2
- patito/validators.py +87 -1
- patito/xdg.py +22 -0
- {patito-0.4.4.dist-info → patito-0.5.0.dist-info}/LICENSE +1 -0
- {patito-0.4.4.dist-info → patito-0.5.0.dist-info}/METADATA +16 -16
- patito-0.5.0.dist-info/RECORD +14 -0
- {patito-0.4.4.dist-info → patito-0.5.0.dist-info}/WHEEL +1 -1
- patito-0.4.4.dist-info/RECORD +0 -12
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: patito
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: A dataframe modelling library built on top of polars and pydantic.
|
|
5
5
|
Home-page: https://github.com/kolonialno/patito
|
|
6
6
|
License: MIT
|
|
7
7
|
Keywords: validation,dataframe
|
|
8
8
|
Author: Jakob Gerhard Martinussen
|
|
9
9
|
Author-email: jakobgm@gmail.com
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.8,<4.0
|
|
11
11
|
Classifier: License :: OSI Approved :: MIT License
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Provides-Extra: caching
|
|
18
18
|
Provides-Extra: docs
|
|
19
19
|
Provides-Extra: duckdb
|
|
20
20
|
Provides-Extra: pandas
|
|
21
|
-
Requires-Dist: Sphinx; extra == "docs"
|
|
22
|
-
Requires-Dist: duckdb (>=0.6.0); (python_version >= "3.8" and python_version < "4.0") and (extra == "duckdb")
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist: pyarrow (>=5.0.0); (python_version >= "3.8" and python_version < "4.0") and (extra == "duckdb")
|
|
21
|
+
Requires-Dist: Sphinx (<7) ; extra == "docs"
|
|
22
|
+
Requires-Dist: duckdb (>=0.6.0) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "duckdb")
|
|
23
|
+
Requires-Dist: pandas ; (python_version >= "3.8" and python_version < "4.0") and (extra == "pandas")
|
|
24
|
+
Requires-Dist: polars (>=0.18.3)
|
|
25
|
+
Requires-Dist: pyarrow (>=5.0.0) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "caching" or extra == "duckdb")
|
|
27
26
|
Requires-Dist: pydantic (>=1.7.0)
|
|
28
|
-
Requires-Dist: sphinx-autobuild; extra == "docs"
|
|
29
|
-
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
|
|
30
|
-
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
|
31
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: sphinx-autobuild ; extra == "docs"
|
|
28
|
+
Requires-Dist: sphinx-autodoc-typehints ; extra == "docs"
|
|
29
|
+
Requires-Dist: sphinx-rtd-theme ; extra == "docs"
|
|
30
|
+
Requires-Dist: sphinx-toolbox ; extra == "docs"
|
|
31
|
+
Requires-Dist: sphinxcontrib-mermaid ; extra == "docs"
|
|
32
32
|
Requires-Dist: typing-extensions
|
|
33
33
|
Project-URL: Documentation, https://patito.readthedocs.io
|
|
34
34
|
Project-URL: Repository, https://github.com/kolonialno/patito
|
|
@@ -285,7 +285,7 @@ class Product(pt.Model):
|
|
|
285
285
|
@property
|
|
286
286
|
def url(self) -> str:
|
|
287
287
|
return (
|
|
288
|
-
"https://
|
|
288
|
+
"https://example.com/no/products/"
|
|
289
289
|
f"{self.product_id}-"
|
|
290
290
|
f"{self.name.lower().replace(' ', '-')}"
|
|
291
291
|
)
|
|
@@ -303,7 +303,7 @@ products = pl.DataFrame(
|
|
|
303
303
|
milk_row = products.filter(pl.col("product_id" == 1))
|
|
304
304
|
milk = Product.from_row(milk_row)
|
|
305
305
|
print(milk.url)
|
|
306
|
-
# https://
|
|
306
|
+
# https://example.com/no/products/1-skimmed-milk
|
|
307
307
|
```
|
|
308
308
|
|
|
309
309
|
If you "connect" the `Product` model with the `DataFrame` by the use of `patito.DataFrame.set_model()`, or alternatively by using `Product.DataFrame` directly, you can use the `.get()` method in order to filter the data frame down to a single row _and_ cast it to the respective model class:
|
|
@@ -318,6 +318,6 @@ products = Product.DataFrame(
|
|
|
318
318
|
)
|
|
319
319
|
milk = products.get(pl.col("product_id") == 1)
|
|
320
320
|
print(milk.url)
|
|
321
|
-
# https://
|
|
321
|
+
# https://example.com/no/products/1-skimmed-milk
|
|
322
322
|
```
|
|
323
323
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
patito/__init__.py,sha256=J-p3aBiyNGdsyHxViEsP1C6bE-OxtxAul7xSA1xXpIE,1169
|
|
2
|
+
patito/_docs.py,sha256=bobkmo8-RRdz80_KY53y_i1Gcp1WWTH5-D5ZHGidpok,161
|
|
3
|
+
patito/database.py,sha256=IaxbsmyQMzL3KzvJUq0tgVGUxdr55KEv-wd1X673U2o,27917
|
|
4
|
+
patito/duckdb.py,sha256=MnC4C7m3epXODz_eYBLqb7dTAcOh2o1Y8BViPoPKTaA,111015
|
|
5
|
+
patito/exceptions.py,sha256=4WuaQJoc5wLUehhBRQPvL59LVFLcn_K806Z9fg0KBss,1262
|
|
6
|
+
patito/polars.py,sha256=oFS8In6cUiKQu-QclkJ1Egxbf2HF2SlbTF76bcyE4Vo,26161
|
|
7
|
+
patito/pydantic.py,sha256=HKQ6dfeeJCq1xaVJbqfo5UpF-WI_jBEaDRAy2tLnvtM,54832
|
|
8
|
+
patito/sql.py,sha256=_xmvVfC1kUUq2d8KTBPExJmfZ9ec6uoMfZv52naFFkY,3218
|
|
9
|
+
patito/validators.py,sha256=D5hdCfAc1rv15FwQILSmaZNZ5j88QfYUYZ37GMwgvQU,10659
|
|
10
|
+
patito/xdg.py,sha256=3EcUGcYBBUX2Secegajb4DB2QgAHNPs6oi0tMsL--UQ,686
|
|
11
|
+
patito-0.5.0.dist-info/LICENSE,sha256=3bc4YyuF0e5nd59E3CsR8QM1Ua7pqKfC9DD1LVBVMs4,1139
|
|
12
|
+
patito-0.5.0.dist-info/METADATA,sha256=K16UBKdqYnZfDmVdVqUuMc3AqknsaAmWfgljNVg0q_g,14562
|
|
13
|
+
patito-0.5.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
14
|
+
patito-0.5.0.dist-info/RECORD,,
|
patito-0.4.4.dist-info/RECORD
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
patito/__init__.py,sha256=BSTuaflPBdcoJKJTMGDAa7fvoJVduWb28N6Fnw_Gpns,1079
|
|
2
|
-
patito/_docs.py,sha256=bobkmo8-RRdz80_KY53y_i1Gcp1WWTH5-D5ZHGidpok,161
|
|
3
|
-
patito/duckdb.py,sha256=I-KZ41R1nXI4F1J5LT-irLDV8dmuGEdEnKLgKHby3NY,113624
|
|
4
|
-
patito/exceptions.py,sha256=4WuaQJoc5wLUehhBRQPvL59LVFLcn_K806Z9fg0KBss,1262
|
|
5
|
-
patito/polars.py,sha256=U-yeFvp2umYRA_Ih76i9IQzsOVyq1hk278Fv_8bMMrI,26850
|
|
6
|
-
patito/pydantic.py,sha256=Ofr6z_05RdZsvbOjV8NiyG83_DOgBtY0-H5sl01OEW4,55016
|
|
7
|
-
patito/sql.py,sha256=XB9T6HB1q0SYEKP4f3-ljyt-Oa_IGaaOpGx6pqLLXxw,3263
|
|
8
|
-
patito/validators.py,sha256=YhDMgua8c7Hs97pmscX3vIs-kqzq3vrAjAomYR42IfI,8061
|
|
9
|
-
patito-0.4.4.dist-info/LICENSE,sha256=0LkhXGFNXIt9gW0zs6_9YZynb4DDt3OZaRXz7DpD0qQ,1077
|
|
10
|
-
patito-0.4.4.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
|
|
11
|
-
patito-0.4.4.dist-info/METADATA,sha256=6pOuKKEIydr_WhOW7_LSibpAYOTdoAPfw7XGP4KZdPU,14551
|
|
12
|
-
patito-0.4.4.dist-info/RECORD,,
|