clients: snapshot

This commit is contained in:
nym21
2026-01-11 23:08:08 +01:00
parent 325811fee7
commit 5826d78e35
38 changed files with 10018 additions and 11139 deletions
Generated
+1
View File
@@ -3088,6 +3088,7 @@ version = "1.0.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
dependencies = [
"indexmap",
"itoa",
"memchr",
"serde",
+1 -1
View File
@@ -75,7 +75,7 @@ schemars = "1.2.0"
serde = "1.0.228"
serde_bytes = "0.11.19"
serde_derive = "1.0.228"
serde_json = { version = "1.0.149", features = ["float_roundtrip"] }
serde_json = { version = "1.0.149", features = ["float_roundtrip", "preserve_order"] }
smallvec = "1.15.1"
tokio = { version = "1.49.0", features = ["rt-multi-thread"] }
tracing = { version = "0.1", default-features = false, features = ["std"] }
+19 -2
View File
@@ -17,6 +17,20 @@ pub fn get_first_leaf_name(node: &TreeNode) -> Option<String> {
}
}
/// Get the shortest leaf name from a tree node.
///
/// This is useful for pattern base analysis where we want the "base" case
/// (e.g., the leaf without suffix like `_btc` or `_usd`).
fn get_shortest_leaf_name(node: &TreeNode) -> Option<String> {
match node {
TreeNode::Leaf(leaf) => Some(leaf.name().to_string()),
TreeNode::Branch(children) => children
.values()
.filter_map(get_shortest_leaf_name)
.min_by_key(|name| name.len()),
}
}
/// Get all leaf names from a tree node.
pub fn get_all_leaf_names(node: &TreeNode) -> Vec<String> {
match node {
@@ -122,14 +136,17 @@ pub fn get_pattern_instance_base(node: &TreeNode) -> String {
analyze_pattern_level(&child_names).base
}
/// Get (field_name, first_leaf_name) pairs for direct children of a branch node.
/// Get (field_name, shortest_leaf_name) pairs for direct children of a branch node.
///
/// Uses the shortest leaf name from each child subtree to find the "base" case
/// (the leaf without suffix modifiers like `_btc` or `_usd`).
fn get_direct_children_for_analysis(node: &TreeNode) -> Vec<(String, String)> {
match node {
TreeNode::Leaf(leaf) => vec![(leaf.name().to_string(), leaf.name().to_string())],
TreeNode::Branch(children) => children
.iter()
.filter_map(|(field_name, child)| {
get_first_leaf_name(child).map(|leaf_name| (field_name.clone(), leaf_name))
get_shortest_leaf_name(child).map(|leaf_name| (field_name.clone(), leaf_name))
})
.collect(),
}
@@ -12,7 +12,13 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
}
let method_name = endpoint_to_method_name(endpoint);
let return_type = normalize_return_type(endpoint.response_type.as_deref().unwrap_or("*"));
let base_return_type =
normalize_return_type(endpoint.response_type.as_deref().unwrap_or("*"));
let return_type = if endpoint.supports_csv {
format!("{} | string", base_return_type)
} else {
base_return_type
};
writeln!(output, " /**").unwrap();
if let Some(summary) = &endpoint.summary {
@@ -58,7 +64,7 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
let path = build_path_template(&endpoint.path, &endpoint.path_params);
if endpoint.query_params.is_empty() {
writeln!(output, " return this.get(`{}`);", path).unwrap();
writeln!(output, " return this.getJson(`{}`);", path).unwrap();
} else {
writeln!(output, " const params = new URLSearchParams();").unwrap();
for param in &endpoint.query_params {
@@ -79,12 +85,16 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
}
}
writeln!(output, " const query = params.toString();").unwrap();
writeln!(
output,
" return this.get(`{}${{query ? '?' + query : ''}}`);",
path
)
.unwrap();
writeln!(output, " const path = `{}${{query ? '?' + query : ''}}`;", path).unwrap();
if endpoint.supports_csv {
writeln!(output, " if (format === 'csv') {{").unwrap();
writeln!(output, " return this.getText(path);").unwrap();
writeln!(output, " }}").unwrap();
writeln!(output, " return this.getJson(path);").unwrap();
} else {
writeln!(output, " return this.getJson(path);").unwrap();
}
}
writeln!(output, " }}\n").unwrap();
@@ -52,8 +52,8 @@ class BrkError extends Error {{
* @template T
* @typedef {{Object}} MetricData
* @property {{number}} total - Total number of data points
* @property {{number}} from - Start index (inclusive)
* @property {{number}} to - End index (exclusive)
* @property {{number}} start - Start index (inclusive)
* @property {{number}} end - End index (exclusive)
* @property {{T[]}} data - The metric data
*/
/** @typedef {{MetricData<unknown>}} AnyMetricData */
@@ -62,7 +62,7 @@ class BrkError extends Error {{
* @template T
* @typedef {{Object}} MetricEndpoint
* @property {{(onUpdate?: (value: MetricData<T>) => void) => Promise<MetricData<T>>}} get - Fetch all data points
* @property {{(from?: number, to?: number, onUpdate?: (value: MetricData<T>) => void) => Promise<MetricData<T>>}} range - Fetch data in range
* @property {{(start?: number, end?: number, onUpdate?: (value: MetricData<T>) => void) => Promise<MetricData<T>>}} range - Fetch data in range
* @property {{string}} path - The endpoint path
*/
/** @typedef {{MetricEndpoint<unknown>}} AnyMetricEndpoint */
@@ -89,13 +89,13 @@ class BrkError extends Error {{
function _endpoint(client, name, index) {{
const p = `/api/metric/${{name}}/${{index}}`;
return {{
get: (onUpdate) => client.get(p, onUpdate),
range: (from, to, onUpdate) => {{
get: (onUpdate) => client.getJson(p, onUpdate),
range: (start, end, onUpdate) => {{
const params = new URLSearchParams();
if (from !== undefined) params.set('from', String(from));
if (to !== undefined) params.set('to', String(to));
if (start !== undefined) params.set('start', String(start));
if (end !== undefined) params.set('end', String(end));
const query = params.toString();
return client.get(query ? `${{p}}?${{query}}` : p, onUpdate);
return client.getJson(query ? `${{p}}?${{query}}` : p, onUpdate);
}},
get path() {{ return p; }},
}};
@@ -114,6 +114,18 @@ class BrkClientBase {{
this.timeout = isString ? 5000 : (options.timeout ?? 5000);
}}
/**
* @param {{string}} path
* @returns {{Promise<Response>}}
*/
async get(path) {{
const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl;
const url = `${{base}}${{path}}`;
const res = await fetch(url, {{ signal: AbortSignal.timeout(this.timeout) }});
if (!res.ok) throw new BrkError(`HTTP ${{res.status}}`, res.status);
return res;
}}
/**
* Make a GET request with stale-while-revalidate caching
* @template T
@@ -121,7 +133,7 @@ class BrkClientBase {{
* @param {{(value: T) => void}} [onUpdate] - Called when data is available
* @returns {{Promise<T>}}
*/
async get(path, onUpdate) {{
async getJson(path, onUpdate) {{
const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl;
const url = `${{base}}${{path}}`;
const cache = await _cachePromise;
@@ -135,8 +147,7 @@ class BrkClientBase {{
}}
try {{
const res = await fetch(url, {{ signal: AbortSignal.timeout(this.timeout) }});
if (!res.ok) throw new BrkError(`HTTP ${{res.status}}`, res.status);
const res = await this.get(path);
if (cachedRes?.headers.get('ETag') === res.headers.get('ETag')) return cachedJson;
const cloned = res.clone();
@@ -149,6 +160,16 @@ class BrkClientBase {{
throw e;
}}
}}
/**
* Make a GET request and return raw text (for CSV responses)
* @param {{string}} path
* @returns {{Promise<string>}}
*/
async getText(path) {{
const res = await this.get(path);
return res.text();
}}
}}
/**
@@ -14,7 +14,7 @@ use crate::{
use super::api::generate_api_methods;
use super::client::generate_static_constants;
/// Generate JSDoc typedefs for the catalog tree.
/// Generate JSDoc typedefs for the metrics tree.
pub fn generate_tree_typedefs(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) {
writeln!(output, "// Catalog tree typedefs\n").unwrap();
@@ -22,7 +22,7 @@ pub fn generate_tree_typedefs(output: &mut String, catalog: &TreeNode, metadata:
let mut generated = HashSet::new();
generate_tree_typedef(
output,
"CatalogTree",
"MetricsTree",
catalog,
&pattern_lookup,
metadata,
@@ -98,7 +98,7 @@ pub fn generate_main_client(
writeln!(output, "/**").unwrap();
writeln!(
output,
" * Main BRK client with catalog tree and API methods"
" * Main BRK client with metrics tree and API methods"
)
.unwrap();
writeln!(output, " * @extends BrkClientBase").unwrap();
@@ -112,14 +112,14 @@ pub fn generate_main_client(
writeln!(output, " */").unwrap();
writeln!(output, " constructor(options) {{").unwrap();
writeln!(output, " super(options);").unwrap();
writeln!(output, " /** @type {{CatalogTree}} */").unwrap();
writeln!(output, " this.tree = this._buildTree('');").unwrap();
writeln!(output, " /** @type {{MetricsTree}} */").unwrap();
writeln!(output, " this.metrics = this._buildTree('');").unwrap();
writeln!(output, " }}\n").unwrap();
writeln!(output, " /**").unwrap();
writeln!(output, " * @private").unwrap();
writeln!(output, " * @param {{string}} basePath").unwrap();
writeln!(output, " * @returns {{CatalogTree}}").unwrap();
writeln!(output, " * @returns {{MetricsTree}}").unwrap();
writeln!(output, " */").unwrap();
writeln!(output, " _buildTree(basePath) {{").unwrap();
writeln!(output, " return {{").unwrap();
@@ -12,7 +12,7 @@ pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) {
writeln!(output, "class BrkClient(BrkClientBase):").unwrap();
writeln!(
output,
" \"\"\"Main BRK client with catalog tree and API methods.\"\"\""
" \"\"\"Main BRK client with metrics tree and API methods.\"\"\""
)
.unwrap();
writeln!(output).unwrap();
@@ -26,7 +26,7 @@ pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) {
)
.unwrap();
writeln!(output, " super().__init__(base_url, timeout)").unwrap();
writeln!(output, " self.tree = CatalogTree(self)").unwrap();
writeln!(output, " self.metrics = MetricsTree(self)").unwrap();
writeln!(output).unwrap();
// Generate API methods
@@ -41,7 +41,7 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
}
let method_name = endpoint_to_method_name(endpoint);
let return_type = normalize_return_type(
let base_return_type = normalize_return_type(
&endpoint
.response_type
.as_deref()
@@ -49,6 +49,12 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
.unwrap_or_else(|| "Any".to_string()),
);
let return_type = if endpoint.supports_csv {
format!("Union[{}, str]", base_return_type)
} else {
base_return_type
};
// Build method signature
let params = build_method_params(endpoint);
writeln!(
@@ -79,9 +85,9 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
if endpoint.query_params.is_empty() {
if endpoint.path_params.is_empty() {
writeln!(output, " return self.get('{}')", path).unwrap();
writeln!(output, " return self.get_json('{}')", path).unwrap();
} else {
writeln!(output, " return self.get(f'{}')", path).unwrap();
writeln!(output, " return self.get_json(f'{}')", path).unwrap();
}
} else {
writeln!(output, " params = []").unwrap();
@@ -107,10 +113,18 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
writeln!(output, " query = '&'.join(params)").unwrap();
writeln!(
output,
" return self.get(f'{}{{\"?\" + query if query else \"\"}}')",
" path = f'{}{{\"?\" + query if query else \"\"}}'",
path
)
.unwrap();
if endpoint.supports_csv {
writeln!(output, " if format == 'csv':").unwrap();
writeln!(output, " return self.get_text(path)").unwrap();
writeln!(output, " return self.get_json(path)").unwrap();
} else {
writeln!(output, " return self.get_json(path)").unwrap();
}
}
writeln!(output).unwrap();
@@ -81,25 +81,48 @@ class BrkClientBase:
"""Base HTTP client for making requests."""
def __init__(self, base_url: str, timeout: float = 30.0):
self.base_url = base_url
self.timeout = timeout
self._client = httpx.Client(timeout=timeout)
parsed = urlparse(base_url)
self._host = parsed.netloc
self._secure = parsed.scheme == 'https'
self._timeout = timeout
self._conn: Optional[Union[HTTPSConnection, HTTPConnection]] = None
def get(self, path: str) -> Any:
"""Make a GET request."""
def _connect(self) -> Union[HTTPSConnection, HTTPConnection]:
"""Get or create HTTP connection."""
if self._conn is None:
if self._secure:
self._conn = HTTPSConnection(self._host, timeout=self._timeout)
else:
self._conn = HTTPConnection(self._host, timeout=self._timeout)
return self._conn
def get(self, path: str) -> bytes:
"""Make a GET request and return raw bytes."""
try:
base = self.base_url.rstrip('/')
response = self._client.get(f"{{base}}{{path}}")
response.raise_for_status()
return response.json()
except httpx.HTTPStatusError as e:
raise BrkError(f"HTTP error: {{e.response.status_code}}", e.response.status_code)
except httpx.RequestError as e:
conn = self._connect()
conn.request("GET", path)
res = conn.getresponse()
data = res.read()
if res.status >= 400:
raise BrkError(f"HTTP error: {{res.status}}", res.status)
return data
except (ConnectionError, OSError, TimeoutError) as e:
self._conn = None
raise BrkError(str(e))
def get_json(self, path: str) -> Any:
"""Make a GET request and return JSON."""
return json.loads(self.get(path))
def get_text(self, path: str) -> str:
"""Make a GET request and return text."""
return self.get(path).decode()
def close(self):
"""Close the HTTP client."""
self._client.close()
if self._conn:
self._conn.close()
self._conn = None
def __enter__(self):
return self
@@ -124,8 +147,8 @@ pub fn generate_endpoint_class(output: &mut String) {
r#"class MetricData(TypedDict, Generic[T]):
"""Metric data with range information."""
total: int
from_: int # 'from' is reserved in Python
to: int
start: int
end: int
data: List[T]
@@ -143,18 +166,18 @@ class MetricEndpoint(Generic[T]):
def get(self) -> MetricData[T]:
"""Fetch all data points for this metric/index."""
return self._client.get(self.path())
return self._client.get_json(self.path())
def range(self, from_val: Optional[int] = None, to_val: Optional[int] = None) -> MetricData[T]:
def range(self, start: Optional[int] = None, end: Optional[int] = None) -> MetricData[T]:
"""Fetch data points within a range."""
params = []
if from_val is not None:
params.append(f"from={{from_val}}")
if to_val is not None:
params.append(f"to={{to_val}}")
if start is not None:
params.append(f"start={{start}}")
if end is not None:
params.append(f"end={{end}}")
query = "&".join(params)
p = self.path()
return self._client.get(f"{{p}}?{{query}}" if query else p)
return self._client.get_json(f"{{p}}?{{query}}" if query else p)
def path(self) -> str:
"""Get the endpoint path."""
@@ -24,13 +24,14 @@ pub fn generate_python_client(
writeln!(output, "# Auto-generated BRK Python client").unwrap();
writeln!(output, "# Do not edit manually\n").unwrap();
writeln!(output, "from __future__ import annotations").unwrap();
writeln!(
output,
"from typing import TypeVar, Generic, Any, Optional, List, Literal, TypedDict, Union, Protocol"
)
.unwrap();
writeln!(output, "import httpx\n").unwrap();
writeln!(output, "from http.client import HTTPSConnection, HTTPConnection").unwrap();
writeln!(output, "from urllib.parse import urlparse").unwrap();
writeln!(output, "import json\n").unwrap();
writeln!(output, "T = TypeVar('T')\n").unwrap();
types::generate_type_definitions(&mut output, schemas);
@@ -12,13 +12,13 @@ use crate::{
/// Generate tree classes
pub fn generate_tree_classes(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) {
writeln!(output, "# Catalog tree classes\n").unwrap();
writeln!(output, "# Metrics tree classes\n").unwrap();
let pattern_lookup = metadata.pattern_lookup();
let mut generated = HashSet::new();
generate_tree_class(
output,
"CatalogTree",
"MetricsTree",
catalog,
&pattern_lookup,
metadata,
@@ -39,8 +39,30 @@ fn generate_tree_class(
return;
};
// Generate child classes FIRST (post-order traversal)
// This ensures children are defined before parent references them
for (child_name, child_node) in ctx.children.iter() {
if let TreeNode::Branch(grandchildren) = child_node {
let child_fields = get_node_fields(grandchildren, pattern_lookup);
// Generate inline class if no pattern match OR pattern is not parameterizable
if !metadata.is_parameterizable_fields(&child_fields) {
let child_class = child_type_name(name, child_name);
generate_tree_class(
output,
&child_class,
child_node,
pattern_lookup,
metadata,
generated,
);
}
}
}
// THEN generate the current class (after all children are defined)
writeln!(output, "class {}:", name).unwrap();
writeln!(output, " \"\"\"Catalog tree node.\"\"\"").unwrap();
writeln!(output, " \"\"\"Metrics tree node.\"\"\"").unwrap();
writeln!(output, " ").unwrap();
writeln!(
output,
@@ -92,24 +114,4 @@ fn generate_tree_class(
}
writeln!(output).unwrap();
// Generate child classes
for (child_name, child_node) in ctx.children {
if let TreeNode::Branch(grandchildren) = child_node {
let child_fields = get_node_fields(grandchildren, pattern_lookup);
// Generate inline class if no pattern match OR pattern is not parameterizable
if !metadata.is_parameterizable_fields(&child_fields) {
let child_class = child_type_name(name, child_name);
generate_tree_class(
output,
&child_class,
child_node,
pattern_lookup,
metadata,
generated,
);
}
}
}
}
+129 -51
View File
@@ -17,67 +17,81 @@ pub fn generate_type_definitions(output: &mut String, schemas: &TypeSchemas) {
let sorted_names = topological_sort_schemas(schemas);
for name in sorted_names {
if MANUAL_GENERIC_TYPES.contains(&name.as_str()) {
continue;
}
// Partition into simple type aliases and TypedDict classes
// Generate type aliases first to avoid forward reference issues
let (type_aliases, typed_dicts): (Vec<_>, Vec<_>) = sorted_names
.into_iter()
.filter(|name| !MANUAL_GENERIC_TYPES.contains(&name.as_str()))
.filter(|name| schemas.contains_key(name))
.partition(|name| {
schemas
.get(name)
.map(|s| s.get("properties").is_none())
.unwrap_or(false)
});
let Some(schema) = schemas.get(&name) else {
continue;
};
// Generate simple type aliases first
// Quote references to TypedDicts since they're defined after
let typed_dict_set: HashSet<_> = typed_dicts.iter().cloned().collect();
for name in type_aliases {
let schema = &schemas[&name];
let type_desc = schema.get("description").and_then(|d| d.as_str());
if let Some(props) = schema.get("properties").and_then(|p| p.as_object()) {
writeln!(output, "class {}(TypedDict):", name).unwrap();
// Collect field descriptions for Attributes section
let field_docs: Vec<(String, Option<&str>)> = props
.iter()
.map(|(prop_name, prop_schema)| {
let safe_name = escape_python_keyword(prop_name);
let desc = prop_schema.get("description").and_then(|d| d.as_str());
(safe_name, desc)
})
.collect();
let has_field_docs = field_docs.iter().any(|(_, d)| d.is_some());
// Generate docstring if we have type description or field descriptions
if type_desc.is_some() || has_field_docs {
writeln!(output, " \"\"\"").unwrap();
if let Some(desc) = type_desc {
for line in desc.lines() {
writeln!(output, " {}", line).unwrap();
}
}
if has_field_docs {
if type_desc.is_some() {
writeln!(output).unwrap();
}
writeln!(output, " Attributes:").unwrap();
for (field_name, desc) in &field_docs {
if let Some(d) = desc {
writeln!(output, " {}: {}", field_name, d).unwrap();
}
}
}
writeln!(output, " \"\"\"").unwrap();
let py_type = schema_to_python_type_quoting(schema, Some(&name), &typed_dict_set);
if let Some(desc) = type_desc {
for line in desc.lines() {
writeln!(output, "# {}", line).unwrap();
}
}
writeln!(output, "{} = {}", name, py_type).unwrap();
}
for (prop_name, prop_schema) in props {
let prop_type = schema_to_python_type_ctx(prop_schema, Some(&name));
// Then generate TypedDict classes
for name in typed_dicts {
let schema = &schemas[&name];
let type_desc = schema.get("description").and_then(|d| d.as_str());
let props = schema.get("properties").and_then(|p| p.as_object()).unwrap();
writeln!(output, "class {}(TypedDict):", name).unwrap();
// Collect field descriptions for Attributes section
let field_docs: Vec<(String, Option<&str>)> = props
.iter()
.map(|(prop_name, prop_schema)| {
let safe_name = escape_python_keyword(prop_name);
writeln!(output, " {}: {}", safe_name, prop_type).unwrap();
}
writeln!(output).unwrap();
} else {
let py_type = schema_to_python_type_ctx(schema, Some(&name));
let desc = prop_schema.get("description").and_then(|d| d.as_str());
(safe_name, desc)
})
.collect();
let has_field_docs = field_docs.iter().any(|(_, d)| d.is_some());
// Generate docstring if we have type description or field descriptions
if type_desc.is_some() || has_field_docs {
writeln!(output, " \"\"\"").unwrap();
if let Some(desc) = type_desc {
for line in desc.lines() {
writeln!(output, "# {}", line).unwrap();
writeln!(output, " {}", line).unwrap();
}
}
writeln!(output, "{} = {}", name, py_type).unwrap();
if has_field_docs {
if type_desc.is_some() {
writeln!(output).unwrap();
}
writeln!(output, " Attributes:").unwrap();
for (field_name, desc) in &field_docs {
if let Some(d) = desc {
writeln!(output, " {}: {}", field_name, d).unwrap();
}
}
}
writeln!(output, " \"\"\"").unwrap();
}
for (prop_name, prop_schema) in props {
let prop_type = schema_to_python_type_ctx(prop_schema, Some(&name));
let safe_name = escape_python_keyword(prop_name);
writeln!(output, " {}: {}", safe_name, prop_type).unwrap();
}
writeln!(output).unwrap();
}
writeln!(output).unwrap();
}
@@ -194,6 +208,70 @@ fn json_type_to_python(ty: &str, schema: &Value, current_type: Option<&str>) ->
}
}
/// Convert JSON Schema to Python type, quoting types in the given set
fn schema_to_python_type_quoting(
schema: &Value,
current_type: Option<&str>,
quote_types: &HashSet<String>,
) -> String {
if let Some(all_of) = schema.get("allOf").and_then(|v| v.as_array()) {
for item in all_of {
let resolved = schema_to_python_type_quoting(item, current_type, quote_types);
if resolved != "Any" {
return resolved;
}
}
}
// Handle $ref
if let Some(ref_path) = schema.get("$ref").and_then(|r| r.as_str()) {
let type_name = ref_to_type_name(ref_path).unwrap_or("Any");
// Quote self-references or types in quote_types set
if current_type == Some(type_name) || quote_types.contains(type_name) {
return format!("\"{}\"", type_name);
}
return type_name.to_string();
}
// Handle enum (array of string values)
if let Some(enum_values) = schema.get("enum").and_then(|e| e.as_array()) {
let literals: Vec<String> = enum_values
.iter()
.filter_map(|v| v.as_str())
.map(|s| format!("\"{}\"", s))
.collect();
if !literals.is_empty() {
return format!("Literal[{}]", literals.join(", "));
}
}
if let Some(variants) = schema
.get("anyOf")
.or_else(|| schema.get("oneOf"))
.and_then(|v| v.as_array())
{
let types: Vec<String> = variants
.iter()
.map(|v| schema_to_python_type_quoting(v, current_type, quote_types))
.collect();
let filtered: Vec<_> = types.iter().filter(|t| *t != "Any").collect();
if !filtered.is_empty() {
return format!(
"Union[{}]",
filtered
.iter()
.map(|s| s.as_str())
.collect::<Vec<_>>()
.join(", ")
);
}
return format!("Union[{}]", types.join(", "));
}
// Fall back to regular conversion for other cases
schema_to_python_type_ctx(schema, current_type)
}
/// Convert JSON Schema to Python type with context for detecting self-references
pub fn schema_to_python_type_ctx(schema: &Value, current_type: Option<&str>) -> String {
if let Some(all_of) = schema.get("allOf").and_then(|v| v.as_array()) {
+52 -24
View File
@@ -10,10 +10,10 @@ use super::types::js_type_to_rust;
pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) {
writeln!(
output,
r#"/// Main BRK client with catalog tree and API methods.
r#"/// Main BRK client with metrics tree and API methods.
pub struct BrkClient {{
base: Arc<BrkClientBase>,
tree: CatalogTree,
metrics: MetricsTree,
}}
impl BrkClient {{
@@ -23,20 +23,20 @@ impl BrkClient {{
/// Create a new client with the given base URL.
pub fn new(base_url: impl Into<String>) -> Self {{
let base = Arc::new(BrkClientBase::new(base_url));
let tree = CatalogTree::new(base.clone(), String::new());
Self {{ base, tree }}
let metrics = MetricsTree::new(base.clone(), String::new());
Self {{ base, metrics }}
}}
/// Create a new client with options.
pub fn with_options(options: BrkClientOptions) -> Self {{
let base = Arc::new(BrkClientBase::with_options(options));
let tree = CatalogTree::new(base.clone(), String::new());
Self {{ base, tree }}
let metrics = MetricsTree::new(base.clone(), String::new());
Self {{ base, metrics }}
}}
/// Get the catalog tree for navigating metrics.
pub fn tree(&self) -> &CatalogTree {{
&self.tree
/// Get the metrics tree for navigating metrics.
pub fn metrics(&self) -> &MetricsTree {{
&self.metrics
}}
"#,
VERSION = VERSION
@@ -56,12 +56,18 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
}
let method_name = endpoint_to_method_name(endpoint);
let return_type = endpoint
let base_return_type = endpoint
.response_type
.as_deref()
.map(js_type_to_rust)
.unwrap_or_else(|| "serde_json::Value".to_string());
let return_type = if endpoint.supports_csv {
format!("FormatResponse<{}>", base_return_type)
} else {
base_return_type.clone()
};
writeln!(
output,
" /// {}",
@@ -83,10 +89,10 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
)
.unwrap();
let path = build_path_template(&endpoint.path);
let (path, index_arg) = build_path_template(endpoint);
if endpoint.query_params.is_empty() {
writeln!(output, " self.base.get(&format!(\"{}\"))", path).unwrap();
writeln!(output, " self.base.get_json(&format!(\"{}\"{}))", path, index_arg).unwrap();
} else {
writeln!(output, " let mut query = Vec::new();").unwrap();
for param in &endpoint.query_params {
@@ -107,12 +113,17 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
}
}
writeln!(output, " let query_str = if query.is_empty() {{ String::new() }} else {{ format!(\"?{{}}\", query.join(\"&\")) }};").unwrap();
writeln!(
output,
" self.base.get(&format!(\"{}{{}}\", query_str))",
path
)
.unwrap();
writeln!(output, " let path = format!(\"{}{{}}\"{}, query_str);", path, index_arg).unwrap();
if endpoint.supports_csv {
writeln!(output, " if format == Some(Format::CSV) {{").unwrap();
writeln!(output, " self.base.get_text(&path).map(FormatResponse::Csv)").unwrap();
writeln!(output, " }} else {{").unwrap();
writeln!(output, " self.base.get_json(&path).map(FormatResponse::Json)").unwrap();
writeln!(output, " }}").unwrap();
} else {
writeln!(output, " self.base.get_json(&path)").unwrap();
}
}
writeln!(output, " }}\n").unwrap();
@@ -126,19 +137,36 @@ fn endpoint_to_method_name(endpoint: &Endpoint) -> String {
fn build_method_params(endpoint: &Endpoint) -> String {
let mut params = Vec::new();
for param in &endpoint.path_params {
params.push(format!(", {}: &str", param.name));
let rust_type = param_type_to_rust(&param.param_type);
params.push(format!(", {}: {}", param.name, rust_type));
}
for param in &endpoint.query_params {
let rust_type = param_type_to_rust(&param.param_type);
if param.required {
params.push(format!(", {}: &str", param.name));
params.push(format!(", {}: {}", param.name, rust_type));
} else {
params.push(format!(", {}: Option<&str>", param.name));
params.push(format!(", {}: Option<{}>", param.name, rust_type));
}
}
params.join("")
}
/// OpenAPI path placeholders `{param}` are already valid Rust format string syntax.
fn build_path_template(path: &str) -> &str {
path
/// Convert parameter type to Rust type for function signatures.
fn param_type_to_rust(param_type: &str) -> String {
match param_type {
"string" | "*" => "&str".to_string(),
"integer" | "number" => "i64".to_string(),
"boolean" => "bool".to_string(),
other => other.to_string(), // Domain types like Index, Metric, Format
}
}
/// Build path template and extra format args for Index params.
fn build_path_template(endpoint: &Endpoint) -> (String, &'static str) {
let has_index_param = endpoint.path_params.iter().any(|p| p.name == "index" && p.param_type == "Index");
if has_index_param {
(endpoint.path.replace("{index}", "{}"), ", index.serialize_long()")
} else {
(endpoint.path.clone(), "")
}
}
@@ -82,8 +82,7 @@ impl BrkClientBase {{
}}
}}
/// Make a GET request.
pub fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T> {{
fn get(&self, path: &str) -> Result<minreq::Response> {{
let base = self.base_url.trim_end_matches('/');
let url = format!("{{}}{{}}", base, path);
let response = minreq::get(&url)
@@ -97,10 +96,23 @@ impl BrkClientBase {{
}});
}}
response
Ok(response)
}}
/// Make a GET request and deserialize JSON response.
pub fn get_json<T: DeserializeOwned>(&self, path: &str) -> Result<T> {{
self.get(path)?
.json()
.map_err(|e| BrkError {{ message: e.to_string() }})
}}
/// Make a GET request and return raw text response.
pub fn get_text(&self, path: &str) -> Result<String> {{
self.get(path)?
.as_str()
.map(|s| s.to_string())
.map_err(|e| BrkError {{ message: e.to_string() }})
}}
}}
/// Build metric name with optional prefix.
@@ -162,21 +174,21 @@ impl<T: DeserializeOwned> Endpoint<T> {{
/// Fetch all data points for this metric/index.
pub fn get(&self) -> Result<MetricData<T>> {{
self.client.get(&self.path())
self.client.get_json(&self.path())
}}
/// Fetch data points within a range.
pub fn range(&self, from: Option<i64>, to: Option<i64>) -> Result<MetricData<T>> {{
pub fn range(&self, start: Option<i64>, end: Option<i64>) -> Result<MetricData<T>> {{
let mut params = Vec::new();
if let Some(f) = from {{ params.push(format!("from={{}}", f)); }}
if let Some(t) = to {{ params.push(format!("to={{}}", t)); }}
if let Some(s) = start {{ params.push(format!("start={{}}", s)); }}
if let Some(e) = end {{ params.push(format!("end={{}}", e)); }}
let p = self.path();
let path = if params.is_empty() {{
p
}} else {{
format!("{{}}?{{}}", p, params.join("&"))
}};
self.client.get(&path)
self.client.get_json(&path)
}}
/// Get the endpoint path.
@@ -13,13 +13,13 @@ use crate::{
/// Generate tree structs.
pub fn generate_tree(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) {
writeln!(output, "// Catalog tree\n").unwrap();
writeln!(output, "// Metrics tree\n").unwrap();
let pattern_lookup = metadata.pattern_lookup();
let mut generated = HashSet::new();
generate_tree_node(
output,
"CatalogTree",
"MetricsTree",
catalog,
&pattern_lookup,
metadata,
@@ -39,7 +39,7 @@ fn generate_tree_node(
return;
};
writeln!(output, "/// Catalog tree node.").unwrap();
writeln!(output, "/// Metrics tree node.").unwrap();
writeln!(output, "pub struct {} {{", name).unwrap();
for ((field, child_fields), (child_name, _)) in
+75 -19
View File
@@ -2,7 +2,7 @@ use std::{collections::BTreeMap, io};
use crate::ref_to_type_name;
use oas3::Spec;
use oas3::spec::{ObjectOrReference, Operation, ParameterIn, PathItem, Schema, SchemaTypeSet};
use oas3::spec::{ObjectOrReference, ObjectSchema, Operation, ParameterIn, PathItem, Schema, SchemaType, SchemaTypeSet};
use serde_json::Value;
/// Type schema extracted from OpenAPI components
@@ -31,6 +31,8 @@ pub struct Endpoint {
pub response_type: Option<String>,
/// Whether this endpoint is deprecated
pub deprecated: bool,
/// Whether this endpoint supports CSV format (text/csv content type)
pub supports_csv: bool,
}
impl Endpoint {
@@ -186,10 +188,11 @@ fn get_operations(path_item: &PathItem) -> Vec<(String, &Operation)> {
}
fn extract_endpoint(path: &str, method: &str, operation: &Operation) -> Option<Endpoint> {
let path_params = extract_parameters(operation, ParameterIn::Path);
let path_params = extract_path_parameters(path, operation);
let query_params = extract_parameters(operation, ParameterIn::Query);
let response_type = extract_response_type(operation);
let supports_csv = check_csv_support(operation);
Some(Endpoint {
method: method.to_string(),
@@ -202,9 +205,51 @@ fn extract_endpoint(path: &str, method: &str, operation: &Operation) -> Option<E
query_params,
response_type,
deprecated: operation.deprecated.unwrap_or(false),
supports_csv,
})
}
/// Check if the endpoint supports CSV format (has text/csv in 200 response content types).
fn check_csv_support(operation: &Operation) -> bool {
let Some(responses) = operation.responses.as_ref() else {
return false;
};
let Some(response) = responses.get("200") else {
return false;
};
match response {
ObjectOrReference::Object(response) => response.content.contains_key("text/csv"),
ObjectOrReference::Ref { .. } => false,
}
}
/// Extract path parameters in the order they appear in the path URL.
fn extract_path_parameters(path: &str, operation: &Operation) -> Vec<Parameter> {
// Extract parameter names from the path in order (e.g., "/api/metric/{metric}/{index}" -> ["metric", "index"])
let path_order: Vec<&str> = path
.split('/')
.filter_map(|segment| {
segment
.strip_prefix('{')
.and_then(|s| s.strip_suffix('}'))
})
.collect();
// Get all path parameters from the operation
let params = extract_parameters(operation, ParameterIn::Path);
// Sort by position in the path
let mut sorted_params: Vec<Parameter> = params;
sorted_params.sort_by_key(|p| {
path_order
.iter()
.position(|&name| name == p.name)
.unwrap_or(usize::MAX)
});
sorted_params
}
fn extract_parameters(operation: &Operation, location: ParameterIn) -> Vec<Parameter> {
operation
.parameters
@@ -271,25 +316,36 @@ fn schema_type_from_schema(schema: &Schema) -> Option<String> {
}
}
fn schema_to_type_name(schema: &oas3::spec::ObjectSchema) -> Option<String> {
fn schema_to_type_name(schema: &ObjectSchema) -> Option<String> {
let schema_type = schema.schema_type.as_ref()?;
match schema_type {
SchemaTypeSet::Single(t) => match t {
oas3::spec::SchemaType::String => Some("string".to_string()),
oas3::spec::SchemaType::Number => Some("number".to_string()),
oas3::spec::SchemaType::Integer => Some("number".to_string()),
oas3::spec::SchemaType::Boolean => Some("boolean".to_string()),
oas3::spec::SchemaType::Array => {
let inner = match &schema.items {
Some(boxed_schema) => schema_type_from_schema(boxed_schema),
None => Some("*".to_string()),
};
inner.map(|t| format!("{}[]", t))
}
oas3::spec::SchemaType::Object => Some("Object".to_string()),
oas3::spec::SchemaType::Null => Some("null".to_string()),
},
SchemaTypeSet::Multiple(_) => Some("*".to_string()),
SchemaTypeSet::Single(t) => single_type_to_name(t, schema),
SchemaTypeSet::Multiple(types) => {
// For nullable types like ["integer", "null"], return the non-null type
types
.iter()
.find(|t| !matches!(t, SchemaType::Null))
.and_then(|t| single_type_to_name(t, schema))
.or(Some("*".to_string()))
}
}
}
fn single_type_to_name(t: &SchemaType, schema: &ObjectSchema) -> Option<String> {
match t {
SchemaType::String => Some("string".to_string()),
SchemaType::Number => Some("number".to_string()),
SchemaType::Integer => Some("number".to_string()),
SchemaType::Boolean => Some("boolean".to_string()),
SchemaType::Array => {
let inner = match &schema.items {
Some(boxed_schema) => schema_type_from_schema(boxed_schema),
None => Some("*".to_string()),
};
inner.map(|t| format!("{}[]", t))
}
SchemaType::Object => Some("Object".to_string()),
SchemaType::Null => Some("null".to_string()),
}
}
+20 -8
View File
@@ -21,9 +21,21 @@ pub struct GenericSyntax {
}
impl GenericSyntax {
pub const PYTHON: Self = Self { open: '[', close: ']', default_type: "Any" };
pub const JAVASCRIPT: Self = Self { open: '<', close: '>', default_type: "unknown" };
pub const RUST: Self = Self { open: '<', close: '>', default_type: "_" };
pub const PYTHON: Self = Self {
open: '[',
close: ']',
default_type: "Any",
};
pub const JAVASCRIPT: Self = Self {
open: '<',
close: '>',
default_type: "unknown",
};
pub const RUST: Self = Self {
open: '<',
close: '>',
default_type: "_",
};
pub fn wrap(&self, name: &str, type_param: &str) -> String {
// Convert the type_param from Rust syntax to target syntax
@@ -46,11 +58,11 @@ impl GenericSyntax {
/// Extract the innermost type from nested generics.
/// E.g., `Close<Cents>` -> `Cents`, `Foo<Bar<Baz>>` -> `Baz`
fn extract_inner_type_recursive(type_str: &str) -> String {
if let Some(start) = type_str.find('<') {
if let Some(end) = type_str.rfind('>') {
let inner = &type_str[start + 1..end];
return extract_inner_type_recursive(inner);
}
if let Some(start) = type_str.find('<')
&& let Some(end) = type_str.rfind('>')
{
let inner = &type_str[start + 1..end];
return extract_inner_type_recursive(inner);
}
type_str.to_string()
}
+20 -8
View File
@@ -1,6 +1,7 @@
//! Basic example of using the BRK client.
use brk_client::{BrkClient, BrkClientOptions};
use brk_types::{FormatResponse, Index, Metric};
fn main() -> brk_client::Result<()> {
// Create client with default options
@@ -12,9 +13,9 @@ fn main() -> brk_client::Result<()> {
timeout_secs: 60,
});
// Fetch price data using the typed tree API
// Fetch price data using the typed metrics API
let price_close = client
.tree()
.metrics()
.price
.usd
.split
@@ -26,7 +27,7 @@ fn main() -> brk_client::Result<()> {
// Fetch block data
let block_count = client
.tree()
.metrics()
.blocks
.count
.block_count
@@ -40,7 +41,7 @@ fn main() -> brk_client::Result<()> {
//
dbg!(
client
.tree()
.metrics()
.supply
.circulating
.bitcoin
@@ -49,7 +50,7 @@ fn main() -> brk_client::Result<()> {
.path()
);
let circulating = client
.tree()
.metrics()
.supply
.circulating
.bitcoin
@@ -59,9 +60,20 @@ fn main() -> brk_client::Result<()> {
println!("Last 3 circulating supply values: {:?}", circulating);
// Using generic metric fetching
let metricdata =
client.get_metric_by_index("dateindex", "price_close", None, None, Some("-3"), None)?;
println!("Generic fetch result count: {}", metricdata.data.len());
let metricdata = client.get_metric_by_index(
Metric::from("price_close"),
Index::DateIndex,
Some(-3),
None,
None,
None,
)?;
match metricdata {
FormatResponse::Json(m) => {
println!("Generic fetch result count: {}", m.data.len());
}
FormatResponse::Csv(_) => panic!(),
};
Ok(())
}
+2639 -1273
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -86,8 +86,8 @@ impl Query {
params: &DataRangeFormat,
) -> Result<Output> {
let len = metric.len();
let from = params.from().map(|from| metric.i64_to_usize(from));
let to = params.to_for_len(len).map(|to| metric.i64_to_usize(to));
let from = params.start().map(|start| metric.i64_to_usize(start));
let to = params.end_for_len(len).map(|end| metric.i64_to_usize(end));
Ok(match params.format() {
Format::CSV => Output::CSV(Self::columns_to_csv(
@@ -112,18 +112,18 @@ impl Query {
// Use min length across metrics for consistent count resolution
let min_len = metrics.iter().map(|v| v.len()).min().unwrap_or(0);
let from = params.from().map(|from| {
let from = params.start().map(|start| {
metrics
.iter()
.map(|v| v.i64_to_usize(from))
.map(|v| v.i64_to_usize(start))
.min()
.unwrap_or_default()
});
let to = params.to_for_len(min_len).map(|to| {
let to = params.end_for_len(min_len).map(|end| {
metrics
.iter()
.map(|v| v.i64_to_usize(to))
.map(|v| v.i64_to_usize(end))
.min()
.unwrap_or_default()
});
@@ -200,7 +200,7 @@ impl Query {
let metric = vecs.first().expect("search guarantees non-empty on success");
let weight = Self::weight(&vecs, params.from(), params.to_for_len(metric.len()));
let weight = Self::weight(&vecs, params.start(), params.end_for_len(metric.len()));
if weight > max_weight {
return Err(Error::WeightExceeded {
requested: weight,
@@ -225,7 +225,7 @@ impl Query {
let vecs = self.search(&params)?;
let min_len = vecs.iter().map(|v| v.len()).min().expect("search guarantees non-empty");
let weight = Self::weight(&vecs, params.from(), params.to_for_len(min_len));
let weight = Self::weight(&vecs, params.start(), params.end_for_len(min_len));
if weight > max_weight {
return Err(Error::WeightExceeded {
requested: weight,
+5 -5
View File
@@ -10,12 +10,12 @@ impl Query {
let min_len = metrics.iter().map(|v| v.len()).min().unwrap_or(0);
let from = params
.from()
.map(|from| metrics.iter().map(|v| v.i64_to_usize(from)).min().unwrap_or_default());
.start()
.map(|start| metrics.iter().map(|v| v.i64_to_usize(start)).min().unwrap_or_default());
let to = params
.to_for_len(min_len)
.map(|to| metrics.iter().map(|v| v.i64_to_usize(to)).min().unwrap_or_default());
.end_for_len(min_len)
.map(|end| metrics.iter().map(|v| v.i64_to_usize(end)).min().unwrap_or_default());
let format = params.format();
@@ -60,7 +60,7 @@ impl Query {
let vecs = self.search(&params)?;
let min_len = vecs.iter().map(|v| v.len()).min().expect("search guarantees non-empty");
let weight = Self::weight(&vecs, params.from(), params.to_for_len(min_len));
let weight = Self::weight(&vecs, params.start(), params.end_for_len(min_len));
if weight > max_weight {
return Err(Error::WeightExceeded {
requested: weight,
+20 -22
View File
@@ -2,8 +2,7 @@ use aide::axum::{ApiRouter, routing::get_with};
use axum::{
extract::{Path, Query, State},
http::{HeaderMap, Uri},
response::{IntoResponse, Redirect, Response},
routing::get,
response::{IntoResponse, Response},
};
use brk_query::{
DataRangeFormat, MetricSelection, MetricSelectionLegacy, PaginatedMetrics, Pagination,
@@ -31,10 +30,23 @@ pub trait ApiMetricsRoutes {
impl ApiMetricsRoutes for ApiRouter<AppState> {
fn add_metrics_routes(self) -> Self {
self
.route("/api/metric", get(Redirect::temporary("/api/metrics")))
.route("/api/metrics", get(Redirect::temporary("/api#tag/metrics")))
.api_route(
self.api_route(
"/api/metrics",
get_with(
async |headers: HeaderMap, State(state): State<AppState>| {
state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.metrics_catalog().clone())).await
},
|op| op
.metrics_tag()
.summary("Metrics catalog")
.description(
"Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Best viewed in an interactive JSON viewer (e.g., Firefox's built-in JSON viewer) for easy navigation of the nested structure."
)
.ok_response::<TreeNode>()
.not_modified(),
),
)
.api_route(
"/api/metrics/count",
get_with(
async |
@@ -88,22 +100,6 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
.not_modified(),
),
)
.api_route(
"/api/metrics/catalog",
get_with(
async |headers: HeaderMap, State(state): State<AppState>| {
state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.metrics_catalog().clone())).await
},
|op| op
.metrics_tag()
.summary("Metrics catalog")
.description(
"Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Best viewed in an interactive JSON viewer (e.g., Firefox's built-in JSON viewer) for easy navigation of the nested structure."
)
.ok_response::<TreeNode>()
.not_modified(),
),
)
.api_route(
"/api/metrics/search/{metric}",
get_with(
@@ -177,6 +173,7 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
Use query parameters to filter by date range and format (json/csv)."
)
.ok_response::<MetricData>()
.csv_response()
.not_modified()
.not_found(),
),
@@ -193,6 +190,7 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
Returns an array of MetricData objects."
)
.ok_response::<Vec<MetricData>>()
.csv_response()
.not_modified(),
),
)
@@ -1,3 +1,4 @@
use aide::openapi::{MediaType, ReferenceOr, StatusCode};
use aide::transform::{TransformOperation, TransformResponse};
use axum::Json;
use schemars::JsonSchema;
@@ -23,6 +24,8 @@ pub trait TransformResponseExtended<'t> {
where
R: JsonSchema,
F: FnOnce(TransformResponse<'_, R>) -> TransformResponse<'_, R>;
/// 200 with text/csv content type (adds CSV as alternative response format)
fn csv_response(self) -> Self;
/// 400
fn bad_request(self) -> Self;
/// 404
@@ -82,6 +85,19 @@ impl<'t> TransformResponseExtended<'t> for TransformOperation<'t> {
self.response_with::<200, Json<R>, _>(|res| f(res.description("Successful response")))
}
fn csv_response(mut self) -> Self {
// Add text/csv content type to existing 200 response
if let Some(responses) = &mut self.inner_mut().responses
&& let Some(ReferenceOr::Item(response)) =
responses.responses.get_mut(&StatusCode::Code(200))
{
response
.content
.insert("text/csv".into(), MediaType::default());
}
self
}
fn bad_request(self) -> Self {
self.response_with::<400, Json<String>, _>(|res| {
res.description("Invalid request parameters")
+20 -20
View File
@@ -7,29 +7,29 @@ use crate::{de_unquote_i64, de_unquote_usize};
#[derive(Default, Debug, Deserialize, JsonSchema)]
pub struct DataRange {
/// Inclusive starting index, if negative counts from end
#[serde(default, alias = "f", deserialize_with = "de_unquote_i64")]
#[serde(default, alias = "s", alias = "from", alias = "f", deserialize_with = "de_unquote_i64")]
#[schemars(example = 0, example = -1, example = -10, example = -1000)]
from: Option<i64>,
start: Option<i64>,
/// Exclusive ending index, if negative counts from end
#[serde(default, alias = "t", deserialize_with = "de_unquote_i64")]
#[serde(default, alias = "e", alias = "to", alias = "t", deserialize_with = "de_unquote_i64")]
#[schemars(example = 1000)]
to: Option<i64>,
end: Option<i64>,
/// Number of values to return (ignored if `to` is set)
/// Number of values to return (ignored if `end` is set)
#[serde(default, alias = "c", deserialize_with = "de_unquote_usize")]
#[schemars(example = 1, example = 10, example = 100)]
count: Option<usize>,
}
impl DataRange {
pub fn set_from(mut self, from: i64) -> Self {
self.from.replace(from);
pub fn set_start(mut self, start: i64) -> Self {
self.start.replace(start);
self
}
pub fn set_to(mut self, to: i64) -> Self {
self.to.replace(to);
pub fn set_end(mut self, end: i64) -> Self {
self.end.replace(end);
self
}
@@ -38,27 +38,27 @@ impl DataRange {
self
}
/// Get the raw `from` value
pub fn from(&self) -> Option<i64> {
self.from
/// Get the raw `start` value
pub fn start(&self) -> Option<i64> {
self.start
}
/// Get `to` value, computing it from `from + count` if `to` is unset but `count` is set.
/// Requires the vec length to resolve negative `from` indices before adding count.
pub fn to_for_len(&self, len: usize) -> Option<i64> {
if self.to.is_some() {
return self.to;
/// Get `end` value, computing it from `start + count` if `end` is unset but `count` is set.
/// Requires the vec length to resolve negative `start` indices before adding count.
pub fn end_for_len(&self, len: usize) -> Option<i64> {
if self.end.is_some() {
return self.end;
}
self.count.map(|count| {
let resolved_from = self.resolve_index(self.from, len, 0);
(resolved_from + count).min(len) as i64
let resolved_start = self.resolve_index(self.start, len, 0);
(resolved_start + count).min(len) as i64
})
}
/// Returns a string for etag/cache key generation that captures all range parameters
pub fn etag_suffix(&self) -> String {
format!("{:?}{:?}{:?}", self.from, self.to, self.count)
format!("{:?}{:?}{:?}", self.start, self.end, self.count)
}
fn resolve_index(&self, idx: Option<i64>, len: usize, default: usize) -> usize {
+4 -4
View File
@@ -21,13 +21,13 @@ impl DataRangeFormat {
self.format
}
pub fn set_from(mut self, from: i64) -> Self {
self.range = self.range.set_from(from);
pub fn set_start(mut self, start: i64) -> Self {
self.range = self.range.set_start(start);
self
}
pub fn set_to(mut self, to: i64) -> Self {
self.range = self.range.set_to(to);
pub fn set_end(mut self, end: i64) -> Self {
self.range = self.range.set_end(end);
self
}
+6
View File
@@ -17,6 +17,9 @@ where
if s.starts_with('"') && s.ends_with('"') && s.len() >= 2 {
s = s[1..s.len() - 1].to_string();
}
if s == "null" || s.is_empty() {
return Ok(None);
}
s.parse::<i64>().map(Some).map_err(serde::de::Error::custom)
} else if let Some(n) = value.as_i64() {
Ok(Some(n))
@@ -41,6 +44,9 @@ where
if s.starts_with('"') && s.ends_with('"') && s.len() >= 2 {
s = s[1..s.len() - 1].to_string();
}
if s == "null" || s.is_empty() {
return Ok(None);
}
s.parse::<usize>()
.map(Some)
.map_err(serde::de::Error::custom)
+11
View File
@@ -1,3 +1,5 @@
use std::fmt;
use schemars::JsonSchema;
use serde::Deserialize;
@@ -13,6 +15,15 @@ pub enum Format {
CSV,
}
impl fmt::Display for Format {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Format::JSON => write!(f, "json"),
Format::CSV => write!(f, "csv"),
}
}
}
impl From<Option<String>> for Format {
#[inline]
fn from(value: Option<String>) -> Self {
+36
View File
@@ -0,0 +1,36 @@
/// Response type for endpoints that support multiple formats (JSON/CSV).
#[derive(Debug, Clone)]
pub enum FormatResponse<T> {
/// JSON response, deserialized to T.
Json(T),
/// CSV response as raw string.
Csv(String),
}
impl<T> FormatResponse<T> {
/// Unwrap the JSON variant, panicking if this is CSV.
pub fn json(self) -> T {
match self {
FormatResponse::Json(v) => v,
FormatResponse::Csv(_) => panic!("expected JSON response, got CSV"),
}
}
/// Unwrap the CSV variant, panicking if this is JSON.
pub fn csv(self) -> String {
match self {
FormatResponse::Csv(s) => s,
FormatResponse::Json(_) => panic!("expected CSV response, got JSON"),
}
}
/// Returns true if this is a JSON response.
pub fn is_json(&self) -> bool {
matches!(self, FormatResponse::Json(_))
}
/// Returns true if this is a CSV response.
pub fn is_csv(&self) -> bool {
matches!(self, FormatResponse::Csv(_))
}
}
+2
View File
@@ -54,6 +54,7 @@ mod emptyoutputindex;
mod feerate;
mod feeratepercentiles;
mod format;
mod formatresponse;
mod halvingepoch;
mod hashrateentry;
mod hashratesummary;
@@ -215,6 +216,7 @@ pub use emptyoutputindex::*;
pub use feerate::*;
pub use feeratepercentiles::*;
pub use format::*;
pub use formatresponse::*;
pub use halvingepoch::*;
pub use hashrateentry::*;
pub use hashratesummary::*;
+8
View File
@@ -1,3 +1,5 @@
use std::fmt;
use derive_more::Deref;
use schemars::JsonSchema;
use serde::Deserialize;
@@ -19,3 +21,9 @@ impl Default for Limit {
Self::DEFAULT
}
}
impl fmt::Display for Limit {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
+9 -9
View File
@@ -14,30 +14,30 @@ pub struct MetricData<T = Value> {
/// Total number of data points in the metric
pub total: usize,
/// Start index (inclusive) of the returned range
pub from: usize,
pub start: usize,
/// End index (exclusive) of the returned range
pub to: usize,
pub end: usize,
/// The metric data
pub data: Vec<T>,
}
impl MetricData {
/// Write metric data as JSON to buffer: `{"total":N,"from":N,"to":N,"data":[...]}`
/// Write metric data as JSON to buffer: `{"total":N,"start":N,"end":N,"data":[...]}`
pub fn serialize(
vec: &dyn AnySerializableVec,
from: Option<usize>,
to: Option<usize>,
start: Option<usize>,
end: Option<usize>,
buf: &mut Vec<u8>,
) -> vecdb::Result<()> {
let total = vec.len();
let from_idx = from.unwrap_or(0);
let to_idx = to.unwrap_or(total).min(total);
let start_idx = start.unwrap_or(0);
let end_idx = end.unwrap_or(total).min(total);
write!(
buf,
r#"{{"total":{total},"from":{from_idx},"to":{to_idx},"data":"#
r#"{{"total":{total},"start":{start_idx},"end":{end_idx},"data":"#
)?;
vec.write_json(from, to, buf)?;
vec.write_json(start, end, buf)?;
buf.push(b'}');
Ok(())
}
+18
View File
@@ -1,3 +1,5 @@
use std::fmt;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -60,3 +62,19 @@ impl TimePeriod {
}
}
}
impl fmt::Display for TimePeriod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
TimePeriod::Day => write!(f, "24h"),
TimePeriod::ThreeDays => write!(f, "3d"),
TimePeriod::Week => write!(f, "1w"),
TimePeriod::Month => write!(f, "1m"),
TimePeriod::ThreeMonths => write!(f, "3m"),
TimePeriod::SixMonths => write!(f, "6m"),
TimePeriod::Year => write!(f, "1y"),
TimePeriod::TwoYears => write!(f, "2y"),
TimePeriod::ThreeYears => write!(f, "3y"),
}
}
}
+2701 -3496
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-2
View File
@@ -16,7 +16,6 @@ classifiers = [
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
]
dependencies = ["httpx>=0.25.0"]
[project.urls]
Homepage = "https://bitcoinresearchkit.org"
@@ -24,7 +23,6 @@ Repository = "https://github.com/bitcoinresearchkit/brk"
[dependency-groups]
dev = [
"lazydocs>=0.4.8",
"pydoc-markdown>=4.8.2",
"pytest",
]
+1
View File
@@ -1,3 +1,4 @@
uv run pytest tests/basic.py -s
uvx pydoc-markdown > DOCS.md
uv build
uvx uv-publish
+23 -14
View File
@@ -1,18 +1,20 @@
# Run:
# uv run pytest tests/basic.py -s
from __future__ import print_function
from brk_client import BrkClient
def test_client_creation():
client = BrkClient("http://localhost:3110")
assert client.base_url == "http://localhost:3110"
BrkClient("http://localhost:3110")
def test_tree_exists():
client = BrkClient("http://localhost:3110")
assert hasattr(client, "tree")
assert hasattr(client.tree, "price")
assert hasattr(client.tree, "blocks")
assert hasattr(client, "metrics")
assert hasattr(client.metrics, "price")
assert hasattr(client.metrics, "blocks")
def test_fetch_block():
@@ -20,28 +22,35 @@ def test_fetch_block():
print(client.get_block_height(800000))
def test_fetch_any_metric():
def test_fetch_json_metric():
client = BrkClient("http://localhost:3110")
print(client.get_metric_by_index("dateindex", "price_close"))
a = client.get_metric_by_index("price_close", "dateindex")
print(a)
def test_fetch_csv_metric():
client = BrkClient("http://localhost:3110")
a = client.get_metric_by_index("price_close", "dateindex", -10, None, None, "csv")
print(a)
def test_fetch_typed_metric():
client = BrkClient("http://localhost:3110")
a = client.tree.constants.constant_0.by.dateindex().range(-10)
a = client.metrics.constants.constant_0.by.dateindex().range(-10)
print(a)
b = client.tree.outputs.count.utxo_count.by.height().range(-10)
b = client.metrics.outputs.count.utxo_count.by.height().range(-10)
print(b)
c = client.tree.price.usd.split.close.by.dateindex().range(-10)
c = client.metrics.price.usd.split.close.by.dateindex().range(-10)
print(c)
d = client.tree.market.dca.period_lump_sum_stack._10y.dollars.by.dateindex().range(
d = client.metrics.market.dca.period_lump_sum_stack._10y.dollars.by.dateindex().range(
-10
)
print(d)
e = client.tree.market.dca.class_average_price._2017.by.dateindex().range(-10)
e = client.metrics.market.dca.class_average_price._2017.by.dateindex().range(-10)
print(e)
f = client.tree.distribution.address_cohorts.amount_range._10k_sats_to_100k_sats.activity.sent.dollars.cumulative.by.dateindex().range(
f = client.metrics.distribution.address_cohorts.amount_range._10k_sats_to_100k_sats.activity.sent.dollars.cumulative.by.dateindex().range(
-10
)
print(f)
g = client.tree.price.usd.ohlc.by.dateindex().range(-10)
g = client.metrics.price.usd.ohlc.by.dateindex().range(-10)
print(g)
+65 -127
View File
@@ -1,19 +1,6 @@
version = 1
revision = 3
requires-python = ">=3.12"
[[package]]
name = "anyio"
version = "4.12.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "idna" },
{ name = "typing-extensions", marker = "python_full_version < '3.13'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" },
]
requires-python = ">=3.11"
[[package]]
name = "black"
@@ -28,6 +15,10 @@ dependencies = [
]
sdist = { url = "https://files.pythonhosted.org/packages/fd/f4/a57cde4b60da0e249073009f4a9087e9e0a955deae78d3c2a493208d0c5c/black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5", size = 620809, upload-time = "2023-12-22T23:06:17.382Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ed/2c/d9b1a77101e6e5f294f6553d76c39322122bfea2a438aeea4eb6d4b22749/black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba", size = 1541926, upload-time = "2023-12-22T23:23:17.72Z" },
{ url = "https://files.pythonhosted.org/packages/72/e2/d981a3ff05ba9abe3cfa33e70c986facb0614fd57c4f802ef435f4dd1697/black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b", size = 1388465, upload-time = "2023-12-22T23:19:00.611Z" },
{ url = "https://files.pythonhosted.org/packages/eb/59/1f5c8eb7bba8a8b1bb5c87f097d16410c93a48a6655be3773db5d2783deb/black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59", size = 1691993, upload-time = "2023-12-22T23:08:32.018Z" },
{ url = "https://files.pythonhosted.org/packages/37/bf/a80abc6fcdb00f0d4d3d74184b172adbf2197f6b002913fa0fb6af4dc6db/black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50", size = 1340929, upload-time = "2023-12-22T23:09:37.088Z" },
{ url = "https://files.pythonhosted.org/packages/66/16/8726cedc83be841dfa854bbeef1288ee82272282a71048d7935292182b0b/black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e", size = 1569989, upload-time = "2023-12-22T23:20:22.158Z" },
{ url = "https://files.pythonhosted.org/packages/d2/1e/30f5eafcc41b8378890ba39b693fa111f7dca8a2620ba5162075d95ffe46/black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec", size = 1398647, upload-time = "2023-12-22T23:19:57.225Z" },
{ url = "https://files.pythonhosted.org/packages/99/de/ddb45cc044256431d96d846ce03164d149d81ca606b5172224d1872e0b58/black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e", size = 1720450, upload-time = "2023-12-22T23:08:52.675Z" },
@@ -39,23 +30,17 @@ wheels = [
name = "brk-client"
version = "0.1.0a2"
source = { editable = "." }
dependencies = [
{ name = "httpx" },
]
[package.dev-dependencies]
dev = [
{ name = "lazydocs" },
{ name = "pydoc-markdown" },
{ name = "pytest" },
]
[package.metadata]
requires-dist = [{ name = "httpx", specifier = ">=0.25.0" }]
[package.metadata.requires-dev]
dev = [
{ name = "lazydocs", specifier = ">=0.4.8" },
{ name = "pydoc-markdown", specifier = ">=4.8.2" },
{ name = "pytest" },
]
@@ -75,6 +60,22 @@ version = "3.4.4"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" },
{ url = "https://files.pythonhosted.org/packages/94/59/2e87300fe67ab820b5428580a53cad894272dbb97f38a7a814a2a1ac1011/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0", size = 147324, upload-time = "2025-10-14T04:40:34.961Z" },
{ url = "https://files.pythonhosted.org/packages/07/fb/0cf61dc84b2b088391830f6274cb57c82e4da8bbc2efeac8c025edb88772/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3", size = 142742, upload-time = "2025-10-14T04:40:36.105Z" },
{ url = "https://files.pythonhosted.org/packages/62/8b/171935adf2312cd745d290ed93cf16cf0dfe320863ab7cbeeae1dcd6535f/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc", size = 160863, upload-time = "2025-10-14T04:40:37.188Z" },
{ url = "https://files.pythonhosted.org/packages/09/73/ad875b192bda14f2173bfc1bc9a55e009808484a4b256748d931b6948442/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897", size = 157837, upload-time = "2025-10-14T04:40:38.435Z" },
{ url = "https://files.pythonhosted.org/packages/6d/fc/de9cce525b2c5b94b47c70a4b4fb19f871b24995c728e957ee68ab1671ea/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381", size = 151550, upload-time = "2025-10-14T04:40:40.053Z" },
{ url = "https://files.pythonhosted.org/packages/55/c2/43edd615fdfba8c6f2dfbd459b25a6b3b551f24ea21981e23fb768503ce1/charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815", size = 149162, upload-time = "2025-10-14T04:40:41.163Z" },
{ url = "https://files.pythonhosted.org/packages/03/86/bde4ad8b4d0e9429a4e82c1e8f5c659993a9a863ad62c7df05cf7b678d75/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0", size = 150019, upload-time = "2025-10-14T04:40:42.276Z" },
{ url = "https://files.pythonhosted.org/packages/1f/86/a151eb2af293a7e7bac3a739b81072585ce36ccfb4493039f49f1d3cae8c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161", size = 143310, upload-time = "2025-10-14T04:40:43.439Z" },
{ url = "https://files.pythonhosted.org/packages/b5/fe/43dae6144a7e07b87478fdfc4dbe9efd5defb0e7ec29f5f58a55aeef7bf7/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4", size = 162022, upload-time = "2025-10-14T04:40:44.547Z" },
{ url = "https://files.pythonhosted.org/packages/80/e6/7aab83774f5d2bca81f42ac58d04caf44f0cc2b65fc6db2b3b2e8a05f3b3/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89", size = 149383, upload-time = "2025-10-14T04:40:46.018Z" },
{ url = "https://files.pythonhosted.org/packages/4f/e8/b289173b4edae05c0dde07f69f8db476a0b511eac556dfe0d6bda3c43384/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569", size = 159098, upload-time = "2025-10-14T04:40:47.081Z" },
{ url = "https://files.pythonhosted.org/packages/d8/df/fe699727754cae3f8478493c7f45f777b17c3ef0600e28abfec8619eb49c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224", size = 152991, upload-time = "2025-10-14T04:40:48.246Z" },
{ url = "https://files.pythonhosted.org/packages/1a/86/584869fe4ddb6ffa3bd9f491b87a01568797fb9bd8933f557dba9771beaf/charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a", size = 99456, upload-time = "2025-10-14T04:40:49.376Z" },
{ url = "https://files.pythonhosted.org/packages/65/f6/62fdd5feb60530f50f7e38b4f6a1d5203f4d16ff4f9f0952962c044e919a/charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016", size = 106978, upload-time = "2025-10-14T04:40:50.844Z" },
{ url = "https://files.pythonhosted.org/packages/7a/9d/0710916e6c82948b3be62d9d398cb4fcf4e97b56d6a6aeccd66c4b2f2bd5/charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1", size = 99969, upload-time = "2025-10-14T04:40:52.272Z" },
{ url = "https://files.pythonhosted.org/packages/f3/85/1637cd4af66fa687396e757dec650f28025f2a2f5a5531a3208dc0ec43f2/charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394", size = 208425, upload-time = "2025-10-14T04:40:53.353Z" },
{ url = "https://files.pythonhosted.org/packages/9d/6a/04130023fef2a0d9c62d0bae2649b69f7b7d8d24ea5536feef50551029df/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25", size = 148162, upload-time = "2025-10-14T04:40:54.558Z" },
{ url = "https://files.pythonhosted.org/packages/78/29/62328d79aa60da22c9e0b9a66539feae06ca0f5a4171ac4f7dc285b83688/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef", size = 144558, upload-time = "2025-10-14T04:40:55.677Z" },
@@ -233,43 +234,6 @@ version = "0.11"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/a2/ce/5d6a3782b9f88097ce3e579265015db3372ae78d12f67629b863a9208c96/docstring_parser-0.11.tar.gz", hash = "sha256:93b3f8f481c7d24e37c5d9f30293c89e2933fa209421c8abd731dd3ef0715ecb", size = 22775, upload-time = "2021-09-30T07:44:10.288Z" }
[[package]]
name = "h11"
version = "0.16.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
]
[[package]]
name = "httpcore"
version = "1.0.9"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "certifi" },
{ name = "h11" },
]
sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
]
[[package]]
name = "httpx"
version = "0.28.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
{ name = "certifi" },
{ name = "httpcore" },
{ name = "idna" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
]
[[package]]
name = "idna"
version = "3.11"
@@ -300,36 +264,23 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
]
[[package]]
name = "lazydocs"
version = "0.4.8"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "typer" },
]
sdist = { url = "https://files.pythonhosted.org/packages/10/d2/ff630536151c8f5aaf03aebbc963f570dc9f2af0b3f35c11774e0c4c75af/lazydocs-0.4.8.tar.gz", hash = "sha256:8ac1fda05f03e0c5ae1d30b81eaeb785476efa161194a5e8bfa8630e14af9562", size = 23218, upload-time = "2021-07-27T08:05:43.759Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/96/9e/6b8b057eb511ea904a4fd6a835fee0a87ccb08edd64026e783a3ee6bb8c5/lazydocs-0.4.8-py3-none-any.whl", hash = "sha256:cebdce88c8e01ae19c63da77fc25a16abd6f7a7055930001644703643e608fed", size = 17611, upload-time = "2021-07-27T08:05:42.386Z" },
]
[[package]]
name = "markdown-it-py"
version = "4.0.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "mdurl" },
]
sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" },
]
[[package]]
name = "markupsafe"
version = "3.0.3"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/08/db/fefacb2136439fc8dd20e797950e749aa1f4997ed584c62cfb8ef7c2be0e/markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad", size = 11631, upload-time = "2025-09-27T18:36:18.185Z" },
{ url = "https://files.pythonhosted.org/packages/e1/2e/5898933336b61975ce9dc04decbc0a7f2fee78c30353c5efba7f2d6ff27a/markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a", size = 12058, upload-time = "2025-09-27T18:36:19.444Z" },
{ url = "https://files.pythonhosted.org/packages/1d/09/adf2df3699d87d1d8184038df46a9c80d78c0148492323f4693df54e17bb/markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50", size = 24287, upload-time = "2025-09-27T18:36:20.768Z" },
{ url = "https://files.pythonhosted.org/packages/30/ac/0273f6fcb5f42e314c6d8cd99effae6a5354604d461b8d392b5ec9530a54/markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf", size = 22940, upload-time = "2025-09-27T18:36:22.249Z" },
{ url = "https://files.pythonhosted.org/packages/19/ae/31c1be199ef767124c042c6c3e904da327a2f7f0cd63a0337e1eca2967a8/markupsafe-3.0.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f", size = 21887, upload-time = "2025-09-27T18:36:23.535Z" },
{ url = "https://files.pythonhosted.org/packages/b2/76/7edcab99d5349a4532a459e1fe64f0b0467a3365056ae550d3bcf3f79e1e/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a", size = 23692, upload-time = "2025-09-27T18:36:24.823Z" },
{ url = "https://files.pythonhosted.org/packages/a4/28/6e74cdd26d7514849143d69f0bf2399f929c37dc2b31e6829fd2045b2765/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115", size = 21471, upload-time = "2025-09-27T18:36:25.95Z" },
{ url = "https://files.pythonhosted.org/packages/62/7e/a145f36a5c2945673e590850a6f8014318d5577ed7e5920a4b3448e0865d/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a", size = 22923, upload-time = "2025-09-27T18:36:27.109Z" },
{ url = "https://files.pythonhosted.org/packages/0f/62/d9c46a7f5c9adbeeeda52f5b8d802e1094e9717705a645efc71b0913a0a8/markupsafe-3.0.3-cp311-cp311-win32.whl", hash = "sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19", size = 14572, upload-time = "2025-09-27T18:36:28.045Z" },
{ url = "https://files.pythonhosted.org/packages/83/8a/4414c03d3f891739326e1783338e48fb49781cc915b2e0ee052aa490d586/markupsafe-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01", size = 15077, upload-time = "2025-09-27T18:36:29.025Z" },
{ url = "https://files.pythonhosted.org/packages/35/73/893072b42e6862f319b5207adc9ae06070f095b358655f077f69a35601f0/markupsafe-3.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c", size = 13876, upload-time = "2025-09-27T18:36:29.954Z" },
{ url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" },
{ url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" },
{ url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" },
@@ -387,15 +338,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" },
]
[[package]]
name = "mdurl"
version = "0.1.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
]
[[package]]
name = "mypy-extensions"
version = "1.1.0"
@@ -528,6 +470,15 @@ version = "6.0.3"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" },
{ url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" },
{ url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" },
{ url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" },
{ url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" },
{ url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" },
{ url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" },
{ url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" },
{ url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" },
{ url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" },
{ url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" },
{ url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" },
@@ -583,34 +534,21 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" },
]
[[package]]
name = "rich"
version = "14.2.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "markdown-it-py" },
{ name = "pygments" },
]
sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" },
]
[[package]]
name = "shellingham"
version = "1.5.4"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
]
[[package]]
name = "tomli"
version = "2.4.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/3c/d9/3dc2289e1f3b32eb19b9785b6a006b28ee99acb37d1d47f78d4c10e28bf8/tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867", size = 153663, upload-time = "2026-01-11T11:21:45.27Z" },
{ url = "https://files.pythonhosted.org/packages/51/32/ef9f6845e6b9ca392cd3f64f9ec185cc6f09f0a2df3db08cbe8809d1d435/tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9", size = 148469, upload-time = "2026-01-11T11:21:46.873Z" },
{ url = "https://files.pythonhosted.org/packages/d6/c2/506e44cce89a8b1b1e047d64bd495c22c9f71f21e05f380f1a950dd9c217/tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95", size = 236039, upload-time = "2026-01-11T11:21:48.503Z" },
{ url = "https://files.pythonhosted.org/packages/b3/40/e1b65986dbc861b7e986e8ec394598187fa8aee85b1650b01dd925ca0be8/tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76", size = 243007, upload-time = "2026-01-11T11:21:49.456Z" },
{ url = "https://files.pythonhosted.org/packages/9c/6f/6e39ce66b58a5b7ae572a0f4352ff40c71e8573633deda43f6a379d56b3e/tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d", size = 240875, upload-time = "2026-01-11T11:21:50.755Z" },
{ url = "https://files.pythonhosted.org/packages/aa/ad/cb089cb190487caa80204d503c7fd0f4d443f90b95cf4ef5cf5aa0f439b0/tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576", size = 246271, upload-time = "2026-01-11T11:21:51.81Z" },
{ url = "https://files.pythonhosted.org/packages/0b/63/69125220e47fd7a3a27fd0de0c6398c89432fec41bc739823bcc66506af6/tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a", size = 96770, upload-time = "2026-01-11T11:21:52.647Z" },
{ url = "https://files.pythonhosted.org/packages/1e/0d/a22bb6c83f83386b0008425a6cd1fa1c14b5f3dd4bad05e98cf3dbbf4a64/tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa", size = 107626, upload-time = "2026-01-11T11:21:53.459Z" },
{ url = "https://files.pythonhosted.org/packages/2f/6d/77be674a3485e75cacbf2ddba2b146911477bd887dda9d8c9dfb2f15e871/tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614", size = 94842, upload-time = "2026-01-11T11:21:54.831Z" },
{ url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" },
{ url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" },
{ url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" },
@@ -671,21 +609,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/d4/84/021bbeb7edb990dd6875cb6ab08d32faaa49fec63453d863730260a01f9e/typeapi-2.3.0-py3-none-any.whl", hash = "sha256:576b7dcb94412e91c5cae107a393674f8f99c10a24beb8be2302e3fed21d5cc2", size = 26858, upload-time = "2025-10-23T13:44:09.833Z" },
]
[[package]]
name = "typer"
version = "0.21.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "click" },
{ name = "rich" },
{ name = "shellingham" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/36/bf/8825b5929afd84d0dabd606c67cd57b8388cb3ec385f7ef19c5cc2202069/typer-0.21.1.tar.gz", hash = "sha256:ea835607cd752343b6b2b7ce676893e5a0324082268b48f27aa058bdb7d2145d", size = 110371, upload-time = "2026-01-06T11:21:10.989Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/a0/1d/d9257dd49ff2ca23ea5f132edf1281a0c4f9de8a762b9ae399b670a59235/typer-0.21.1-py3-none-any.whl", hash = "sha256:7985e89081c636b88d172c2ee0cfe33c253160994d47bdfdc302defd7d1f1d01", size = 47381, upload-time = "2026-01-06T11:21:09.824Z" },
]
[[package]]
name = "typing-extensions"
version = "4.15.0"
@@ -710,6 +633,9 @@ version = "6.0.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/e0/24/d9be5cd6642a6aa68352ded4b4b10fb0d7889cb7f45814fb92cecd35f101/watchdog-6.0.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6eb11feb5a0d452ee41f824e271ca311a09e250441c262ca2fd7ebcf2461a06c", size = 96393, upload-time = "2024-11-01T14:06:31.756Z" },
{ url = "https://files.pythonhosted.org/packages/63/7a/6013b0d8dbc56adca7fdd4f0beed381c59f6752341b12fa0886fa7afc78b/watchdog-6.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ef810fbf7b781a5a593894e4f439773830bdecb885e6880d957d5b9382a960d2", size = 88392, upload-time = "2024-11-01T14:06:32.99Z" },
{ url = "https://files.pythonhosted.org/packages/d1/40/b75381494851556de56281e053700e46bff5b37bf4c7267e858640af5a7f/watchdog-6.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:afd0fe1b2270917c5e23c2a65ce50c2a4abb63daafb0d419fde368e272a76b7c", size = 89019, upload-time = "2024-11-01T14:06:34.963Z" },
{ url = "https://files.pythonhosted.org/packages/39/ea/3930d07dafc9e286ed356a679aa02d777c06e9bfd1164fa7c19c288a5483/watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", size = 96471, upload-time = "2024-11-01T14:06:37.745Z" },
{ url = "https://files.pythonhosted.org/packages/12/87/48361531f70b1f87928b045df868a9fd4e253d9ae087fa4cf3f7113be363/watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", size = 88449, upload-time = "2024-11-01T14:06:39.748Z" },
{ url = "https://files.pythonhosted.org/packages/5b/7e/8f322f5e600812e6f9a31b75d242631068ca8f4ef0582dd3ae6e72daecc8/watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", size = 89054, upload-time = "2024-11-01T14:06:41.009Z" },
@@ -734,6 +660,18 @@ version = "2.0.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/49/2a/6de8a50cb435b7f42c46126cf1a54b2aab81784e74c8595c8e025e8f36d3/wrapt-2.0.1.tar.gz", hash = "sha256:9c9c635e78497cacb81e84f8b11b23e0aacac7a136e73b8e5b2109a1d9fc468f", size = 82040, upload-time = "2025-11-07T00:45:33.312Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/98/60/553997acf3939079dab022e37b67b1904b5b0cc235503226898ba573b10c/wrapt-2.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0e17283f533a0d24d6e5429a7d11f250a58d28b4ae5186f8f47853e3e70d2590", size = 77480, upload-time = "2025-11-07T00:43:30.573Z" },
{ url = "https://files.pythonhosted.org/packages/2d/50/e5b3d30895d77c52105c6d5cbf94d5b38e2a3dd4a53d22d246670da98f7c/wrapt-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:85df8d92158cb8f3965aecc27cf821461bb5f40b450b03facc5d9f0d4d6ddec6", size = 60690, upload-time = "2025-11-07T00:43:31.594Z" },
{ url = "https://files.pythonhosted.org/packages/f0/40/660b2898703e5cbbb43db10cdefcc294274458c3ca4c68637c2b99371507/wrapt-2.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1be685ac7700c966b8610ccc63c3187a72e33cab53526a27b2a285a662cd4f7", size = 61578, upload-time = "2025-11-07T00:43:32.918Z" },
{ url = "https://files.pythonhosted.org/packages/5b/36/825b44c8a10556957bc0c1d84c7b29a40e05fcf1873b6c40aa9dbe0bd972/wrapt-2.0.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:df0b6d3b95932809c5b3fecc18fda0f1e07452d05e2662a0b35548985f256e28", size = 114115, upload-time = "2025-11-07T00:43:35.605Z" },
{ url = "https://files.pythonhosted.org/packages/83/73/0a5d14bb1599677304d3c613a55457d34c344e9b60eda8a737c2ead7619e/wrapt-2.0.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4da7384b0e5d4cae05c97cd6f94faaf78cc8b0f791fc63af43436d98c4ab37bb", size = 116157, upload-time = "2025-11-07T00:43:37.058Z" },
{ url = "https://files.pythonhosted.org/packages/01/22/1c158fe763dbf0a119f985d945711d288994fe5514c0646ebe0eb18b016d/wrapt-2.0.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ec65a78fbd9d6f083a15d7613b2800d5663dbb6bb96003899c834beaa68b242c", size = 112535, upload-time = "2025-11-07T00:43:34.138Z" },
{ url = "https://files.pythonhosted.org/packages/5c/28/4f16861af67d6de4eae9927799b559c20ebdd4fe432e89ea7fe6fcd9d709/wrapt-2.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7de3cc939be0e1174969f943f3b44e0d79b6f9a82198133a5b7fc6cc92882f16", size = 115404, upload-time = "2025-11-07T00:43:39.214Z" },
{ url = "https://files.pythonhosted.org/packages/a0/8b/7960122e625fad908f189b59c4aae2d50916eb4098b0fb2819c5a177414f/wrapt-2.0.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:fb1a5b72cbd751813adc02ef01ada0b0d05d3dcbc32976ce189a1279d80ad4a2", size = 111802, upload-time = "2025-11-07T00:43:40.476Z" },
{ url = "https://files.pythonhosted.org/packages/3e/73/7881eee5ac31132a713ab19a22c9e5f1f7365c8b1df50abba5d45b781312/wrapt-2.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3fa272ca34332581e00bf7773e993d4f632594eb2d1b0b162a9038df0fd971dd", size = 113837, upload-time = "2025-11-07T00:43:42.921Z" },
{ url = "https://files.pythonhosted.org/packages/45/00/9499a3d14e636d1f7089339f96c4409bbc7544d0889f12264efa25502ae8/wrapt-2.0.1-cp311-cp311-win32.whl", hash = "sha256:fc007fdf480c77301ab1afdbb6ab22a5deee8885f3b1ed7afcb7e5e84a0e27be", size = 58028, upload-time = "2025-11-07T00:43:47.369Z" },
{ url = "https://files.pythonhosted.org/packages/70/5d/8f3d7eea52f22638748f74b102e38fdf88cb57d08ddeb7827c476a20b01b/wrapt-2.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:47434236c396d04875180171ee1f3815ca1eada05e24a1ee99546320d54d1d1b", size = 60385, upload-time = "2025-11-07T00:43:44.34Z" },
{ url = "https://files.pythonhosted.org/packages/14/e2/32195e57a8209003587bbbad44d5922f13e0ced2a493bb46ca882c5b123d/wrapt-2.0.1-cp311-cp311-win_arm64.whl", hash = "sha256:837e31620e06b16030b1d126ed78e9383815cbac914693f54926d816d35d8edf", size = 58893, upload-time = "2025-11-07T00:43:46.161Z" },
{ url = "https://files.pythonhosted.org/packages/cb/73/8cb252858dc8254baa0ce58ce382858e3a1cf616acebc497cb13374c95c6/wrapt-2.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1fdbb34da15450f2b1d735a0e969c24bdb8d8924892380126e2a293d9902078c", size = 78129, upload-time = "2025-11-07T00:43:48.852Z" },
{ url = "https://files.pythonhosted.org/packages/19/42/44a0db2108526ee6e17a5ab72478061158f34b08b793df251d9fbb9a7eb4/wrapt-2.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3d32794fe940b7000f0519904e247f902f0149edbe6316c710a8562fb6738841", size = 61205, upload-time = "2025-11-07T00:43:50.402Z" },
{ url = "https://files.pythonhosted.org/packages/4d/8a/5b4b1e44b791c22046e90d9b175f9a7581a8cc7a0debbb930f81e6ae8e25/wrapt-2.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:386fb54d9cd903ee0012c09291336469eb7b244f7183d40dc3e86a16a4bace62", size = 61692, upload-time = "2025-11-07T00:43:51.678Z" },
+2 -2
View File
@@ -1563,7 +1563,7 @@
<link rel="modulepreload" href="/scripts/entry.fe229b42.js">
<link rel="modulepreload" href="/scripts/lazy.1ae52534.js">
<link rel="modulepreload" href="/scripts/main.22a5bd79.js">
<link rel="modulepreload" href="/scripts/modules/brk-client/index.b24ba2c8.js">
<link rel="modulepreload" href="/scripts/modules/brk-client/index.22379f83.js">
<link rel="modulepreload" href="/scripts/modules/brk-client/tests/basic.b92ff866.js">
<link rel="modulepreload" href="/scripts/modules/brk-client/tests/tree.ba9474f7.js">
<link rel="modulepreload" href="/scripts/modules/lean-qr/2.6.1/index.09195c13.mjs">
@@ -1634,7 +1634,7 @@
"/scripts/entry.js": "/scripts/entry.fe229b42.js",
"/scripts/lazy.js": "/scripts/lazy.1ae52534.js",
"/scripts/main.js": "/scripts/main.22a5bd79.js",
"/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.b24ba2c8.js",
"/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.22379f83.js",
"/scripts/modules/brk-client/tests/basic.js": "/scripts/modules/brk-client/tests/basic.b92ff866.js",
"/scripts/modules/brk-client/tests/tree.js": "/scripts/modules/brk-client/tests/tree.ba9474f7.js",
"/scripts/modules/lean-qr/2.6.1/index.mjs": "/scripts/modules/lean-qr/2.6.1/index.09195c13.mjs",