https://github.com/bengarrett/sauce
Package sauce is a Go module that parses SAUCE metadata.
https://github.com/bengarrett/sauce
ansi art ascii metadata msdos sauce text textart
Last synced: 4 months ago
JSON representation
Package sauce is a Go module that parses SAUCE metadata.
- Host: GitHub
- URL: https://github.com/bengarrett/sauce
- Owner: bengarrett
- License: mit
- Created: 2021-12-01T20:17:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-02-05T03:03:52.000Z (4 months ago)
- Last Synced: 2026-02-05T13:42:29.759Z (4 months ago)
- Topics: ansi, art, ascii, metadata, msdos, sauce, text, textart
- Language: Go
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/bengarrett/sauce) [](https://goreportcard.com/report/github.com/bengarrett/sauce)

# Package sauce
Package sauce is a [Go module](https://go.dev/) that parses SAUCE (Standard Architecture for Universal Comment Extensions) metadata.
## Features
- Parse SAUCE metadata from files
- Extract comprehensive file information (title, author, group, date, etc.)
- Support multiple file types and data types
- Extract type-specific information
- Parse comment blocks
- Serialize to JSON format
- Format dates and sizes for human readability
- Provide comprehensive error handling
> The Standard Architecture for Universal Comment Extensions, or SAUCE as it is
more commonly known, is an architecture or protocol for attaching metadata
or comments about files. Primarily designed for [ANSI art files](https://en.wikipedia.org/wiki/ANSI_art), SAUCE supports
many different file types.
For the complete specification see:
http://www.acid.org/info/sauce/sauce.htm
https://github.com/radman1/sauce
## Quick usage
[Go Package with docs and examples.](https://pkg.go.dev/github.com/bengarrett/sauce)
```go
// Open a file
file, err := os.Open("artwork.ans")
if err != nil {
log.Fatal(err)
}
defer file.Close()
// Read the file and create a SAUCE record
sr, err := sauce.Read(file)
if err != nil {
log.Println(err)
return
}
// print specific SAUCE fields
fmt.Printf("%q\n", sr.Title)
fmt.Printf("Author:\t%s.\n", sr.Author)
fmt.Printf("Group:\t%s.\n", sr.Group)
fmt.Printf("Date:\t%s.\n", sr.Date.Time.Format(time.ANSIC))
// print the SAUCE data as indented JSON
js, err := sr.JSONIndent(" ")
if err != nil {
log.Println(err)
return
}
fmt.Printf("%s", js)
```
## SAUCE as an API reference
- `id`
SAUCE identification. This should be equal to `SAUCE`.
- `version`
SAUCE version number, should be `00`.
- `title`
Title of the file.
- `author`
The nick, name or handle of the creator of the file.
- `group`
The name of the group or company the creator is employed by.
- `date` - The date the file was created.
- - `value` - SAUCE date format, CCYYMMDD (century, year, month, day).
- - `iso` - `value` as an ISO 8601 date.
- - `epoch`- `value` as Unix time, the number of seconds since 1 Jan 1970.
- `fileSize`
- - `bytes` - The reported file size not including the SAUCE information.
- - `decimal` - `bytes` returned as a base 10 value (kilo, mega...).
- - `binary` - `bytes` returned as a base 2 value (kibi, mebi...).
- `dataType` - Type of data.
- - `type` - `DataType` value.
- - `name` - `DataType` name.
- `fileType` - Type of file.
- - `type` - `FileType` value.
- - `name` - `FileType` name.
- `typeInfo` - Type-dependent information, see http://www.acid.org/info/sauce/sauce.htm#FileType
- `1`
- `value` - Value of `TInfo1`
- `info` - Human-readable description of the value
- `2`
- `value` - Value of `TInfo2`
- `info` - Human-readable description of the value
- `3`
- `value` - Value of `TInfo3`
- `info` - Human-readable description of the value
- `flags` - Type-dependent flags
- `decimal` - Value as an unsigned integer
- `binary` - Value in binary notation
- `nonBlinkMode` - Request ANSI non-blink mode (iCE Color)
- `flag` - Value as binary bit boolean ("0" or "1")
- `interpretation` - Human-readable description of the value
- `letterSpacing` - ANSI letter-spacing to request 8 or 9 pixel font selection
- `flag` - Value as a 2-bit binary string ("00", "01", "10")
- `interpretation` - Human-readable description of the value
- `aspectRatio` - ANSI aspect ratio to request LCD square or CRT monitor style pixels
- `flag` - Value as a 2-bit binary string ("00", "01", "10")
- `interpretation` - Human-readable description of the value
- `fontName` - The creator's preferred font to view the ANSI artwork, see http://www.acid.org/info/sauce/sauce.htm#FontName
- `comments` - Comments or notes from the creator
- `id` - SAUCE comment block identification, this should be "COMNT"
- `count` - The reported number of lines in the SAUCE comment block
- `lines` - Lines of text, each line should comprise 64 characters
---
### Similar projects and languages
- Go, [textmodes sauce](https://github.com/textmodes/sauce)
- Python, [Parser for SAUCE](https://pypi.org/project/sauce/)
- Elixir, [Saucexages](https://hexdocs.pm/saucexages/overview.html)