common

package
v0.0.0-...-c18efd6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonStock string = "Common Stock"
	ETF         string = "Exchange Traded Fund"
	ETN         string = "Exchange Traded Note"
	Fund        string = "Closed-End Fund"
	MutualFund  string = "Mutual Fund"
	ADRC        string = "American Depository Receipt Common"
)

Variables

View Source
var CurrentVersion = Version{
	Major:  0,
	Minor:  3,
	Patch:  0,
	Suffix: "dev",
}

CurrentVersion represents the current build version. This is the only one in the system

Functions

func BuildUserAgent

func BuildUserAgent(browser *playwright.Browser) string

func BuildVersionString

func BuildVersionString() string

BuildVersionString creates a version string. This is what you see when running "import-fred version".

func DecryptAES

func DecryptAES(ct string) string

func EncryptAES

func EncryptAES(plaintext string) string

func GetDependencyList

func GetDependencyList() []string

GetDependencyList returns a sorted dependency list on the format package="version".

func Password

func Password() string

func SaveToParquet

func SaveToParquet(records []*Asset, fn string) error

func StealthPage

func StealthPage(context *playwright.BrowserContext) playwright.Page

StealthPage creates a new playwright page with stealth js loaded to prevent bot detection

func TrimWhiteSpace

func TrimWhiteSpace(assets []*Asset)

func Username

func Username() string

Types

type Asset

type Asset struct {
	Ticker               string   `json:"ticker" parquet:"name=ticker, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	Name                 string   `json:"Name" parquet:"name=name, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	Description          string   `json:"description" parquet:"name=description, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	PrimaryExchange      string   `json:"primary_exchange" parquet:"name=primary_exchange, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	AssetType            string   `json:"asset_type" parquet:"name=asset_type, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	CompositeFigi        string   `json:"composite_figi" parquet:"name=composite_figi, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	ShareClassFigi       string   `json:"share_class_figi" parquet:"name=share_class_figi, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	CUSIP                string   `json:"cusip" parquet:"name=cusip, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	ISIN                 string   `json:"isin" parquet:"name=isin, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	CIK                  string   `json:"cik" parquet:"name=cik, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	ListingDate          string   `json:"listing_date" parquet:"name=listing_date, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	DelistingDate        string   `json:"delisting_date" parquet:"name=delisting_date, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	Industry             string   `json:"industry" parquet:"name=industry, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	Sector               string   `json:"sector" parquet:"name=sector, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	Icon                 []byte   `json:"icon"`
	IconURL              string   `json:"icon_url" parquet:"name=icon_url, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	CorporateURL         string   `json:"corporate_url" parquet:"name=corporate_url, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
	HeadquartersLocation string   `` /* 129-byte string literal not displayed */
	SimilarTickers       []string `` /* 130-byte string literal not displayed */
	PolygonDetailAge     int64    `json:"polygon_detail_age" parquet:"name=polygon_detail_age, type=INT64"`
	FidelityCusip        bool     `parquet:"name=fidelity_cusip, type=BOOLEAN"`
	LastUpdated          int64    `json:"last_updated" parquet:"name=last_update, type=INT64"`
	Source               string   `json:"source" parquet:"name=source, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
}

func ReadFromParquet

func ReadFromParquet(fn string) []*Asset

func (*Asset) MarshalZerologObject

func (asset *Asset) MarshalZerologObject(e *zerolog.Event)

type Version

type Version struct {
	// Increment this for backwards incompatible changes
	Major int

	// Increment this for feature releases
	Minor int

	// Increment this for bug releases
	Patch int

	// VersionSuffix is the suffix used in the PV API version string.
	// It will be blank for release versions.
	Suffix string
}

Version represents a SemVer 2.0.0 compatible build version

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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