sqltypes 0.1.6__tar.gz → 0.1.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqltypes
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Custom types for SQLModel/SQLalchemy
5
5
  Author-email: Marcel Claramunt <marcel@marcelc.uk>
6
6
  Project-URL: repo, https://github.com/marciclabas/sqltypes.git
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sqltypes"
7
- version = "0.1.6"
7
+ version = "0.1.8"
8
8
  authors = [
9
9
  {name="Marcel Claramunt", email="marcel@marcelc.uk"}
10
10
  ]
@@ -1,9 +1,10 @@
1
1
  from .meta import CustomTypeMeta
2
- from .strings import SpaceDelimitedList, CustomStringMeta, ValidatedStr
2
+ from .strings import SpaceDelimitedList, CustomStringMeta, ValidatedStr, DecimalStr
3
3
  from .jsons import ValidatedJSON
4
4
 
5
5
  __all__ = [
6
6
  'CustomTypeMeta',
7
7
  'CustomStringMeta', 'SpaceDelimitedList',
8
8
  'ValidatedJSON', 'ValidatedStr',
9
+ 'DecimalStr',
9
10
  ]
@@ -1,4 +1,5 @@
1
1
  from typing import TypeVar, Callable
2
+ from decimal import Decimal
2
3
  from pydantic import TypeAdapter
3
4
  from sqlalchemy.types import TypeDecorator, String
4
5
  from .meta import CustomTypeMeta
@@ -21,4 +22,7 @@ class ValidatedStr(type):
21
22
  def parse(x: str):
22
23
  Type.validate_python(x)
23
24
  return x # type: ignore
24
- return CustomTypeMeta(LiteralType.__name__, (), {}, String, dump=dump, parse=parse)
25
+ return CustomTypeMeta(LiteralType.__name__, (), {}, String, dump=dump, parse=parse)
26
+
27
+ class DecimalStr(metaclass=CustomStringMeta, dump=str, parse=Decimal):
28
+ ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqltypes
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Custom types for SQLModel/SQLalchemy
5
5
  Author-email: Marcel Claramunt <marcel@marcelc.uk>
6
6
  Project-URL: repo, https://github.com/marciclabas/sqltypes.git
File without changes
File without changes
File without changes
File without changes