sec

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 8 Imported by: 0

README

sec-client

Documentation

Index

Constants

View Source
const AllCompanyFactsEndpoint string = Protocol + SecUrl + CompanyFactsZip
View Source
const CompanyFactsEndpoint string = Protocol + SecDataUrl + "/api/xbrl/companyfacts"
View Source
const CompanyFactsZip string = "/Archives/edgar/daily-index/xbrl/companyfacts.zip"
View Source
const FilingsUrlEndpoint string = Protocol + SecReportUrl + "/Senate-Stock-Disclosures/Filings"
View Source
const Protocol string = "https://"
View Source
const SECDateFormat = "2006-01-02"
View Source
const SecDataUrl string = "data.sec.gov"
View Source
const SecReportUrl string = "www.sec.report"
View Source
const SecUrl string = "www.sec.gov"
View Source
const TickerEndpoint string = Protocol + SecUrl + "/files/company_tickers.json"

Variables

This section is empty.

Functions

func CompleteUrl

func CompleteUrl(partial string) string

func StandardSecDateFormatParse

func StandardSecDateFormatParse(date string) (time.Time, error)

Types

type CompanyFacts

type CompanyFacts struct {
	CIK        uint64 `json:"cik"`
	EntityName string `json:"entityName"`
	Facts      Facts  `json:"facts"`
}

type Fact

type Fact struct {
	Label       string            `json:"label"`
	Description string            `json:"description"`
	Units       map[string][]Unit `json:"units"`
}

type Facts

type Facts struct {
	DEI    map[string]Fact `json:"dei"`
	UsGAAP map[string]Fact `json:"us-gaap"`
}

A representation of a

type PersistenceLayer added in v0.1.0

type PersistenceLayer interface {
	SaveFacts(Ticker, *CompanyFacts) error
	LoadFacts(Ticker) (*CompanyFacts, error)
}

type SecClient

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

func NewSecClient

func NewSecClient() *SecClient

func NewSecClientWithPersistence added in v0.1.0

func NewSecClientWithPersistence(persistenceLayer PersistenceLayer) *SecClient

func (*SecClient) GetAllFactsForTicker

func (client *SecClient) GetAllFactsForTicker(ticker Ticker) (CompanyFacts, error)

func (*SecClient) GetAllTickers

func (client *SecClient) GetAllTickers() ([]Ticker, error)

Fetches all current tickers from the sec.gov api

func (*SecClient) GetHttpGetRequestWithProperHeaders

func (client *SecClient) GetHttpGetRequestWithProperHeaders(endpoint string) (*http.Request, error)

func (*SecClient) GetTickerForCIK added in v0.2.0

func (client *SecClient) GetTickerForCIK(cik uint64) (Ticker, error)

func (*SecClient) GetTickerForSymbol

func (client *SecClient) GetTickerForSymbol(symbol string) (Ticker, error)

func (*SecClient) WaitForToken added in v0.2.0

func (client *SecClient) WaitForToken()

type Ticker

type Ticker struct {
	// Central Index Key (CIK) is used on the SEC's computer systems to identify corporations
	// and individual people who have filed disclosure with the SEC
	CIK uint64 `json:"cik_str"`

	// The symbol of the company for exampel NDAQ
	Symbol string `json:"ticker"`

	// The name of the company
	Name string `json:"title"`
}

Represents a ticker in the given SEC format

type Unit

type Unit struct {
	Value float64 `json:"val"`

	Start string `json:"start"`
	End   string `json:"end"`

	FiscalYear   uint16 `json:"fy"`
	FiscalPeriod string `json:"fp"`

	Account string `json:"accn"`

	Form    string `json:"form"`
	FiledOn string `json:"filed"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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