thai-market-data

Go package for Thai financial market data sources.
Packages
Installation
go get github.com/jwitmann/thai-market-data
Quick Start
AIMC
import "github.com/jwitmann/thai-market-data/aimc"
// Create client
client, err := aimc.NewClient(dataDir)
if err != nil {
log.Fatal(err)
}
// Auto-update if data is older than 90 days
if client.NeedsUpdate() {
go client.FetchAndUpdate() // Background update
}
// Lookup fund category
info := client.GetFundInfo("F000001")
fmt.Println(info.AIMCCategory) // "Equity Fund - Large Cap"
SET
import "github.com/jwitmann/thai-market-data/set"
// Create client
client, err := set.NewClient(dataDir)
if err != nil {
log.Fatal(err)
}
// Translate Thai company name to English
englishName := client.TranslateName("บริษัท ปตท. จำกัด (มหาชน)")
// Returns: "PTT PUBLIC COMPANY LIMITED"
// Get company by symbol
company, _ := client.GetBySymbol("PTT")
fmt.Println(company.NameEN)
Features
- Auto-updating: Both packages check for stale data and update automatically
- Quarterly updates (AIMC): Checks every 90 days
- Monthly updates (SET): Checks every 30 days
- HTTP retry: Exponential backoff for network resilience
- Zero external setup: Works out of the box with embedded data
Dependencies
github.com/thedatashed/xlsxreader - AIMC XLSX parsing
github.com/tupkung/tis620 - SET TIS-620 encoding conversion
Documentation
API Reference
See API.md for complete API documentation with all available methods.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add some amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Please ensure your code passes all tests:
go test ./...
License
MIT License - see LICENSE file for details