Giter VIP home page Giter VIP logo

turbot / steampipe-plugin-finance Goto Github PK

View Code? Open in Web Editor NEW
11.0 12.0 3.0 472 KB

Use SQL to instantly query financial data including quotes (equities, cryptocurrency, etc) and US public company information. Open source CLI. No DB required.

Home Page: https://hub.steampipe.io/plugins/turbot/finance

License: Apache License 2.0

Makefile 0.79% PLSQL 0.28% Go 98.93%
sql steampipe steampipe-plugin finance yahoo-finance yahoo-finance-api edgar edgar-scraper stock-market cryptocurrency

steampipe-plugin-finance's Introduction

image

Finance Plugin for Steampipe

Use SQL to query financial data including quotes and public company information.

Quick start

Install the plugin with Steampipe:

steampipe plugin install finance

Run a query:

select
  symbol,
  short_name,
  regular_market_price,
  regular_market_change_percent,
  regular_market_time
from
  finance_quote
where
  symbol in ('GME', 'BTC-USD', 'DOGE-USD', 'ETH-USD');

Engines

This plugin is available for the following engines:

Engine Description
Steampipe The Steampipe CLI exposes APIs and services as a high-performance relational database, giving you the ability to write SQL-based queries to explore dynamic data. Mods extend Steampipe's capabilities with dashboards, reports, and controls built with simple HCL. The Steampipe CLI is a turnkey solution that includes its own Postgres database, plugin management, and mod support.
Postgres FDW Steampipe Postgres FDWs are native Postgres Foreign Data Wrappers that translate APIs to foreign tables. Unlike Steampipe CLI, which ships with its own Postgres server instance, the Steampipe Postgres FDWs can be installed in any supported Postgres database version.
SQLite Extension Steampipe SQLite Extensions provide SQLite virtual tables that translate your queries into API calls, transparently fetching information from your API or service as you request it.
Export Steampipe Plugin Exporters provide a flexible mechanism for exporting information from cloud services and APIs. Each exporter is a stand-alone binary that allows you to extract data using Steampipe plugins without a database.
Turbot Pipes Turbot Pipes is the only intelligence, automation & security platform built specifically for DevOps. Pipes provide hosted Steampipe database instances, shared dashboards, snapshots, and more.

Developing

Prerequisites:

Clone:

git clone https://github.com/turbot/steampipe-plugin-finance.git
cd steampipe-plugin-finance

Build, which automatically installs the new version to your ~/.steampipe/plugins directory:

make

Configure the plugin:

cp config/* ~/.steampipe/config
vi ~/.steampipe/config/finance.spc

Try it!

steampipe query
> .inspect finance

Further reading:

Open Source & Contributing

This repository is published under the Apache 2.0 (source code) and CC BY-NC-ND (docs) licenses. Please see our code of conduct. We look forward to collaborating with you!

Steampipe is a product produced from this open source software, exclusively by Turbot HQ, Inc. It is distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our Open Source FAQ.

Get Involved

Join #steampipe on Slack →

Want to help but don't know where to start? Pick up one of the help wanted issues:

steampipe-plugin-finance's People

Contributors

cbruno10 avatar dependabot[bot] avatar e-gineer avatar madhushreeray30 avatar misraved avatar parthai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steampipe-plugin-finance's Issues

No symbols in finance_qoute

Describe the bug
Working on a macbook, I installed Steampipe with brew and added the finance plugin.

Having tried all the examples on github and documentation site I get this no matter what symbol I try:
Skjermbilde 2023-12-06 kl  10 50 53

Finance qoute daily worked :)

Steampipe version (steampipe -v)
0.21.1
Plugin version (steampipe plugin list)
v0.7.1

To reproduce
select * from finance_quote where symbol = 'AMZN'

Error: Can't find quote for symbol

Describe the bug
Starting this weekend I cannot get any quotes.

Steampipe version (steampipe -v)
v0.19.5

Plugin version (steampipe plugin list)

+---------------------------------------------------+---------+-------------+
| Installed Plugin                                  | Version | Connections |
+---------------------------------------------------+---------+-------------+
| hub.steampipe.io/plugins/turbot/finance@latest    | 0.5.0   | finance     |

To reproduce

steampipe query
Welcome to Steampipe v0.19.5
For more information, type .help
> select
  symbol,
  short_name,
  regular_market_price,
  regular_market_change_percent,
  regular_market_time
from
  finance_quote
where
  symbol in ('GME', 'BTC-USD', 'DOGE-USD', 'ETH-USD');

Error: Can't find quote for symbol: ETH-USD (SQLSTATE HV000)

+--------+------------+----------------------+-------------------------------+---------------------+
| symbol | short_name | regular_market_price | regular_market_change_percent | regular_market_time |
+--------+------------+----------------------+-------------------------------+---------------------+
+--------+------------+----------------------+-------------------------------+---------------------+
>

Expected behavior
Quote list.

Add support for API Token to access finance_us_sec_public_company table data

Is your feature request related to a problem? Please describe.
The finance_us_sec_public_company table uses the endpoint https://api.iextrading.com/1.0/ref-data/symbols?format=csv which now requires an API token for access.

Describe the solution you'd like
Add support for an api_token to the plugin configuration to be able to seamlessly access the data provided by the finance_us_sec_public_company table.

Describe alternatives you've considered
The endpoint https://api.iextrading.com/1.0/ref-data/symbols?format=csv now returns a 403 Forbidden error.

Additional context
https://iexcloud.io/docs/api-basics/api-tokens

XML syntax error when querying 'finance_us_sec_filer' table

Describe the bug
When running queries against the 'finance_us_sec_filer' table I have inconsistent working results.

Earlier today, I ran:

> select * from finance_us_sec_filer where symbol = 'AMZN'
Error: XML syntax error on line 50: element <p> closed by </P>
> select * from finance_us_sec_filer where symbol = 'AAPL'
+--------+------------+------------+------+----------------------+
| symbol | cik        | name       | sic  | sic_description      |
+--------+------------+------------+------+----------------------+
| AAPL   | 0000320193 | Apple Inc. | 3571 | ELECTRONIC COMPUTERS |
+--------+------------+------------+------+----------------------+

Then later I ran:

> select * from finance_us_sec_filer where symbol = 'AMZN'
+--------+------------+----------------+------+----------------------------------------+
| symbol | cik        | name           | sic  | sic_description                        |
+--------+------------+----------------+------+----------------------------------------+
| AMZN   | 0001018724 | AMAZON COM INC | 5961 | RETAIL-CATALOG &amp; MAIL-ORDER HOUSES |
+--------+------------+----------------+------+----------------------------------------+
> select * from finance_us_sec_filer where symbol = 'AAPL'
Error: XML syntax error on line 50: element <p> closed by </P>

I have tried other stock symbols like IBM, ORCL, JNJ, etc. same varying experience.

Welcome to Steampipe v0.7.3
For more information, type .help
> select * from finance_us_sec_filer where symbol = 'JNJ'
Error: XML syntax error on line 50: element <p> closed by </P>
> select * from finance_us_sec_filer where symbol = 'IBM'
+--------+------------+--------------------------------------+------+---------------------------------+
| symbol | cik        | name                                 | sic  | sic_description                 |
+--------+------------+--------------------------------------+------+---------------------------------+
| IBM    | 0000051143 | INTERNATIONAL BUSINESS MACHINES CORP | 3570 | COMPUTER &amp; OFFICE EQUIPMENT |
+--------+------------+--------------------------------------+------+---------------------------------+
> select * from finance_us_sec_filer where symbol = 'AMZN'
+--------+------------+----------------+------+----------------------------------------+
| symbol | cik        | name           | sic  | sic_description                        |
+--------+------------+----------------+------+----------------------------------------+
| AMZN   | 0001018724 | AMAZON COM INC | 5961 | RETAIL-CATALOG &amp; MAIL-ORDER HOUSES |
+--------+------------+----------------+------+----------------------------------------+
> select * from finance_us_sec_filer where symbol = 'AAPL'
+--------+------------+------------+------+----------------------+
| symbol | cik        | name       | sic  | sic_description      |
+--------+------------+------------+------+----------------------+
| AAPL   | 0000320193 | Apple Inc. | 3571 | ELECTRONIC COMPUTERS |
+--------+------------+------------+------+----------------------+
> select * from finance_us_sec_filer where symbol = 'ORCL'
+--------+------------+-------------+------+-------------------------------+
| symbol | cik        | name        | sic  | sic_description               |
+--------+------------+-------------+------+-------------------------------+
| ORCL   | 0001341439 | ORACLE CORP | 7372 | SERVICES-PREPACKAGED SOFTWARE |
+--------+------------+-------------+------+-------------------------------+
> select * from finance_us_sec_filer where symbol = 'GOOGL'
Error: XML syntax error on line 50: element <p> closed by </P>

Steampipe version (steampipe -v)
steampipe version 0.7.3

Plugin version (steampipe plugin list)
Finance v0.0.2

To reproduce
Query examples above in description.

Expected behavior
I should not get the Error: XML syntax error on line 50: element <p> closed by </P> when running queries of a known stock symbol. And consistent results with the queries -- some times I get the error, in others it returns results per above.

Additional context
N/A

The table finance_us_sec_public_company always throws error error: index out of range [1] with length 1

Describe the bug
While quering the table finance_us_sec_public_company it always throws error.

> select * from finance_us_sec_public_company

Error: rpc error: code = Internal desc = hydrate function listUsSecPublicCompany failed with panic runtime error: index out of range [1] with length 1 (SQLSTATE HV000)

+------+--------+------+
| name | symbol | _ctx |
+------+--------+------+
+------+--------+------+

Time: 1.6s.

Steampipe version (steampipe -v)
Example: v0.20.9

Plugin version (steampipe plugin list)
Example: v0.5.0

To reproduce
Run the query select * from finance_us_sec_public_company

Expected behavior
The table should return result instead of error

Additional context
N/A

upstream api error for past few days

Describe the bug
Getting 'upstream api' error for the past few days.

steampipe query
Welcome to Steampipe v0.19.5
For more information, type .help
> select
  symbol,
  short_name,
  regular_market_price,
  regular_market_change_percent,
  regular_market_time
from
  finance_quote
where
  symbol in ('GME', 'BTC-USD', 'DOGE-USD', 'ETH-USD');

Error: code: remote-error, detail: code: remote-error, detail: error response recieved from upstream api (SQLSTATE HV000)

+--------+------------+----------------------+-------------------------------+---------------------+
| symbol | short_name | regular_market_price | regular_market_change_percent | regular_market_time |
+--------+------------+----------------------+-------------------------------+---------------------+
+--------+------------+----------------------+-------------------------------+---------------------+

Steampipe version (steampipe -v)
v0.19.5

Plugin version (steampipe plugin list)
v0.4.0

To reproduce
See above.

Expected behavior
Table with data.

Additional context
It also fails similarly on cloud.steampipe.io.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.