sera-2 1.4.2__tar.gz → 1.4.3__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.
Files changed (30) hide show
  1. {sera_2-1.4.2 → sera_2-1.4.3}/PKG-INFO +3 -1
  2. {sera_2-1.4.2 → sera_2-1.4.3}/pyproject.toml +3 -1
  3. {sera_2-1.4.2 → sera_2-1.4.3}/sera/misc/__init__.py +0 -3
  4. sera_2-1.4.2/sera/misc/_rdf.py +0 -60
  5. sera_2-1.4.2/sera/namespace.py +0 -5
  6. {sera_2-1.4.2 → sera_2-1.4.3}/README.md +0 -0
  7. {sera_2-1.4.2 → sera_2-1.4.3}/sera/__init__.py +0 -0
  8. {sera_2-1.4.2 → sera_2-1.4.3}/sera/constants.py +0 -0
  9. {sera_2-1.4.2 → sera_2-1.4.3}/sera/libs/__init__.py +0 -0
  10. {sera_2-1.4.2 → sera_2-1.4.3}/sera/libs/api_helper.py +0 -0
  11. {sera_2-1.4.2 → sera_2-1.4.3}/sera/libs/base_orm.py +0 -0
  12. {sera_2-1.4.2 → sera_2-1.4.3}/sera/libs/base_service.py +0 -0
  13. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/__init__.py +0 -0
  14. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/__main__.py +0 -0
  15. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/make_app.py +0 -0
  16. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/make_python_api.py +0 -0
  17. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/make_python_model.py +0 -0
  18. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/make_python_services.py +0 -0
  19. {sera_2-1.4.2 → sera_2-1.4.3}/sera/make/make_typescript_model.py +0 -0
  20. {sera_2-1.4.2 → sera_2-1.4.3}/sera/misc/_utils.py +0 -0
  21. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/__init__.py +0 -0
  22. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_class.py +0 -0
  23. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_collection.py +0 -0
  24. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_datatype.py +0 -0
  25. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_module.py +0 -0
  26. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_multi_lingual_string.py +0 -0
  27. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_parse.py +0 -0
  28. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_property.py +0 -0
  29. {sera_2-1.4.2 → sera_2-1.4.3}/sera/models/_schema.py +0 -0
  30. {sera_2-1.4.2 → sera_2-1.4.3}/sera/typing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sera-2
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary:
5
5
  Author: Binh Vu
6
6
  Author-email: bvu687@gmail.com
@@ -10,7 +10,9 @@ Classifier: Programming Language :: Python :: 3.12
10
10
  Classifier: Programming Language :: Python :: 3.13
11
11
  Requires-Dist: codegen-2 (>=2.1.4,<3.0.0)
12
12
  Requires-Dist: litestar (>=2.15.1,<3.0.0)
13
+ Requires-Dist: loguru (>=0.7.0,<0.8.0)
13
14
  Requires-Dist: msgspec (>=0.19.0,<0.20.0)
15
+ Requires-Dist: typer (>=0.12.3,<0.13.0)
14
16
  Project-URL: Repository, https://github.com/binh-vu/sera
15
17
  Description-Content-Type: text/markdown
16
18
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sera-2"
3
- version = "1.4.2"
3
+ version = "1.4.3"
4
4
  description = ""
5
5
  authors = ["Binh Vu <bvu687@gmail.com>"]
6
6
  readme = "README.md"
@@ -12,6 +12,8 @@ python = "^3.12"
12
12
  codegen-2 = "^2.1.4"
13
13
  msgspec = "^0.19.0"
14
14
  litestar = "^2.15.1"
15
+ loguru = "^0.7.0"
16
+ typer = "^0.12.3"
15
17
 
16
18
  [build-system]
17
19
  requires = ["poetry-core"]
@@ -1,4 +1,3 @@
1
- from sera.misc._rdf import SingleNS, Term
2
1
  from sera.misc._utils import (
3
2
  assert_isinstance,
4
3
  assert_not_null,
@@ -9,8 +8,6 @@ from sera.misc._utils import (
9
8
  )
10
9
 
11
10
  __all__ = [
12
- "SingleNS",
13
- "Term",
14
11
  "to_snake_case",
15
12
  "assert_isinstance",
16
13
  "filter_duplication",
@@ -1,60 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from dataclasses import dataclass, field
4
- from functools import cached_property
5
- from typing import Iterable
6
-
7
- from rdflib import OWL, RDF, RDFS, SKOS, XSD, Graph, URIRef
8
- from rdflib.namespace import NamespaceManager
9
- from sm.typing import IRI, InternalID, RelIRI
10
-
11
-
12
- @dataclass
13
- class SingleNS:
14
- alias: str
15
- namespace: str
16
-
17
- def __post_init__(self):
18
- assert self.namespace.endswith("/") or self.namespace.endswith(
19
- "#"
20
- ), f"Namespace {self.namespace} should end with / or #"
21
-
22
- def term(self, name: str) -> Term:
23
- return Term(self, name)
24
-
25
- def id(self, uri: IRI | URIRef) -> str:
26
- assert uri.startswith(self.namespace), (uri, self.namespace)
27
- return uri[len(self.namespace) :]
28
-
29
- def uri(self, name: InternalID) -> URIRef:
30
- return URIRef(self.namespace + name)
31
-
32
- def uristr(self, name: InternalID) -> IRI:
33
- return self.namespace + name
34
-
35
- def __getattr__(self, name: InternalID):
36
- return self.alias + ":" + name
37
-
38
- def __getitem__(self, name: InternalID):
39
- return self.alias + ":" + name
40
-
41
- def __contains__(self, uri: IRI | URIRef) -> bool:
42
- return uri.startswith(self.namespace)
43
-
44
- def rel2abs(self, reluri: RelIRI) -> URIRef:
45
- return URIRef(self.namespace + reluri.split(":")[1])
46
-
47
- def abs2rel(self, uri: IRI | URIRef) -> RelIRI:
48
- return self.alias + ":" + self.id(uri)
49
-
50
-
51
- @dataclass
52
- class Term:
53
- ns: SingleNS
54
- name: str
55
- reluri: str = field(init=False)
56
- uri: URIRef = field(init=False)
57
-
58
- def __post_init__(self):
59
- self.reluri = self.ns[self.name]
60
- self.uri = self.ns.uri(self.name)
@@ -1,5 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from sera.misc import SingleNS
4
-
5
- APP_NS = SingleNS("app", "https://purl.org/sera/1.0/")
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