lutaml-store 0.2.4 → 0.3.0
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.
- checksums.yaml +4 -4
- data/README.adoc +56 -0
- data/docs/astro.config.mjs +12 -0
- data/docs/package-lock.json +6098 -0
- data/docs/package.json +18 -0
- data/docs/public/favicon.svg +1 -0
- data/docs/public/lutaml-logo_logo-full-dark.svg +1 -0
- data/docs/public/lutaml-logo_logo-full-light.svg +1 -0
- data/docs/src/layouts/Base.astro +44 -0
- data/docs/src/layouts/Docs.astro +41 -0
- data/docs/src/pages/adapters.md +46 -0
- data/docs/src/pages/architecture.md +68 -0
- data/docs/src/pages/cloud-contract.md +48 -0
- data/docs/src/pages/formats.md +54 -0
- data/docs/src/pages/http-cache.md +43 -0
- data/docs/src/pages/index.md +82 -0
- data/docs/src/pages/quick-start.md +109 -0
- data/docs/src/pages/sources.md +83 -0
- data/docs/src/pages/stores.md +110 -0
- data/docs/src/styles/global.css +10 -0
- data/lib/lutaml/store/format.rb +13 -0
- data/lib/lutaml/store/manifest.rb +85 -0
- data/lib/lutaml/store/mirror.rb +94 -0
- data/lib/lutaml/store/repository.rb +178 -0
- data/lib/lutaml/store/source/base.rb +137 -0
- data/lib/lutaml/store/source/directory.rb +49 -0
- data/lib/lutaml/store/source/https.rb +109 -0
- data/lib/lutaml/store/source/rest.rb +61 -0
- data/lib/lutaml/store/source/zip.rb +52 -0
- data/lib/lutaml/store/source.rb +55 -0
- data/lib/lutaml/store/version.rb +1 -1
- data/lib/lutaml/store.rb +5 -0
- metadata +30 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34e9babf679b2654a563c89d68552afd0b2d98d5725656eb9baa2f1a878a80f4
|
|
4
|
+
data.tar.gz: 599409d62bfe96b0e57147f620aef55ea88abe40b5183bdfb02511d3a91ea281
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77f4022441c6b6ab2f63b5106a2ca3bba16abab82bf75adbe8569ec73a0eb6cd824891920e5571e7a2f7b39c9d56ac5bd2824418f24aa8577abf893645941062
|
|
7
|
+
data.tar.gz: dbe7804392b8b32135c77f3766b6976a8111a357b40bfdad563906d59205a0305dfd3f467b371ba423859a6ebbb8a7fa8d8baef905875a6097478763ed2d6b43
|
data/README.adoc
CHANGED
|
@@ -17,8 +17,64 @@ It offers a unified interface for storing and retrieving complex model
|
|
|
17
17
|
hierarchies, batch file I/O with multiple serialization formats, HTTP-aware
|
|
18
18
|
caching, and package-based persistence with ZIP and directory transports.
|
|
19
19
|
|
|
20
|
+
It also provides **read-only Sources** for working with data repositories that
|
|
21
|
+
live outside your process — GitHub Pages, any static host, a REST API, a local
|
|
22
|
+
package directory, or a `.zip` distribution — through one facade that never
|
|
23
|
+
guesses which layer answered.
|
|
24
|
+
|
|
25
|
+
== Quick start: read a LutaML data repository
|
|
26
|
+
|
|
27
|
+
The same read API whether the data lives in the cloud, a local package, or a
|
|
28
|
+
downloaded `.zip` — backends are configured, never guessed:
|
|
29
|
+
|
|
30
|
+
[source,ruby]
|
|
31
|
+
----
|
|
32
|
+
require "lutaml/store"
|
|
33
|
+
|
|
34
|
+
# From a cloud API (api.relaton.org is the reference implementation)
|
|
35
|
+
repo = Lutaml::Store::Repository.new(
|
|
36
|
+
source: Lutaml::Store::Source.for(:rest,
|
|
37
|
+
base_url: "https://api.relaton.org", collection: "ietf"),
|
|
38
|
+
cache: Lutaml::Store::Source.for(:directory, path: "~/.cache/relaton/ietf"),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# From a local GCR-style package — identical read API
|
|
42
|
+
repo = Lutaml::Store::Repository.new(
|
|
43
|
+
source: Lutaml::Store::Source.for(:directory, path: "~/gcr/relaton/ietf"),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# From a downloaded .zip distribution — same API
|
|
47
|
+
repo = Lutaml::Store::Repository.new(
|
|
48
|
+
source: Lutaml::Store::Source.for(:zip, path: "ietf.zip"),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
# Read
|
|
52
|
+
repo.read("RFC 7231") # => bytes
|
|
53
|
+
repo.exist?("RFC 7231") # => true
|
|
54
|
+
repo.keys # => ["RFC 7231", ...]
|
|
55
|
+
repo.manifest # => Lutaml::Store::Manifest
|
|
56
|
+
|
|
57
|
+
# Parse into your model — the model class is declared, never inferred
|
|
58
|
+
repo.get("RFC 7231", MyModel)
|
|
59
|
+
|
|
60
|
+
# Search by metadata fields
|
|
61
|
+
repo.search(docid: "RFC 7231")
|
|
62
|
+
|
|
63
|
+
# Pull the whole collection into a local GCR-style package
|
|
64
|
+
repo.pull!(into: "~/gcr/relaton", collection: "ietf")
|
|
65
|
+
|
|
66
|
+
# Offline mode: never touch the source, serve from the local package only
|
|
67
|
+
offline = Lutaml::Store::Repository.new(source: repo.source, cache: repo.cache, mode: :offline)
|
|
68
|
+
offline.read("RFC 7231") # served from the cache, no network
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
20
72
|
== Features
|
|
21
73
|
|
|
74
|
+
* **Repository** — the uniform facade: one read API over any source (cloud, local, zip), explicit cache, online/offline modes
|
|
75
|
+
* **Source** (read-only) — Directory, Zip, Https (ETag/304), Rest (the lutaml cloud store API); 404 = NotFoundError, transport = BackendError
|
|
76
|
+
* **Manifest** — the enumeration SSOT: keys, sha256 digests, opaque shard metadata
|
|
77
|
+
* **Mirror** — pull any source into a GCR-style package (incremental, digest-verified); pack to a distributable .zip
|
|
22
78
|
* **DatabaseStore** — high-level CRUD with model registry, polymorphism, composites
|
|
23
79
|
* **PackageStore** — structured multi-model packages with ZIP and directory transport
|
|
24
80
|
* **BasicStore** — low-level key-value store with optional cache, events, monitoring
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from "astro/config";
|
|
2
|
+
import vue from "@astrojs/vue";
|
|
3
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
site: "https://lutaml.github.io",
|
|
7
|
+
base: "/lutaml-store",
|
|
8
|
+
integrations: [vue()],
|
|
9
|
+
vite: {
|
|
10
|
+
plugins: [tailwindcss()],
|
|
11
|
+
},
|
|
12
|
+
});
|