feat: establish standalone Argand Site Registry
This commit is contained in:
commit
2a0fe1714b
60 changed files with 10494 additions and 0 deletions
27
examples/lookup.py
Normal file
27
examples/lookup.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Use the native registry from Python, preserving its attribution and provenance."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
|
||||
def lookup(binary, generation, pin, query):
|
||||
"""The native reader authenticates the generation using the caller's trusted pin."""
|
||||
result = subprocess.run(
|
||||
[binary, "lookup", "--generation", generation, "--pin", pin,
|
||||
"--query", query, "--limit", "100"],
|
||||
check=True, capture_output=True, text=True, timeout=60,
|
||||
)
|
||||
return json.loads(result.stdout)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--binary", default="argand-site-registry")
|
||||
parser.add_argument("--generation", required=True)
|
||||
parser.add_argument("--pin", required=True)
|
||||
parser.add_argument("--query", required=True)
|
||||
args = parser.parse_args()
|
||||
print(json.dumps(lookup(args.binary, args.generation, args.pin, args.query),
|
||||
ensure_ascii=False, sort_keys=True))
|
||||
Loading…
Add table
Add a link
Reference in a new issue