aimc

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 10 Imported by: 0

README

AIMC Fund Categories

What is AIMC?

AIMC = Association of Investment Management Companies (Thailand) — the self-regulatory organization for Thai asset management companies.

AIMC classifies Thai mutual funds into standardized categories based on:

  • Asset class (Equity, Fixed Income, Mixed, Money Market, etc.)
  • Investment style/strategy
  • Geographic focus

Categories

Example categories:

  • Equity Fund - Large Cap
  • Equity Fund -中小盘 (China A-Shares)
  • Equity Fund -中小型股 (Small Cap)
  • Fixed Income Fund
  • Mixed Fund
  • Money Market Fund

Use Cases

This package provides AIMC data for applications working with Thai mutual funds:

  1. English fund names - Complement Finnomena API (which returns Thai names) with English translations
  2. Thai fund names - Access both Thai and English versions of fund names
  3. Asset manager names - Get firm names in English
  4. Fund categories - Standardized classification (e.g., "Equity Fund - Large Cap")
  5. Category search - Browse funds by AIMC category

Data Source

The mappings are generated from:

Data is automatically downloaded and updated via FetchAndUpdate().

File Location

  • Generated mappings: ${DATA_DIR}/aimc_mappings.json
  • Source CSV: data/aimc_data.csv (in repository)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchAndSaveNew

func FetchAndSaveNew(dataDir string) error

FetchAndSaveNew fetches AIMC data and saves to the given data directory This is a standalone function to handle the case where no existing data exists

Types

type AIMCMappings

type AIMCMappings struct {
	Categories map[string]string   `json:"categories"`
	Funds      map[string]FundInfo `json:"funds"`
}

AIMCMappings stores AIMC category and fund information (legacy structure for compatibility)

type AIMCMetadata

type AIMCMetadata struct {
	LastUpdate  string `json:"last_update"`
	SourceURL   string `json:"source_url,omitempty"`
	Quarter     string `json:"quarter,omitempty"`
	RecordCount int    `json:"record_count"`
}

AIMCMetadata contains metadata about the AIMC data source

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides AIMC (Association of Investment Management Companies) data lookup

func NewClient

func NewClient(dataDir string) (*Client, error)

NewClient creates a new AIMC client with the given data directory

func (*Client) FetchAndUpdate

func (c *Client) FetchAndUpdate() error

FetchAndUpdate downloads latest AIMC data and updates the mappings Returns error on failure but existing data remains usable

func (*Client) GetAllFunds

func (c *Client) GetAllFunds() []string

GetAllFunds returns all fund codes

func (*Client) GetCategories

func (c *Client) GetCategories() []string

GetCategories returns all available category names

func (*Client) GetCategoryName

func (c *Client) GetCategoryName(categoryID string) string

GetCategoryName returns the category name for a given category ID

func (*Client) GetFundInfo

func (c *Client) GetFundInfo(fundCode string) (legalName, thaiName, firmName, category string)

GetFundInfo returns legal name, thai name, firm name, and category for a fund code

func (*Client) GetFundsByCategory

func (c *Client) GetFundsByCategory(categoryName string) []string

GetFundsByCategory returns all fund codes in a given category

func (*Client) GetFundsByCompany

func (c *Client) GetFundsByCompany(companyName string) []string

GetFundsByCompany returns all fund codes for a given company/firm

func (*Client) GetFundsByCompanyFuzzy

func (c *Client) GetFundsByCompanyFuzzy(partialName string) []string

GetFundsByCompanyFuzzy returns fund codes for partial company name matches

func (*Client) GetMappings

func (c *Client) GetMappings() *Mappings

GetMappings returns the raw mappings (for advanced use)

func (*Client) NeedsUpdate

func (c *Client) NeedsUpdate() bool

NeedsUpdate checks if AIMC data needs to be updated based on last update timestamp Returns true if data is older than 90 days (quarterly) or has never been updated

type FundInfo

type FundInfo struct {
	LegalName      string `json:"legal_name"`
	ThaiName       string `json:"thai_name"`
	FirmName       string `json:"firm_name"`
	AIMCCategoryID string `json:"aimc_category_id,omitempty"`
	AIMCCategory   string `json:"-"` // Temporary field for parsing, not serialized
}

FundInfo represents AIMC data for a single fund

type Mappings

type Mappings struct {
	Categories map[string]string   `json:"categories"`
	Funds      map[string]FundInfo `json:"funds"`
}

Mappings stores AIMC category and fund information

type MappingsWithMetadata

type MappingsWithMetadata struct {
	AIMCMappings
	Metadata AIMCMetadata `json:"metadata"`
}

MappingsWithMetadata stores AIMC data with metadata

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL