Go package for Thai financial market data sources.
-
aimc - Association of Investment Management Companies fund categories
- Auto-updating fund category mappings from AIMC website
- XLSX parsing for quarterly data updates
-
set - Stock Exchange of Thailand company translations
- Thai-to-English company name translation
- Auto-updating from SET.or.th (HTML table parsing)
- TIS-620 to UTF-8 encoding conversion
go get github.com/jwitmann/thai-market-dataimport "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"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)- 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
github.com/thedatashed/xlsxreader- AIMC XLSX parsinggithub.com/tupkung/tis620- SET TIS-620 encoding conversion
See API.md for complete API documentation with all available methods.
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 ./...MIT License - see LICENSE file for details