eodhdapi

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 13 Imported by: 0

README

eodhdapi

eod hd golang api

Documentation

Index

Constants

View Source
const DefaultURL = "https://eodhistoricaldata.com/api"

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceSheet added in v0.3.0

type BalanceSheet struct {
	CurrencySymbol string           `json:"currency_symbol"`
	QuarterlyLast0 BalanceSheetInfo `json:"quarterly_last_0"`
	QuarterlyLast1 BalanceSheetInfo `json:"quarterly_last_1"`
	QuarterlyLast2 BalanceSheetInfo `json:"quarterly_last_2"`
	QuarterlyLast3 BalanceSheetInfo `json:"quarterly_last_3"`
	YearlyLast0    BalanceSheetInfo `json:"yearly_last_0"`
	YearlyLast1    BalanceSheetInfo `json:"yearly_last_1"`
	YearlyLast2    BalanceSheetInfo `json:"yearly_last_2"`
	YearlyLast3    BalanceSheetInfo `json:"yearly_last_3"`
}

type BalanceSheetInfo added in v0.3.0

type BalanceSheetInfo struct {
	Date                    string   `json:"date"`
	FilingDate              *string  `json:"filing_date"`
	IntangibleAssets        *float64 `json:"intangibleAssets"`
	TotalLiab               string   `json:"totalLiab"`
	TotalStockholderEquity  string   `json:"totalStockholderEquity"`
	DeferredLongTermLiab    *string  `json:"deferredLongTermLiab"`
	OtherCurrentLiab        string   `json:"otherCurrentLiab"`
	TotalAssets             string   `json:"totalAssets"`
	CommonStock             string   `json:"commonStock"`
	OtherCurrentAssets      string   `json:"otherCurrentAssets"`
	RetainedEarnings        string   `json:"retainedEarnings"`
	OtherLiab               string   `json:"otherLiab"`
	GoodWill                string   `json:"goodWill"`
	OtherAssets             string   `json:"otherAssets"`
	Cash                    string   `json:"cash"`
	TotalCurrentLiabilities string   `json:"totalCurrentLiabilities"`
	ShortLongTermDebt       *string  `json:"shortLongTermDebt"`
	OtherStockholderEquity  string   `json:"otherStockholderEquity"`
	PropertyPlantEquipment  string   `json:"propertyPlantEquipment"`
	TotalCurrentAssets      string   `json:"totalCurrentAssets"`
	LongTermInvestments     string   `json:"longTermInvestments"`
	NetTangibleAssets       string   `json:"netTangibleAssets"`
	ShortTermInvestments    *string  `json:"shortTermInvestments"`
	NetReceivables          string   `json:"netReceivables"`
	LongTermDebt            *string  `json:"longTermDebt"`
	Inventory               string   `json:"inventory"`
	AccountsPayable         *string  `json:"accountsPayable"`
}

type CashFlow added in v0.3.0

type CashFlow struct {
	CurrencySymbol string       `json:"currency_symbol"`
	QuarterlyLast0 CashFlowInfo `json:"quarterly_last_0"`
	QuarterlyLast1 CashFlowInfo `json:"quarterly_last_1"`
	QuarterlyLast2 CashFlowInfo `json:"quarterly_last_2"`
	QuarterlyLast3 CashFlowInfo `json:"quarterly_last_3"`
	YearlyLast0    CashFlowInfo `json:"yearly_last_0"`
	YearlyLast1    CashFlowInfo `json:"yearly_last_1"`
	YearlyLast2    CashFlowInfo `json:"yearly_last_2"`
	YearlyLast3    CashFlowInfo `json:"yearly_last_3"`
}

type CashFlowInfo added in v0.3.0

type CashFlowInfo struct {
	Date                                  string  `json:"date"`
	FilingDate                            *string `json:"filing_date"`
	Investments                           string  `json:"investments"`
	ChangeToLiabilities                   string  `json:"changeToLiabilities"`
	TotalCashflowsFromInvestingActivities string  `json:"totalCashflowsFromInvestingActivities"`
	NetBorrowings                         string  `json:"netBorrowings"`
	TotalCashFromFinancingActivities      string  `json:"totalCashFromFinancingActivities"`
	ChangeToOperatingActivities           string  `json:"changeToOperatingActivities"`
	NetIncome                             string  `json:"netIncome"`
	ChangeInCash                          string  `json:"changeInCash"`
	TotalCashFromOperatingActivities      string  `json:"totalCashFromOperatingActivities"`
	Depreciation                          string  `json:"depreciation"`
	OtherCashflowsFromInvestingActivities string  `json:"otherCashflowsFromInvestingActivities"`
	DividendsPaid                         string  `json:"dividendsPaid"`
	ChangeToInventory                     string  `json:"changeToInventory"`
	ChangeToAccountReceivables            string  `json:"changeToAccountReceivables"`
	SalePurchaseOfStock                   *string `json:"salePurchaseOfStock"`
	OtherCashflowsFromFinancingActivities *string `json:"otherCashflowsFromFinancingActivities"`
	ChangeToNetincome                     string  `json:"changeToNetincome"`
	CapitalExpenditures                   string  `json:"capitalExpenditures"`
}

type EODInfo

type EODInfo struct {
	Code              string    `json:"code,omitempty" bson:"code"`
	ExchangeShortName string    `json:"exchange_short_name,omitempty" bson:"exchange_short_name"`
	Date              time.Time `json:"date,omitempty" bson:"date"`
	Open              float64   `json:"open,omitempty" bson:"open"`
	High              float64   `json:"hig,omitemptyh" bson:"high"`
	Low               float64   `json:"low,omitempty" bson:"low"`
	Close             float64   `json:"close,omitempty" bson:"close"`
	AdjustedClose     float64   `json:"adjusted_close,omitempty" bson:"adjusted_close"`
	Volume            float64   `json:"volume,omitempty" bson:"volume"`
	Ticker            string    `json:"tickers,omitempty" bson:"ticker"`
}

EODInfo is the price information for a single Asset

type EODMapping

type EODMapping struct {
	Code     string `json:"code" bson:"code"`
	Exchange string `json:"exchange" bson:"exchange"`
	Country  string `json:"country" bson:"country"`
	Isin     string `json:"isin" bson:"isin"`
	Name     string `json:"name" bson:"name"`

	Ticker string `json:"ticker" bson:"ticker"`
}

The EODMapping does map a ticker to an isin

type EODTicker

type EODTicker struct {
	Code     string `json:"code" bson:"code"`
	Name     string `json:"name" bson:"name"`
	Country  string `json:"country" bson:"country"`
	Exchange string `json:"exchange" bson:"exchange"`
	Currency string `json:"currency" bson:"currency"`
	Type     string `json:"type" bson:"type"`

	Ticker            string   `json:"ticker" bson:"ticker"`
	ExchangeShortName string   `json:"exchange_short_name" bson:"exchange_short_name"`
	OpenfigiTickers   []string `json:"openfigi_tickers" bson:"openfigi_tickers"`
}

EODTicker Ticker Info

type EODhd

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

EODhd is an EOD Historical Data Client Info

func NewDefaultEOD added in v0.3.0

func NewDefaultEOD(eodHdToken string) *EODhd

NewEOD initializes a new eod historical data client

func NewEOD

func NewEOD(eodHdURL, eodHdToken string, transport http.RoundTripper) *EODhd

NewEOD initializes a new eod historical data client

func (*EODhd) FetchEOD

func (d *EODhd) FetchEOD(ctx context.Context, info chan EODInfo, exchange *exchanges.Exchange, date time.Time) error

FetchEOD Fetches End of day for the exchange

func (*EODhd) FetchEODForTicker

func (d *EODhd) FetchEODForTicker(ctx context.Context, info chan EODInfo, code, exchange string) error

FetchEODForTicker Fetches End of day for a single ticker

func (*EODhd) FetchFundamentals

func (d *EODhd) FetchFundamentals(ctx context.Context, fundamentals chan Fundamentals, exchange *exchanges.Exchange, pagesize int, lenient bool) error

FetchFundamentals Fetches Fundamentals for the exchange

func (*EODhd) FetchTickers

func (d *EODhd) FetchTickers(ctx context.Context, info chan EODTicker, exchange *exchanges.Exchange) error

FetchTickers Fetches End of day for the exchange

func (*EODhd) LoadEtfs

func (d *EODhd) LoadEtfs(info chan EODMapping) error

LoadEtfs Loads the ETFS into a EODMappings

type Earnings added in v0.3.0

type Earnings struct {
	Last0 EarningsInfo `json:"Last_0"`
	Last1 EarningsInfo `json:"Last_1"`
	Last2 EarningsInfo `json:"Last_2"`
	Last3 EarningsInfo `json:"Last_3"`
}

type EarningsInfo added in v0.3.0

type EarningsInfo struct {
	Date            string   `json:"date"`
	EpsActual       *float64 `json:"epsActual"`
	EpsEstimate     *float64 `json:"epsEstimate"`
	EpsDifference   *float64 `json:"epsDifference"`
	SurprisePercent *float64 `json:"surprisePercent"`
}

type Financials added in v0.3.0

type Financials struct {
	BalanceSheet    BalanceSheet    `json:"Balance_Sheet"`
	CashFlow        CashFlow        `json:"Cash_Flow"`
	IncomeStatement IncomeStatement `json:"Income_Statement"`
}

type Fundamentals

type Fundamentals struct {
	LastUpdate      time.Time
	Ticker          string
	General         General         `json:"General"`
	Highlights      Highlights      `json:"Highlights"`
	Valuation       Valuation       `json:"Valuation"`
	Technicals      Technicals      `json:"Technicals"`
	SplitsDividends SplitsDividends `json:"SplitsDividends"`
	Earnings        Earnings        `json:"Earnings"`
	Financials      Financials      `json:"Financials"`
}

Fundamentals for a ticker

type General

type General struct {
	Code              string  `json:"Code"`
	Type              string  `json:"Type"`
	Name              string  `json:"Name"`
	Exchange          string  `json:"Exchange"`
	CurrencyCode      string  `json:"CurrencyCode"`
	CurrencyName      string  `json:"CurrencyName"`
	CurrencySymbol    string  `json:"CurrencySymbol"`
	CountryName       string  `json:"CountryName"`
	CountryISO        string  `json:"CountryISO"`
	ISIN              *string `json:"ISIN"`
	Sector            string  `json:"Sector"`
	Industry          string  `json:"Industry"`
	Description       string  `json:"Description"`
	FullTimeEmployees *int    `json:"FullTimeEmployees"`
	UpdatedAt         *string `json:"UpdatedAt"`
	Cusip             *string `json:"CUSIP"`
}

type Highlights added in v0.3.0

type Highlights struct {
	MarketCapitalization       *float64 `json:"MarketCapitalization"`
	MarketCapitalizationMln    string   `json:"MarketCapitalizationMln"`
	EBITDA                     *float64 `json:"EBITDA"`
	PERatio                    string   `json:"PERatio"`
	PEGRatio                   *float64 `json:"PEGRatio"`
	WallStreetTargetPrice      *float64 `json:"WallStreetTargetPrice"`
	BookValue                  string   `json:"BookValue"`
	DividendShare              string   `json:"DividendShare"`
	DividendYield              string   `json:"DividendYield"`
	EarningsShare              string   `json:"EarningsShare"`
	EPSEstimateCurrentYear     *float64 `json:"EPSEstimateCurrentYear"`
	EPSEstimateNextYear        *float64 `json:"EPSEstimateNextYear"`
	EPSEstimateNextQuarter     *float64 `json:"EPSEstimateNextQuarter"`
	MostRecentQuarter          string   `json:"MostRecentQuarter"`
	ProfitMargin               string   `json:"ProfitMargin"`
	OperatingMarginTTM         string   `json:"OperatingMarginTTM"`
	ReturnOnAssetsTTM          string   `json:"ReturnOnAssetsTTM"`
	ReturnOnEquityTTM          string   `json:"ReturnOnEquityTTM"`
	RevenueTTM                 *string  `json:"RevenueTTM"`
	RevenuePerShareTTM         *string  `json:"RevenuePerShareTTM"`
	QuarterlyRevenueGrowthYOY  string   `json:"QuarterlyRevenueGrowthYOY"`
	GrossProfitTTM             string   `json:"GrossProfitTTM"`
	DilutedEpsTTM              string   `json:"DilutedEpsTTM"`
	QuarterlyEarningsGrowthYOY string   `json:"QuarterlyEarningsGrowthYOY"`
}

type IncomeStatement added in v0.3.0

type IncomeStatement struct {
	CurrencySymbol string              `json:"currency_symbol"`
	QuarterlyLast0 IncomeStatementInfo `json:"quarterly_last_0"`
	QuarterlyLast1 IncomeStatementInfo `json:"quarterly_last_1"`
	QuarterlyLast2 IncomeStatementInfo `json:"quarterly_last_2"`
	QuarterlyLast3 IncomeStatementInfo `json:"quarterly_last_3"`
	YearlyLast0    IncomeStatementInfo `json:"yearly_last_0"`
	YearlyLast1    IncomeStatementInfo `json:"yearly_last_1"`
	YearlyLast2    IncomeStatementInfo `json:"yearly_last_2"`
	YearlyLast3    IncomeStatementInfo `json:"yearly_last_3"`
}

type IncomeStatementInfo added in v0.3.0

type IncomeStatementInfo struct {
	Date                              string      `json:"date"`
	FilingDate                        interface{} `json:"filing_date"`
	ResearchDevelopment               interface{} `json:"researchDevelopment"`
	EffectOfAccountingCharges         interface{} `json:"effectOfAccountingCharges"`
	IncomeBeforeTax                   string      `json:"incomeBeforeTax"`
	MinorityInterest                  string      `json:"minorityInterest"`
	NetIncome                         string      `json:"netIncome"`
	SellingGeneralAdministrative      string      `json:"sellingGeneralAdministrative"`
	GrossProfit                       string      `json:"grossProfit"`
	Ebit                              string      `json:"ebit"`
	OperatingIncome                   string      `json:"operatingIncome"`
	OtherOperatingExpenses            *string     `json:"otherOperatingExpenses"`
	InterestExpense                   *string     `json:"interestExpense"`
	ExtraordinaryItems                *string     `json:"extraordinaryItems"`
	NonRecurring                      *string     `json:"nonRecurring"`
	OtherItems                        *string     `json:"otherItems"`
	IncomeTaxExpense                  string      `json:"incomeTaxExpense"`
	TotalRevenue                      string      `json:"totalRevenue"`
	TotalOperatingExpenses            string      `json:"totalOperatingExpenses"`
	CostOfRevenue                     string      `json:"costOfRevenue"`
	TotalOtherIncomeExpenseNet        string      `json:"totalOtherIncomeExpenseNet"`
	DiscontinuedOperations            *string     `json:"discontinuedOperations"`
	NetIncomeFromContinuingOps        string      `json:"netIncomeFromContinuingOps"`
	NetIncomeApplicableToCommonShares string      `json:"netIncomeApplicableToCommonShares"`
}

type SplitsDividends added in v0.3.0

type SplitsDividends struct {
	ForwardAnnualDividendRate  string `json:"ForwardAnnualDividendRate"`
	ForwardAnnualDividendYield string `json:"ForwardAnnualDividendYield"`
	PayoutRatio                string `json:"PayoutRatio"`
	DividendDate               string `json:"DividendDate"`
	ExDividendDate             string `json:"ExDividendDate"`
	LastSplitFactor            string `json:"LastSplitFactor"`
	LastSplitDate              string `json:"LastSplitDate"`
}

type Technicals added in v0.3.0

type Technicals struct {
	Beta                  string   `json:"Beta"`
	FiftyTwoWeekHigh      string   `json:"52WeekHigh"`
	FiftyTwoWeekLow       string   `json:"52WeekLow"`
	FiftyDayMA            string   `json:"50DayMA"`
	TwoHundredDayMA       string   `json:"200DayMA"`
	SharesShort           *float64 `json:"SharesShort"`
	SharesShortPriorMonth *float64 `json:"SharesShortPriorMonth"`
	ShortRatio            *float64 `json:"ShortRatio"`
	ShortPercent          *float64 `json:"ShortPercent"`
}

type Valuation added in v0.3.0

type Valuation struct {
	TrailingPE             string  `json:"TrailingPE"`
	ForwardPE              *string `json:"ForwardPE"`
	PriceSalesTTM          *string `json:"PriceSalesTTM"`
	PriceBookMRQ           string  `json:"PriceBookMRQ"`
	EnterpriseValueRevenue *string `json:"EnterpriseValueRevenue"`
	EnterpriseValueEbitda  *string `json:"EnterpriseValueEbitda"`
}

Directories

Path Synopsis
afr
diskcache
Package diskcache provides an implementation of httpcache.Cache that uses the diskv package to supplement an in-memory map with persistent storage
Package diskcache provides an implementation of httpcache.Cache that uses the diskv package to supplement an in-memory map with persistent storage

Jump to

Keyboard shortcuts

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