Skip to content

Commit

Permalink
Renamed stock api funcs (#16)
Browse files Browse the repository at this point in the history
* Initial release of REST endpoints functionality
  • Loading branch information
PyDataBlog authored Aug 2, 2021
1 parent 70718f5 commit 4b3abd1
Show file tree
Hide file tree
Showing 16 changed files with 1,505 additions and 262 deletions.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,65 @@
[![Build Status](https://github.com/PyDataBlog/PolygonIO.jl/workflows/CI/badge.svg)](https://github.com/PyDataBlog/PolygonIO.jl/actions)
[![Coverage](https://codecov.io/gh/PyDataBlog/PolygonIO.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PyDataBlog/PolygonIO.jl)
[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/PyDataBlog/PolygonIO.jl)

`PolygonIO.jl` is a client accessing the WebSocket and RESTful APIs of [Polygon.io](https://polygon.io/) in native [Julia](https://julialang.org/).

## Installation

To install `PolygonIO` either do

```julia
using Pkg
Pkg.add("PolygonIO")
```

or switch to `Pkg` mode with `]` and issue

```julia
pkg> add PolygonIO
```

## Usage

```julia
using PolygonIO
opts = PolyOpts(API_KEY, Table.jl Supported Tabular Interface As Sink or nothing)
data = API_FUNC(opts, [args...]; [kwargs...])
```

### Example

```julia
using PolygonIO
using DataFrames

opts = PolyOpts(API_KEY, DataFrame)
ticker_search_info = tickers(opts, "bitcoin")
```

```julia
julia> ticker_search_info = tickers(opts, "bitcoin")
10×10 DataFrame
Row │ ticker name market locale active currency_symbol currency_name base_curre
│ String String String String Bool String String String
─────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ X:BSVUSD Bitcoin SV - United States Dollar crypto global true USD United States Dollar BSV
2 │ X:BTCJPY Bitcoin - Japanese Yen crypto global true JPY Japanese Yen BTC
3 │ X:BCHGBP Bitcoin Cash - Great Britian Pou crypto global true GBP Great Britian Pound BCH
4 │ X:BTCGBP Bitcoin Cash - Great Britain Pou crypto global true GBP Great Britain Pound BTC
5 │ X:BCHCZK Bitcoin Cash - Czech Koruna crypto global true CZK Czech Koruna BCH
6 │ X:ETHBTC Ethereum - Bitcoin crypto global true BTC Bitcoin ETH
7 │ X:BTCEUR Bitcoin - Euro crypto global true EUR Euro BTC
8 │ X:BCHABCUSD Bitcoin Cash ABC - United States crypto global true USD United States Dollar BCHABC
9 │ X:ATMUSD Bitcoin ATM - United States Doll crypto global true USD United States Dollar ATM
10 │ X:BCHUSD Bitcoin Cash - United States Dol crypto global true USD United States Dollar BCH
3 columns omitted
```

## Features

- [X] Full coverage of Stock API
- [X] Full coverage of Forex API
- [X] Full coverage of Crypto API
- [X] Full coverage of Reference Data API
- [ ] Full coverage of WebSocket API
20 changes: 20 additions & 0 deletions docs/src/crypto.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# Crypto API

The following endpoints are covered by the Crypto API via these functions:

* `last_trade_crypto_pair` => Last Trade for a Crypto Pair
* `crypto_daily_open_close` => Daily Open/Close
* `historic_crypto_trades` => Historic Crypto Trades
* `crypto_grouped_daily_bars` => Grouped Daily (Bars)
* `crypto_previous_close` => Previous Close
* `crypto_aggregates_bars` => Aggregates (Bars)
* `crypto_snapshot_all_tickers` => Snapshot All Tickers
* `crypto_snapshot_ticker` => Snapshot Ticker
* `crypto_snapshot_ticker_full_book` => Snapshot Ticker Full Book (L2)
* `crypto_snapshot_gainers_losers` => Snapshot Gainers/Losers

Detailed information on each function can be extracted in Julia. For example;

```julia
using PolygonIO
julia>?last_trade_crypto_pair
```
19 changes: 19 additions & 0 deletions docs/src/forex.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# Forex API

The following endpoints are covered by the Forex API via these functions:

* `historic_forex_ticks` => Historic Forex Ticks
* `real_time_currency_conversion` => Real-time Currency Conversion
* `last_quote_currency_pair` => Last Quote for a Currency Pair
* `forex_grouped_daily_bars` => Aggregates (Bars)
* `forex_previous_close` => Grouped Daily (Bars)
* `forex_aggregates_bars` => Previous Close
* `forex_snapshot_ticker` => Snapshot - All Tickers
* `forex_snapshot_all_tickers` => Snapshot - Gainers/Losers
* `forex_snapshot_gainers_losers` => Snapshot - Ticker

Detailed information on each function can be extracted in Julia. For example;

```julia
using PolygonIO
julia>?historic_forex_ticks
```
75 changes: 75 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,81 @@ CurrentModule = PolygonIO

Documentation for [PolygonIO](https://github.com/PyDataBlog/PolygonIO.jl).

`PolygonIO.jl` is a client accessing the WebSocket and RESTful APIs of [Polygon.io](https://polygon.io/) in native [Julia](https://julialang.org/).

## Installation

To install `PolygonIO` either do

```julia
using Pkg
Pkg.add("PolygonIO")
```

or switch to `Pkg` mode with `]` and issue

```julia
pkg> add PolygonIO
```

## Usage

```julia
using PolygonIO
opts = PolyOpts(API_KEY, Table.jl Supported Tabular Interface As Sink or nothing)
data = API_FUNC(opts, [args...]; [kwargs...])
```

### Example

```julia
using PolygonIO
using DataFrames

opts = PolyOpts(API_KEY, DataFrame)
ticker_search_info = tickers(opts, "bitcoin")
```

```julia
julia> ticker_search_info = tickers(opts, "bitcoin")
10×10 DataFrame
Row │ ticker name market locale active currency_symbol currency_name base_curre
│ String String String String Bool String String String
─────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ X:BSVUSD Bitcoin SV - United States Dollar crypto global true USD United States Dollar BSV
2 │ X:BTCJPY Bitcoin - Japanese Yen crypto global true JPY Japanese Yen BTC
3 │ X:BCHGBP Bitcoin Cash - Great Britian Pou crypto global true GBP Great Britian Pound BCH
4 │ X:BTCGBP Bitcoin Cash - Great Britain Pou crypto global true GBP Great Britain Pound BTC
5 │ X:BCHCZK Bitcoin Cash - Czech Koruna crypto global true CZK Czech Koruna BCH
6 │ X:ETHBTC Ethereum - Bitcoin crypto global true BTC Bitcoin ETH
7 │ X:BTCEUR Bitcoin - Euro crypto global true EUR Euro BTC
8 │ X:BCHABCUSD Bitcoin Cash ABC - United States crypto global true USD United States Dollar BCHABC
9 │ X:ATMUSD Bitcoin ATM - United States Doll crypto global true USD United States Dollar ATM
10 │ X:BCHUSD Bitcoin Cash - United States Dol crypto global true USD United States Dollar BCH
3 columns omitted
```

## Features

- [X] Full coverage of Stock API
- [X] Full coverage of Forex API
- [X] Full coverage of Crypto API
- [X] Full coverage of Reference Data API
- [ ] Full coverage of WebSocket API

## User API Functions & Associated Upstream Endpoints

```@contents
Pages = [
"crypto.md",
"forex.md",
"reference.md",
"stocks.md",
"streaming.md"
]
Depth = 2
```

```@index
```

Expand Down
25 changes: 25 additions & 0 deletions docs/src/reference.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
# Reference API

The following endpoints are covered by the Reference API via these functions:

* `tickers` => Tickers
* `ticker_types` => Ticker Types
* `ticker_details` => Ticker Details
* `ticker_details_vX` => Ticker Details vX
* `ticker_news` => Ticker News
* `markets` => Markets
* `locales` => Locales
* `stock_splits` => Stock Splits
* `stock_dividends` => Stock Dividends
* `stock_financials` => Stock Financials
* `market_holidays` => Market Holidays
* `market_status` => Market Status
* `stock_exchanges` => Stock Exchanges
* `condition_mappings` => Condition Mappings
* `crypto_exchanges` => Crypto Exchanges

Detailed information on each function can be extracted in Julia. For example;

```julia
using PolygonIO
julia>?tickers
```
21 changes: 21 additions & 0 deletions docs/src/stocks.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# Stocks API

The following endpoints are covered by the Stocks API via these functions:

* `stocks_trades` => Trades
* `stocks_quotes_nbbo` => Quotes (NBBO)
* `stocks_last_trade_symbol` => Last Trade for a Symbol v2
* `stocks_last_quote_symbol` => Last Quote for a Symbol v2
* `stocks_daily_open_close` => Daily Open/Close
* `stocks_grouped_daily_bars` => Grouped Daily Bars
* `stocks_previous_close` => Previous Close
* `stocks_aggregates_bars` => Aggregates (Bars)
* `stocks_snapshot_all_tickers` => Snapshot All Tickers
* `stocks_snapshot_ticker` => Snapshot Ticker
* `stocks_snapshot_gainers_losers` => Snapshot Gainers/Losers

Detailed information on each function can be extracted in Julia. For example;

```julia
using PolygonIO
julia>?tickers
```
23 changes: 12 additions & 11 deletions src/PolygonIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,29 @@ include("urls.jl")
include("crypto_api.jl")
include("forex_api.jl")
include("reference_api.jl")
include("stock_api.jl")
include("stocks_api.jl")
include("streaming_socket.jl")



######### Global export of user API ################
# Reference API
export PolyOpts, tickers, ticker_types, ticker_details, ticker_details_vX,
ticker_news, markets, locales, stock_splits, stock_dividends,
stock_financials, market_holidays, market_status, stock_exchanges,
condition_mappings, crypto_exchanges,
ticker_news, markets, locales, stock_splits, stock_dividends,
stock_financials, market_holidays, market_status, stock_exchanges,
condition_mappings, crypto_exchanges,

# Stock API
trades, quotes_nbbo, last_trade_symbol, last_quote_symbol, daily_open_close,
grouped_daily_bars, previous_close, aggregates_bars, snapshot_all_tickers,
snapshot_ticker, snapshot_gainers_losers,
stocks_trades, stocks_quotes_nbbo, stocks_last_trade_symbol, stocks_last_quote_symbol,
stocks_daily_open_close, stocks_grouped_daily_bars, stocks_previous_close,
stocks_aggregates_bars, stocks_snapshot_all_tickers, stocks_snapshot_ticker,
stocks_snapshot_gainers_losers,

# Crypto API
last_trade_crypto_pair, crypto_daily_open_close, historic_crypto_trades,
crypto_grouped_daily_bars, crypto_previous_close, crypto_aggregates_bars,
crypto_snapshot_all_tickers, crypto_snapshot_ticker, crypto_snapshot_ticker_full_book,
crypto_snapshot_gainers_losers,
last_trade_crypto_pair, crypto_daily_open_close, historic_crypto_trades,
crypto_grouped_daily_bars, crypto_previous_close, crypto_aggregates_bars,
crypto_snapshot_all_tickers, crypto_snapshot_ticker, crypto_snapshot_ticker_full_book,
crypto_snapshot_gainers_losers,

# Forex API
historic_forex_ticks, real_time_currency_conversion, last_quote_currency_pair,
Expand Down
Loading

2 comments on commit 4b3abd1

@PyDataBlog
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/42041

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 4b3abd1824e6b38c426965614eefcbfe78e709b9
git push origin v0.1.0

Please sign in to comment.