rusty-haystack 0.2.9__tar.gz → 0.3.1__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.
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/Cargo.lock +85 -85
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/Cargo.toml +1 -1
- rusty_haystack-0.3.1/PKG-INFO +116 -0
- rusty_haystack-0.3.1/README.md +96 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/Cargo.toml +4 -1
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/pyproject.toml +3 -2
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/Cargo.toml +2 -1
- rusty_haystack-0.3.1/rusty-haystack/README.md +96 -0
- rusty_haystack-0.2.9/PKG-INFO +0 -17
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/benches/benchmarks.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/defs.trio +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/tz_map.txt +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/units.txt +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.attrs.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.equips.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.examples.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.points.elec.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.points.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.protocols.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/ph.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/sys.api.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/sys.comp.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/sys.files.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/sys.template.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/data/xeto/sys.xeto +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/auth.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/csv.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/json/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/json/v3.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/json/v4.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/rdf.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/shared.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/trio/encoder.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/trio/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/trio/parser.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/zinc/encoder.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/zinc/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/codecs/zinc/parser.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/data/dict.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/data/grid.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/data/list.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/data/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/filter/ast.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/filter/eval.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/filter/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/filter/parser.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/adjacency.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/bitmap.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/changelog.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/entity_graph.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/query_planner.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/graph/shared.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/coord.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/datetime.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/kind.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/number.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/ref_.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/singletons.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/symbol.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/tz.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/units.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/uri.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/kinds/xstr.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/lib.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/conjunct.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/def.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/lib.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/namespace.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/taxonomy.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/trio_loader.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/ontology/validation.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/ast.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/bundled.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/export.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/fitting.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/lexer.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/loader.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/mod.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/parser.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/resolver.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/src/xeto/spec.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/tests/e2e.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/tests/graph_integration.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/haystack-core/tests/ontology_integration.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/codecs.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/convert.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/data.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/filter.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/graph.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/kinds.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/lib.rs +0 -0
- {rusty_haystack-0.2.9 → rusty_haystack-0.3.1}/rusty-haystack/src/ontology.rs +0 -0
|
@@ -958,89 +958,6 @@ version = "0.16.1"
|
|
|
958
958
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
959
959
|
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
|
960
960
|
|
|
961
|
-
[[package]]
|
|
962
|
-
name = "haystack-cli"
|
|
963
|
-
version = "0.2.9"
|
|
964
|
-
dependencies = [
|
|
965
|
-
"clap",
|
|
966
|
-
"haystack-client",
|
|
967
|
-
"haystack-core",
|
|
968
|
-
"haystack-server",
|
|
969
|
-
"serde",
|
|
970
|
-
"tokio",
|
|
971
|
-
"toml",
|
|
972
|
-
]
|
|
973
|
-
|
|
974
|
-
[[package]]
|
|
975
|
-
name = "haystack-client"
|
|
976
|
-
version = "0.2.9"
|
|
977
|
-
dependencies = [
|
|
978
|
-
"base64",
|
|
979
|
-
"futures-util",
|
|
980
|
-
"haystack-core",
|
|
981
|
-
"log",
|
|
982
|
-
"reqwest",
|
|
983
|
-
"serde",
|
|
984
|
-
"serde_json",
|
|
985
|
-
"thiserror",
|
|
986
|
-
"tokio",
|
|
987
|
-
"tokio-tungstenite",
|
|
988
|
-
"url",
|
|
989
|
-
]
|
|
990
|
-
|
|
991
|
-
[[package]]
|
|
992
|
-
name = "haystack-core"
|
|
993
|
-
version = "0.2.9"
|
|
994
|
-
dependencies = [
|
|
995
|
-
"base64",
|
|
996
|
-
"chrono",
|
|
997
|
-
"criterion",
|
|
998
|
-
"dashmap",
|
|
999
|
-
"hmac",
|
|
1000
|
-
"parking_lot",
|
|
1001
|
-
"pbkdf2",
|
|
1002
|
-
"proptest",
|
|
1003
|
-
"rand 0.9.2",
|
|
1004
|
-
"regex",
|
|
1005
|
-
"serde",
|
|
1006
|
-
"serde_json",
|
|
1007
|
-
"sha2",
|
|
1008
|
-
"slotmap",
|
|
1009
|
-
"smallvec",
|
|
1010
|
-
"subtle",
|
|
1011
|
-
"test-case",
|
|
1012
|
-
"thiserror",
|
|
1013
|
-
"tokio",
|
|
1014
|
-
]
|
|
1015
|
-
|
|
1016
|
-
[[package]]
|
|
1017
|
-
name = "haystack-server"
|
|
1018
|
-
version = "0.2.9"
|
|
1019
|
-
dependencies = [
|
|
1020
|
-
"actix-http",
|
|
1021
|
-
"actix-rt",
|
|
1022
|
-
"actix-web",
|
|
1023
|
-
"actix-ws",
|
|
1024
|
-
"base64",
|
|
1025
|
-
"chrono",
|
|
1026
|
-
"criterion",
|
|
1027
|
-
"env_logger",
|
|
1028
|
-
"futures-util",
|
|
1029
|
-
"haystack-client",
|
|
1030
|
-
"haystack-core",
|
|
1031
|
-
"hmac",
|
|
1032
|
-
"log",
|
|
1033
|
-
"parking_lot",
|
|
1034
|
-
"rand 0.9.2",
|
|
1035
|
-
"serde",
|
|
1036
|
-
"serde_json",
|
|
1037
|
-
"sha2",
|
|
1038
|
-
"time",
|
|
1039
|
-
"tokio",
|
|
1040
|
-
"toml",
|
|
1041
|
-
"uuid",
|
|
1042
|
-
]
|
|
1043
|
-
|
|
1044
961
|
[[package]]
|
|
1045
962
|
name = "heck"
|
|
1046
963
|
version = "0.5.0"
|
|
@@ -2155,11 +2072,94 @@ dependencies = [
|
|
|
2155
2072
|
|
|
2156
2073
|
[[package]]
|
|
2157
2074
|
name = "rusty-haystack"
|
|
2158
|
-
version = "0.
|
|
2075
|
+
version = "0.3.1"
|
|
2159
2076
|
dependencies = [
|
|
2160
2077
|
"chrono",
|
|
2161
|
-
"haystack-core",
|
|
2162
2078
|
"pyo3",
|
|
2079
|
+
"rusty-haystack-core",
|
|
2080
|
+
]
|
|
2081
|
+
|
|
2082
|
+
[[package]]
|
|
2083
|
+
name = "rusty-haystack-cli"
|
|
2084
|
+
version = "0.3.1"
|
|
2085
|
+
dependencies = [
|
|
2086
|
+
"clap",
|
|
2087
|
+
"rusty-haystack-client",
|
|
2088
|
+
"rusty-haystack-core",
|
|
2089
|
+
"rusty-haystack-server",
|
|
2090
|
+
"serde",
|
|
2091
|
+
"tokio",
|
|
2092
|
+
"toml",
|
|
2093
|
+
]
|
|
2094
|
+
|
|
2095
|
+
[[package]]
|
|
2096
|
+
name = "rusty-haystack-client"
|
|
2097
|
+
version = "0.3.1"
|
|
2098
|
+
dependencies = [
|
|
2099
|
+
"base64",
|
|
2100
|
+
"futures-util",
|
|
2101
|
+
"log",
|
|
2102
|
+
"reqwest",
|
|
2103
|
+
"rusty-haystack-core",
|
|
2104
|
+
"serde",
|
|
2105
|
+
"serde_json",
|
|
2106
|
+
"thiserror",
|
|
2107
|
+
"tokio",
|
|
2108
|
+
"tokio-tungstenite",
|
|
2109
|
+
"url",
|
|
2110
|
+
]
|
|
2111
|
+
|
|
2112
|
+
[[package]]
|
|
2113
|
+
name = "rusty-haystack-core"
|
|
2114
|
+
version = "0.3.1"
|
|
2115
|
+
dependencies = [
|
|
2116
|
+
"base64",
|
|
2117
|
+
"chrono",
|
|
2118
|
+
"criterion",
|
|
2119
|
+
"dashmap",
|
|
2120
|
+
"hmac",
|
|
2121
|
+
"parking_lot",
|
|
2122
|
+
"pbkdf2",
|
|
2123
|
+
"proptest",
|
|
2124
|
+
"rand 0.9.2",
|
|
2125
|
+
"regex",
|
|
2126
|
+
"serde",
|
|
2127
|
+
"serde_json",
|
|
2128
|
+
"sha2",
|
|
2129
|
+
"slotmap",
|
|
2130
|
+
"smallvec",
|
|
2131
|
+
"subtle",
|
|
2132
|
+
"test-case",
|
|
2133
|
+
"thiserror",
|
|
2134
|
+
"tokio",
|
|
2135
|
+
]
|
|
2136
|
+
|
|
2137
|
+
[[package]]
|
|
2138
|
+
name = "rusty-haystack-server"
|
|
2139
|
+
version = "0.3.1"
|
|
2140
|
+
dependencies = [
|
|
2141
|
+
"actix-http",
|
|
2142
|
+
"actix-rt",
|
|
2143
|
+
"actix-web",
|
|
2144
|
+
"actix-ws",
|
|
2145
|
+
"base64",
|
|
2146
|
+
"chrono",
|
|
2147
|
+
"criterion",
|
|
2148
|
+
"env_logger",
|
|
2149
|
+
"futures-util",
|
|
2150
|
+
"hmac",
|
|
2151
|
+
"log",
|
|
2152
|
+
"parking_lot",
|
|
2153
|
+
"rand 0.9.2",
|
|
2154
|
+
"rusty-haystack-client",
|
|
2155
|
+
"rusty-haystack-core",
|
|
2156
|
+
"serde",
|
|
2157
|
+
"serde_json",
|
|
2158
|
+
"sha2",
|
|
2159
|
+
"time",
|
|
2160
|
+
"tokio",
|
|
2161
|
+
"toml",
|
|
2162
|
+
"uuid",
|
|
2163
2163
|
]
|
|
2164
2164
|
|
|
2165
2165
|
[[package]]
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rusty-haystack
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
11
|
+
Summary: Fast Python bindings for Project Haystack — types, codecs (Zinc/Trio/JSON), filters, ontology, and Xeto support powered by Rust
|
|
12
|
+
Keywords: haystack,iot,building-automation,smart-buildings
|
|
13
|
+
Author-email: Justin Scott <jscott3201@gmail.com>
|
|
14
|
+
License: MIT
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
17
|
+
Project-URL: Homepage, https://github.com/justinscott/rusty-haystack
|
|
18
|
+
Project-URL: Repository, https://github.com/justinscott/rusty-haystack
|
|
19
|
+
|
|
20
|
+
# rusty-haystack
|
|
21
|
+
|
|
22
|
+
Fast Python bindings for [Project Haystack](https://project-haystack.org) powered by Rust.
|
|
23
|
+
|
|
24
|
+
Provides types, codecs (Zinc/Trio/JSON/JSON v3/CSV), filters, an in-memory entity graph, ontology validation, and Xeto support — all backed by a native Rust core for speed and correctness.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pip install rusty-haystack
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Requires Python 3.11+. Pre-built wheels are available for Linux and macOS (x86_64 and aarch64).
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
import rusty_haystack as rh
|
|
38
|
+
|
|
39
|
+
# Create an entity
|
|
40
|
+
entity = rh.HDict({
|
|
41
|
+
"id": rh.Ref("site-1", "Demo Site"),
|
|
42
|
+
"site": rh.Marker(),
|
|
43
|
+
"dis": "Demo Site",
|
|
44
|
+
"area": rh.Number(5000, "ft²"),
|
|
45
|
+
"geoCoord": rh.Coord(40.7128, -74.0060),
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
# Build a graph and query it
|
|
49
|
+
graph = rh.EntityGraph()
|
|
50
|
+
graph.add(entity)
|
|
51
|
+
results = graph.read("site")
|
|
52
|
+
|
|
53
|
+
# Encode/decode across formats
|
|
54
|
+
zinc_str = rh.encode_grid("text/zinc", results)
|
|
55
|
+
json_str = rh.encode_grid("application/json", results)
|
|
56
|
+
decoded = rh.decode_grid("text/zinc", zinc_str)
|
|
57
|
+
|
|
58
|
+
# Validate against the standard ontology
|
|
59
|
+
ns = rh.DefNamespace.load_standard()
|
|
60
|
+
issues = ns.validate_entity(entity)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Features
|
|
64
|
+
|
|
65
|
+
- **Kind types** — Marker, NA, Remove, Number (with units), Ref, Uri, Symbol, XStr, Coord, HDateTime, HDict, HGrid, HList
|
|
66
|
+
- **Codecs** — Zinc, Trio, JSON, JSON v3, CSV encoding and decoding
|
|
67
|
+
- **Filters** — Parse and evaluate Haystack filter expressions against entities
|
|
68
|
+
- **EntityGraph** — In-memory graph with CRUD, filter queries, and ref traversal
|
|
69
|
+
- **Ontology** — DefNamespace with `is_a`, `fits`, `validate_entity`, subtype/supertype queries
|
|
70
|
+
- **Xeto** — Load/unload Xeto libraries, inspect specs and slots, export to Xeto source
|
|
71
|
+
|
|
72
|
+
## Codecs
|
|
73
|
+
|
|
74
|
+
Supported MIME types: `"text/zinc"`, `"text/trio"`, `"application/json"`, `"application/json;v=3"`, `"text/csv"`.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
# Grid encode/decode
|
|
78
|
+
zinc_str = rh.encode_grid("text/zinc", grid)
|
|
79
|
+
grid = rh.decode_grid("text/zinc", zinc_str)
|
|
80
|
+
|
|
81
|
+
# Scalar encode/decode
|
|
82
|
+
s = rh.encode_scalar("text/zinc", rh.Number(72.5, "°F"))
|
|
83
|
+
v = rh.decode_scalar("text/zinc", s)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## EntityGraph
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
graph = rh.EntityGraph()
|
|
90
|
+
graph.add(rh.HDict({"id": rh.Ref("site-1"), "site": rh.Marker(), "dis": "HQ"}))
|
|
91
|
+
graph.add(rh.HDict({"id": rh.Ref("ahu-1"), "equip": rh.Marker(), "siteRef": rh.Ref("site-1")}))
|
|
92
|
+
|
|
93
|
+
results = graph.read("equip") # filter query
|
|
94
|
+
graph.refs_from("ahu-1") # -> ["site-1"]
|
|
95
|
+
graph.refs_to("site-1") # -> ["ahu-1"]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Ontology & Xeto
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
ns = rh.DefNamespace.load_standard()
|
|
102
|
+
|
|
103
|
+
ns.is_a("ahu", "equip") # True
|
|
104
|
+
ns.fits(entity, "site") # True
|
|
105
|
+
ns.subtypes("equip") # ["ahu", "vav", ...]
|
|
106
|
+
ns.validate_entity(entity) # list of issue strings
|
|
107
|
+
|
|
108
|
+
# Load custom Xeto libraries
|
|
109
|
+
ns.load_xeto(source_text, "myLib")
|
|
110
|
+
spec = ns.get_spec("myLib::MyType")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|
|
116
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# rusty-haystack
|
|
2
|
+
|
|
3
|
+
Fast Python bindings for [Project Haystack](https://project-haystack.org) powered by Rust.
|
|
4
|
+
|
|
5
|
+
Provides types, codecs (Zinc/Trio/JSON/JSON v3/CSV), filters, an in-memory entity graph, ontology validation, and Xeto support — all backed by a native Rust core for speed and correctness.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install rusty-haystack
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Python 3.11+. Pre-built wheels are available for Linux and macOS (x86_64 and aarch64).
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import rusty_haystack as rh
|
|
19
|
+
|
|
20
|
+
# Create an entity
|
|
21
|
+
entity = rh.HDict({
|
|
22
|
+
"id": rh.Ref("site-1", "Demo Site"),
|
|
23
|
+
"site": rh.Marker(),
|
|
24
|
+
"dis": "Demo Site",
|
|
25
|
+
"area": rh.Number(5000, "ft²"),
|
|
26
|
+
"geoCoord": rh.Coord(40.7128, -74.0060),
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
# Build a graph and query it
|
|
30
|
+
graph = rh.EntityGraph()
|
|
31
|
+
graph.add(entity)
|
|
32
|
+
results = graph.read("site")
|
|
33
|
+
|
|
34
|
+
# Encode/decode across formats
|
|
35
|
+
zinc_str = rh.encode_grid("text/zinc", results)
|
|
36
|
+
json_str = rh.encode_grid("application/json", results)
|
|
37
|
+
decoded = rh.decode_grid("text/zinc", zinc_str)
|
|
38
|
+
|
|
39
|
+
# Validate against the standard ontology
|
|
40
|
+
ns = rh.DefNamespace.load_standard()
|
|
41
|
+
issues = ns.validate_entity(entity)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- **Kind types** — Marker, NA, Remove, Number (with units), Ref, Uri, Symbol, XStr, Coord, HDateTime, HDict, HGrid, HList
|
|
47
|
+
- **Codecs** — Zinc, Trio, JSON, JSON v3, CSV encoding and decoding
|
|
48
|
+
- **Filters** — Parse and evaluate Haystack filter expressions against entities
|
|
49
|
+
- **EntityGraph** — In-memory graph with CRUD, filter queries, and ref traversal
|
|
50
|
+
- **Ontology** — DefNamespace with `is_a`, `fits`, `validate_entity`, subtype/supertype queries
|
|
51
|
+
- **Xeto** — Load/unload Xeto libraries, inspect specs and slots, export to Xeto source
|
|
52
|
+
|
|
53
|
+
## Codecs
|
|
54
|
+
|
|
55
|
+
Supported MIME types: `"text/zinc"`, `"text/trio"`, `"application/json"`, `"application/json;v=3"`, `"text/csv"`.
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# Grid encode/decode
|
|
59
|
+
zinc_str = rh.encode_grid("text/zinc", grid)
|
|
60
|
+
grid = rh.decode_grid("text/zinc", zinc_str)
|
|
61
|
+
|
|
62
|
+
# Scalar encode/decode
|
|
63
|
+
s = rh.encode_scalar("text/zinc", rh.Number(72.5, "°F"))
|
|
64
|
+
v = rh.decode_scalar("text/zinc", s)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## EntityGraph
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
graph = rh.EntityGraph()
|
|
71
|
+
graph.add(rh.HDict({"id": rh.Ref("site-1"), "site": rh.Marker(), "dis": "HQ"}))
|
|
72
|
+
graph.add(rh.HDict({"id": rh.Ref("ahu-1"), "equip": rh.Marker(), "siteRef": rh.Ref("site-1")}))
|
|
73
|
+
|
|
74
|
+
results = graph.read("equip") # filter query
|
|
75
|
+
graph.refs_from("ahu-1") # -> ["site-1"]
|
|
76
|
+
graph.refs_to("site-1") # -> ["ahu-1"]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Ontology & Xeto
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
ns = rh.DefNamespace.load_standard()
|
|
83
|
+
|
|
84
|
+
ns.is_a("ahu", "equip") # True
|
|
85
|
+
ns.fits(entity, "site") # True
|
|
86
|
+
ns.subtypes("equip") # ["ahu", "vav", ...]
|
|
87
|
+
ns.validate_entity(entity) # list of issue strings
|
|
88
|
+
|
|
89
|
+
# Load custom Xeto libraries
|
|
90
|
+
ns.load_xeto(source_text, "myLib")
|
|
91
|
+
spec = ns.get_spec("myLib::MyType")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[package]
|
|
2
|
-
name = "haystack-core"
|
|
2
|
+
name = "rusty-haystack-core"
|
|
3
3
|
version.workspace = true
|
|
4
4
|
edition.workspace = true
|
|
5
5
|
rust-version.workspace = true
|
|
@@ -9,6 +9,9 @@ license.workspace = true
|
|
|
9
9
|
keywords.workspace = true
|
|
10
10
|
categories.workspace = true
|
|
11
11
|
|
|
12
|
+
[lib]
|
|
13
|
+
name = "haystack_core"
|
|
14
|
+
|
|
12
15
|
[dependencies]
|
|
13
16
|
chrono = { version = "0.4", features = ["serde"] }
|
|
14
17
|
serde = { version = "1.0", features = ["derive"] }
|
|
@@ -4,8 +4,9 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rusty-haystack"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "Python bindings for
|
|
7
|
+
version = "0.3.1"
|
|
8
|
+
description = "Fast Python bindings for Project Haystack — types, codecs (Zinc/Trio/JSON), filters, ontology, and Xeto support powered by Rust"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
requires-python = ">=3.11"
|
|
10
11
|
license = {text = "MIT"}
|
|
11
12
|
authors = [{name = "Justin Scott", email = "jscott3201@gmail.com"}]
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
name = "rusty-haystack"
|
|
3
3
|
version.workspace = true
|
|
4
4
|
edition.workspace = true
|
|
5
|
+
readme = "README.md"
|
|
5
6
|
|
|
6
7
|
[lib]
|
|
7
8
|
name = "rusty_haystack"
|
|
8
9
|
crate-type = ["cdylib"]
|
|
9
10
|
|
|
10
11
|
[dependencies]
|
|
11
|
-
haystack-core = { path = "../haystack-core" }
|
|
12
|
+
haystack-core = { package = "rusty-haystack-core", path = "../haystack-core" }
|
|
12
13
|
pyo3 = { version = "0.24", features = ["extension-module"] }
|
|
13
14
|
chrono = "0.4"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# rusty-haystack
|
|
2
|
+
|
|
3
|
+
Fast Python bindings for [Project Haystack](https://project-haystack.org) powered by Rust.
|
|
4
|
+
|
|
5
|
+
Provides types, codecs (Zinc/Trio/JSON/JSON v3/CSV), filters, an in-memory entity graph, ontology validation, and Xeto support — all backed by a native Rust core for speed and correctness.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install rusty-haystack
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Python 3.11+. Pre-built wheels are available for Linux and macOS (x86_64 and aarch64).
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import rusty_haystack as rh
|
|
19
|
+
|
|
20
|
+
# Create an entity
|
|
21
|
+
entity = rh.HDict({
|
|
22
|
+
"id": rh.Ref("site-1", "Demo Site"),
|
|
23
|
+
"site": rh.Marker(),
|
|
24
|
+
"dis": "Demo Site",
|
|
25
|
+
"area": rh.Number(5000, "ft²"),
|
|
26
|
+
"geoCoord": rh.Coord(40.7128, -74.0060),
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
# Build a graph and query it
|
|
30
|
+
graph = rh.EntityGraph()
|
|
31
|
+
graph.add(entity)
|
|
32
|
+
results = graph.read("site")
|
|
33
|
+
|
|
34
|
+
# Encode/decode across formats
|
|
35
|
+
zinc_str = rh.encode_grid("text/zinc", results)
|
|
36
|
+
json_str = rh.encode_grid("application/json", results)
|
|
37
|
+
decoded = rh.decode_grid("text/zinc", zinc_str)
|
|
38
|
+
|
|
39
|
+
# Validate against the standard ontology
|
|
40
|
+
ns = rh.DefNamespace.load_standard()
|
|
41
|
+
issues = ns.validate_entity(entity)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- **Kind types** — Marker, NA, Remove, Number (with units), Ref, Uri, Symbol, XStr, Coord, HDateTime, HDict, HGrid, HList
|
|
47
|
+
- **Codecs** — Zinc, Trio, JSON, JSON v3, CSV encoding and decoding
|
|
48
|
+
- **Filters** — Parse and evaluate Haystack filter expressions against entities
|
|
49
|
+
- **EntityGraph** — In-memory graph with CRUD, filter queries, and ref traversal
|
|
50
|
+
- **Ontology** — DefNamespace with `is_a`, `fits`, `validate_entity`, subtype/supertype queries
|
|
51
|
+
- **Xeto** — Load/unload Xeto libraries, inspect specs and slots, export to Xeto source
|
|
52
|
+
|
|
53
|
+
## Codecs
|
|
54
|
+
|
|
55
|
+
Supported MIME types: `"text/zinc"`, `"text/trio"`, `"application/json"`, `"application/json;v=3"`, `"text/csv"`.
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# Grid encode/decode
|
|
59
|
+
zinc_str = rh.encode_grid("text/zinc", grid)
|
|
60
|
+
grid = rh.decode_grid("text/zinc", zinc_str)
|
|
61
|
+
|
|
62
|
+
# Scalar encode/decode
|
|
63
|
+
s = rh.encode_scalar("text/zinc", rh.Number(72.5, "°F"))
|
|
64
|
+
v = rh.decode_scalar("text/zinc", s)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## EntityGraph
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
graph = rh.EntityGraph()
|
|
71
|
+
graph.add(rh.HDict({"id": rh.Ref("site-1"), "site": rh.Marker(), "dis": "HQ"}))
|
|
72
|
+
graph.add(rh.HDict({"id": rh.Ref("ahu-1"), "equip": rh.Marker(), "siteRef": rh.Ref("site-1")}))
|
|
73
|
+
|
|
74
|
+
results = graph.read("equip") # filter query
|
|
75
|
+
graph.refs_from("ahu-1") # -> ["site-1"]
|
|
76
|
+
graph.refs_to("site-1") # -> ["ahu-1"]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Ontology & Xeto
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
ns = rh.DefNamespace.load_standard()
|
|
83
|
+
|
|
84
|
+
ns.is_a("ahu", "equip") # True
|
|
85
|
+
ns.fits(entity, "site") # True
|
|
86
|
+
ns.subtypes("equip") # ["ahu", "vav", ...]
|
|
87
|
+
ns.validate_entity(entity) # list of issue strings
|
|
88
|
+
|
|
89
|
+
# Load custom Xeto libraries
|
|
90
|
+
ns.load_xeto(source_text, "myLib")
|
|
91
|
+
spec = ns.get_spec("myLib::MyType")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT
|
rusty_haystack-0.2.9/PKG-INFO
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: rusty-haystack
|
|
3
|
-
Version: 0.2.9
|
|
4
|
-
Classifier: Programming Language :: Rust
|
|
5
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
7
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
8
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
11
|
-
Summary: Python bindings for the Rusty Haystack Project Haystack implementation
|
|
12
|
-
Keywords: haystack,iot,building-automation,smart-buildings
|
|
13
|
-
Author-email: Justin Scott <jscott3201@gmail.com>
|
|
14
|
-
License: MIT
|
|
15
|
-
Requires-Python: >=3.11
|
|
16
|
-
Project-URL: Homepage, https://github.com/justinscott/rusty-haystack
|
|
17
|
-
Project-URL: Repository, https://github.com/justinscott/rusty-haystack
|
|
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
|
|
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
|
|
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
|