Documentation ¶
Index ¶
- Constants
- func CodeAccounts(db *sql.DB) (err error)
- func CreateIndexes(db *sql.DB, group int) (err error)
- func DropIndexes(db *sql.DB) (err error)
- func FromSector(company, yamlFile string) (companies []string, sectorName string, err error)
- func FuzzyFind(source string, targets []string, maxDistance int) (found string)
- func FuzzyMatch(src string, list []string, distance int) bool
- func GetHash(s string) uint32
- func ImportCsv(db *sql.DB, dataType string, file string) (err error)
- func RemoveDiacritics(original string) (result string)
- func SectorsToYaml(yamlFile string) (err error)
- type S
- type Sector
- type Segment
- type Subsector
Constants ¶
const ( UNDEF uint32 = iota SPACE // Balance Sheet Caixa AplicFinanceiras Estoque Equity DividaCirc DividaNCirc // Income Statement Vendas CustoVendas DespesasOp EBIT LucLiq // DFC FCO FCI FCF // Value Added Statement Deprec JurosCapProp Dividendos )
Bookkeeping account codes If you add new const values, run 'go generate' to update the generated code
Variables ¶
This section is empty.
Functions ¶
func CodeAccounts ¶
CodeAccounts code all the accounts with the bookkeeping accounts constants An account is a line in the financial statement (e.g., equity, cash, EBITDA, etc.) How to check entries: cat b??_cia_aberta_con_201* | iconv -f WINDOWS-1252 -t UTF-8 | awk -F ';' '{print $11 " "$12}' | sort | uniq -c | grep -Ei "Caixa" cat d??_cia_aberta_con_201* | iconv -f WINDOWS-1252 -t UTF-8 | awk -F ';' '{print $12 " "$13}' | sort | uniq -c | grep -Ei " 3\.01 "
func CreateIndexes ¶
CreateIndexes to optimize queries group 1: used for parsers.CodeAccounts group 2: used for reports group 3: all
func FromSector ¶ added in v0.8.1
FromSector returns all companies from the same sector as the 'company'
func FuzzyFind ¶ added in v0.8.1
FuzzyFind returns the most approximate string inside 'list' that matches the 'src' string within a maximum 'distance'.
func FuzzyMatch ¶ added in v0.8.1
FuzzyMatch measures the Levenshtein distance between the source and the list, returning true if the distance is less or equal the 'distance'. Diacritics are removed from 'src' and 'list'.
func ImportCsv ¶ added in v0.9.0
ImportCsv start the data import process, including the database creation if necessary
func RemoveDiacritics ¶ added in v0.8.1
RemoveDiacritics transforms, for example, "žůžo" into "zuzo"
func SectorsToYaml ¶ added in v0.8.1
SectorsToYaml grab data from B3 website and prints out to a yaml file with all companies grouped by sector, subsector, segment