No description
- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Build and create release / release (push) Successful in 40s
Reviewed-on: #1 |
||
| .forgejo/workflows | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| go.mod | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
mtg-oracle-tool
A simple Go application that converts card data from Scryfall into Markdown files ready for Retrieval Augmented Generation (RAG).
Usage
mtg-oracle-tool requires the compressed oracle cards and rulings files from Scryfall. These can be downloaded by using the Scryfall bulk data API.
# Fetch oracle cards
ORACLE_CARDS_DOWNLOAD_URL="$(curl --fail -s https://api.scryfall.com/bulk-data/oracle-cards | jq -r '.jsonl_download_uri')"
curl --fail -o oracle-cards.jsonl.gz "${ORACLE_CARDS_DOWNLOAD_URL}"
# Fetch rulings
RULINGS_DOWNLOAD_URL="$(curl --fail -s https://api.scryfall.com/bulk-data/rulings | jq -r '.jsonl_download_uri')"
curl --fail -o rulings.jsonl.gz "${RULINGS_DOWNLOAD_URL}"
Pass the downloaded files to the application along with an output directory. If the directory doesn't exist, it will be created.
go run . -rulings rulings.jsonl.gz -oracle-cards oracle-cards.jsonl.gz -o ./output
License
Apache 2.0