Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ftl/cabrillo
A Go library to handle the Cabrillo file format
https://github.com/ftl/cabrillo
amateur-radio amateurradio cabrillo contest ham-radio hamradio hf-contest-log
Last synced: 1 day ago
JSON representation
A Go library to handle the Cabrillo file format
- Host: GitHub
- URL: https://github.com/ftl/cabrillo
- Owner: ftl
- License: mit
- Created: 2022-11-20T15:22:59.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-26T09:50:25.000Z (over 1 year ago)
- Last Synced: 2024-06-19T01:51:48.392Z (5 months ago)
- Topics: amateur-radio, amateurradio, cabrillo, contest, ham-radio, hamradio, hf-contest-log
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ftl/cabrillo
This little Go library to handle the [Cabrillo](https://wwrof.org/cabrillo/) file format for amateur radio contest log files.
## Use as a Go Library
To include `cabrillo` into your own projects as a library:
```shell
go get github.com/ftl/cabrillo
```
### Read a Cabrillo log file```go
f, err := os.Open("mycabrillo.log")
if err != nil {
panic(err)
}
log, err := cabrillo.Read(f)
if err != nil {
panic(err)
}
```### Write a Cabrillo log file
```go
log := cabrillo.NewLog()
log.Contest = "CQ-WW-CW"
log.Callsign = callsign.MustParse("DL0ABC")
log.Operators = []callsign.Callsign{callsign.MustParse("DL1ABC")}
log.Host = callsign.MustParse("DL1ABC")
log.Location = "DX"
log.Category.Operator = cabrillo.SingleOperator
log.Category.Assisted = cabrillo.Assisted
log.Category.Band = cabrillo.BandAll
log.Category.Power = cabrillo.HighPower
log.Category.Mode = cabrillo.ModeCW
log.Category.Transmitter = cabrillo.OneTransmitter
log.ClaimedScore = 12345
log.Club = "Bavarian Contest Club"
log.Name = "Hans Hamster"
log.Email = "[email protected]"
log.Address.Text = "Beispielstraße 1"
log.Address.City = "Musterstadt"
log.Address.Postalcode = "12345"
log.Address.StateProvince = "Bavaria"
log.Address.Country = "Germany"
log.CreatedBy = "Golang Cabrillo Example"
log.Soapbox = "this is just an example that shows how to write Cabrillo logs in Golang"// qsos is where you keep your QSO data in your internal representation
qsoData := make([]QSO, 0, len(qsos))
for _, qso := range qsos {
// convertQSOToCabrillo converts your internal represenation to cabrillo.QSO
qsoData = append(qsoData, convertQSOToCabrillo(qso))
}
log.QSOData = qsoDataf, err := os.Create("mycabrillo.log")
if err != nil {
panic(err)
}
err = cabrillo.Write(f, log, false)
if err != nil {
panic(err)
}
```## License
This software is published under the [MIT License](https://www.tldrlegal.com/l/mit).Copyright [Florian Thienel](http://thecodingflow.com/)