Skip to content

Instantly share code, notes, and snippets.

@ottosch
ottosch / otto-parser.py
Last active February 4, 2023 19:30
Simple Ordinals Inscriptions Parser (for context: ordinals.com)
#! /usr/bin/env python
import sys, os, base64, argparse
def get_cli_args():
ap = argparse.ArgumentParser(description="Parse and output the ordinal inscription inside transaction")
if sys.stdin.isatty():
ap.add_argument("tx_file", help="input raw transaction file")
ap.add_argument("-du", "--data-uri", action="store_true", help="print inscription as data-uri instead of writing to a file")