{"id":21542884,"url":"https://github.com/horacehylee/aastocks","last_synced_at":"2025-03-17T23:53:37.346Z","repository":{"id":57541009,"uuid":"290123835","full_name":"horacehylee/aastocks","owner":"horacehylee","description":"AAStocks financial market data extractor","archived":false,"fork":false,"pushed_at":"2020-09-02T06:09:47.000Z","size":292,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-24T08:43:42.952Z","etag":null,"topics":["aastocks","extractor","finance","financial","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/horacehylee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-25T05:40:07.000Z","updated_at":"2024-09-08T12:26:26.000Z","dependencies_parsed_at":"2022-09-17T23:22:33.475Z","dependency_job_id":null,"html_url":"https://github.com/horacehylee/aastocks","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horacehylee%2Faastocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horacehylee%2Faastocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horacehylee%2Faastocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horacehylee%2Faastocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/horacehylee","download_url":"https://codeload.github.com/horacehylee/aastocks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130283,"owners_count":20402753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aastocks","extractor","finance","financial","go","golang"],"created_at":"2024-11-24T05:11:55.919Z","updated_at":"2025-03-17T23:53:37.313Z","avatar_url":"https://github.com/horacehylee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aastocks : AAStocks financial market data extractor\n\n## Overview\n\n[![GoDoc](https://godoc.org/github.com/horacehylee/aastocks?status.svg)](https://godoc.org/github.com/horacehylee/aastocks)\n[![Go Report Card](https://goreportcard.com/badge/github.com/horacehylee/aastocks)](https://goreportcard.com/report/github.com/horacehylee/aastocks)\n[![codecov](https://codecov.io/gh/horacehylee/aastocks/branch/master/graph/badge.svg)](https://codecov.io/gh/horacehylee/aastocks)\n[![Sourcegraph](https://sourcegraph.com/github.com/horacehylee/aastocks/-/badge.svg)](https://sourcegraph.com/github.com/horacehylee/aastocks?badge)\n\nAAStocks financial market data extractor\n\n## Install\n\n```\ngo get github.com/horacehylee/aastocks\n```\n\n## Example\n\n```Go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/horacehylee/aastocks\"\n)\n\n// Example demonstrates getting financial data of quote from AAStocks\nfunc Example() {\n\tlogger := log.New(os.Stdout, \"\", log.Flags())\n\n\t// Getting quote from AAStocks\n\tsymbol := \"00006\"\n\tquote, err := aastocks.Get(symbol)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t}\n\tlogger.Printf(\"Quote: %+v\\n\", quote)\n\n\t// Getting dividends of the quote from AAStocks\n\td, err := quote.Dividends()\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t}\n\tlogger.Printf(\"Dividends count: %v\\n\", len(d))\n\n\t// Getting historical prices of the quote from AAStocks\n\tprices, err := quote.HistoricalPrices(aastocks.Hourly)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t}\n\tlogger.Printf(\"Historical prices count: %v\\n\", len(prices))\n\n\tctx := context.Background()\n\tctx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\tdefer cancel()\n\n\t// Continuously serving latest price of the quote from AAStocks\n\tpriceChan, errChan := quote.ServePrices(ctx, 2*time.Second)\n\tfor {\n\t\tselect {\n\t\tcase p := \u003c-priceChan:\n\t\t\tlogger.Printf(\"Price: %+v\\n\", p)\n\t\tcase err = \u003c-errChan:\n\t\t\tlogger.Printf(\"Error: %v\\n\", err)\n\t\tcase \u003c-ctx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc main() {\n    Example()\n}\n```\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoracehylee%2Faastocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoracehylee%2Faastocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoracehylee%2Faastocks/lists"}