diff --git a/dataprep/connector/errors.py b/dataprep/connector/errors.py index c91ab6764..7890c447a 100644 --- a/dataprep/connector/errors.py +++ b/dataprep/connector/errors.py @@ -1,6 +1,8 @@ """ Module defines errors used in this library. """ +from typing import Set + from ..errors import DataprepError @@ -64,3 +66,29 @@ def __init__(self, param: str) -> None: def __str__(self) -> str: return f"the parameter {self.param} is invalid, refer info method" + + +class MissingRequiredAuthParams(ValueError): + """Some parameters for Authorization are missing.""" + + params: Set[str] + + def __init__(self, params: Set[str]) -> None: + super().__init__() + self.params = params + + def __str__(self) -> str: + return f"Missing required authorization parameter(s) {self.params} in _auth" + + +class InvalidAuthParams(ValueError): + """The parameters used for Authorization are invalid.""" + + params: Set[str] + + def __init__(self, params: Set[str]) -> None: + super().__init__() + self.params = params + + def __str__(self) -> str: + return f"Authorization parameter(s) {self.params} in _auth are not required." diff --git a/dataprep/connector/schema/defs.py b/dataprep/connector/schema/defs.py index dc42cab04..db5c5dd3e 100644 --- a/dataprep/connector/schema/defs.py +++ b/dataprep/connector/schema/defs.py @@ -8,7 +8,7 @@ from pathlib import Path from threading import Thread from time import time -from typing import Any, Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union, Set from urllib.parse import parse_qs, urlparse import socket import requests @@ -16,6 +16,7 @@ from ...utils import is_notebook from .base import BaseDef, BaseDefT +from ..errors import MissingRequiredAuthParams, InvalidAuthParams # pylint: disable=missing-class-docstring,missing-function-docstring FILE_PATH: Path = Path(__file__).resolve().parent @@ -30,6 +31,16 @@ def get_random_string(length: int) -> str: return result_str +def validate_auth(required: Set[str], passed: Dict[str, Any]) -> None: + required_not_passed = required - passed.keys() + passed_not_required = passed.keys() - required + if required_not_passed: + raise MissingRequiredAuthParams(required_not_passed) + + if passed_not_required: + raise InvalidAuthParams(passed_not_required) + + class OffsetPaginationDef(BaseDef): type: str = Field("offset", const=True) max_count: int @@ -130,6 +141,8 @@ def build( port = params.get("port", 9999) code = self._auth(params["client_id"], port) + validate_auth({"client_id", "client_secret"}, params) + ckey = params["client_id"] csecret = params["client_secret"] b64cred = b64encode(f"{ckey}:{csecret}".encode("ascii")).decode() @@ -208,6 +221,8 @@ def build( raise ValueError("storage is required for OAuth2") if "access_token" not in storage or storage.get("expires_at", 0) < time(): + validate_auth({"client_id", "client_secret"}, params) + # Not yet authorized ckey = params["client_id"] csecret = params["client_secret"] @@ -242,6 +257,8 @@ def build( ) -> None: """Populate some required fields to the request data.""" + validate_auth({"access_token"}, params) + req_data["params"][self.key_param] = params["access_token"] @@ -256,6 +273,8 @@ def build( ) -> None: """Populate some required fields to the request data.""" + validate_auth({"access_token"}, params) + req_data["headers"]["Authorization"] = f"Bearer {params['access_token']}" @@ -272,6 +291,8 @@ def build( ) -> None: """Populate some required fields to the request data.""" + validate_auth({"access_token"}, params) + req_data["headers"][self.key_name] = params["access_token"] req_data["headers"].update(self.extra) diff --git a/examples/DataConnector_Finnhub.ipynb b/examples/DataConnector_Finnhub.ipynb index 2fd20dd87..f2a39ea96 100644 --- a/examples/DataConnector_Finnhub.ipynb +++ b/examples/DataConnector_Finnhub.ipynb @@ -30,19 +30,6 @@ "#!pip install dataprep" ] }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "%reload_ext autoreload\n", - "%autoreload 2\n", - "\n", - "import sys\n", - "sys.path.append(\"/home/pallavi/git/ra/dataprep\")" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -57,16 +44,16 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 5, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -74,9 +61,8 @@ "source": [ "from dataprep.connector import Connector\n", "\n", - "auth_token = ''\n", + "auth_token = ''\n", "dc = Connector('finnhub', _auth={\"access_token\":auth_token})\n", - "\n", "dc" ] }, @@ -387,7 +373,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -426,242 +412,242 @@ " \n", " 0\n", " crypto\n", - " 1595366450\n", - " Bitcoiners Are Not Looking for a Store of Valu...\n", - " 5012674\n", + " 1602453960\n", + " Fans voting with tokens pick a winning team\n", + " 5430725\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " Although Bitcoin holders often describe the as...\n", - " https://cointelegraph.com/news/bitcoiners-are-...\n", + " Fans chose the formation and the attacking lin...\n", + " https://cointelegraph.com/news/fans-voting-wit...\n", " \n", " \n", " 1\n", " crypto\n", - " 1595366367\n", - " Grayscale Moves to List Bitcoin Cash and Litec...\n", - " 5012788\n", + " 1602452771\n", + " Crypto Long & Short: A U.K. Ban on Crypto Deri...\n", + " 5430623\n", " https://static.coindesk.com/wp-content/uploads...\n", " \n", " CoinDesk\n", - " Bitcoin Cash Trust and Litecoin Trust will car...\n", - " https://www.coindesk.com/grayscale-moves-to-li...\n", + " The FCA’s retail investor crypto derivatives b...\n", + " https://www.coindesk.com/fca-ban-crypto-deriva...\n", " \n", " \n", " 2\n", " crypto\n", - " 1595365320\n", - " China Considers Implementing Blockchain Tech i...\n", - " 5012675\n", + " 1602446435\n", + " Data encryption a threat to fighting child sex...\n", + " 5430414\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " China’s Securities Regulatory Commission allow...\n", - " https://cointelegraph.com/news/china-considers...\n", + " The department, along with other international...\n", + " https://cointelegraph.com/news/data-encryption...\n", " \n", " \n", " 3\n", " crypto\n", - " 1595363296\n", - " Market Wrap: Bitcoin Briefly Pops Above $9,400...\n", - " 5012557\n", - " https://static.coindesk.com/wp-content/uploads...\n", + " 1602443340\n", + " Top 5 cryptocurrencies to watch this week: BTC...\n", + " 5430109\n", + " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", - " CoinDesk\n", - " Bitcoin broke through $9,400 as stock indices ...\n", - " https://www.coindesk.com/market-wrap-bitcoin-b...\n", + " Cointelegraph\n", + " Bitcoin price could achieve a new 2020 high if...\n", + " https://cointelegraph.com/news/top-5-cryptocur...\n", " \n", " \n", " 4\n", " crypto\n", - " 1595362170\n", - " ERX Gets License to Launch Exchange in Thailand\n", - " 5012439\n", - " https://static.coindesk.com/wp-content/uploads...\n", + " 1602442833\n", + " Bitcoin rallies, McAfee compares prison to Hil...\n", + " 5430110\n", + " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", - " CoinDesk\n", - " Thailand’s securities watchdog has granted a d...\n", - " https://www.coindesk.com/erx-gets-license-to-l...\n", + " Cointelegraph\n", + " The best (and worst) quotes, adoption and regu...\n", + " https://cointelegraph.com/magazine/2020/10/11/...\n", " \n", " \n", " 5\n", " crypto\n", - " 1595361488\n", - " Over 7M Americans Own BTC But Hold None In Ret...\n", - " 5012440\n", - " https://res.cloudinary.com/whirlpooldata/image...\n", + " 1602442800\n", + " Signal, Noise and the Coming Era of AI Curation\n", + " 5430108\n", + " https://static.coindesk.com/wp-content/uploads...\n", " \n", - " Cointelegraph\n", - " Millions of U.S. citizens own both Bitcoin and...\n", - " https://cointelegraph.com/news/over-7m-america...\n", + " CoinDesk\n", + " On this \"Speaking of Bitcoin\" episode, join ho...\n", + " https://www.coindesk.com/ai-curation-speaking-...\n", " \n", " \n", " 6\n", " crypto\n", - " 1595360640\n", - " Ethereum ‘Flippens’ Stablecoins to Become the ...\n", - " 5012336\n", - " https://res.cloudinary.com/whirlpooldata/image...\n", + " 1602439078\n", + " Pelosi Says Stimulus Talks at Impasse; Trump B...\n", + " 5429905\n", + " https://static.coindesk.com/wp-content/uploads...\n", " \n", - " Cointelegraph\n", - " Increasing stablecoin use and the rise of DeFi...\n", - " https://cointelegraph.com/news/ethereum-flippe...\n", + " CoinDesk\n", + " The House Speaker says the president's recentl...\n", + " https://www.coindesk.com/pelosi-says-stimulus-...\n", " \n", " \n", " 7\n", " crypto\n", - " 1595358600\n", - " Why Did LocalBitcoins Give Up Their Users’ Pri...\n", - " 5012230\n", + " 1602435300\n", + " Group raising funds to sue Andre Cronje over E...\n", + " 5429708\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " LocalBitcoins COO Elena Tonoyan explains how t...\n", - " https://cointelegraph.com/news/why-did-localbi...\n", + " Cronje may have gone silent on Twitter, but it...\n", + " https://cointelegraph.com/news/group-raising-f...\n", " \n", " \n", " 8\n", " crypto\n", - " 1595358000\n", - " What’s Behind the Fed’s New Push to Promote In...\n", - " 5012229\n", - " https://static.coindesk.com/wp-content/uploads...\n", + " 1602432148\n", + " More investors HODL Bitcoin in anticipation of...\n", + " 5429502\n", + " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", - " CoinDesk\n", - " Why the Fed’s strategy on inflation is changin...\n", - " https://www.coindesk.com/whats-behind-the-feds...\n", + " Cointelegraph\n", + " On-chain data shows a rise in HODLing among re...\n", + " https://cointelegraph.com/news/more-investors-...\n", " \n", " \n", " 9\n", " crypto\n", - " 1595356862\n", - " Russia to Treat Crypto as a Taxable Property\n", - " 5012121\n", + " 1602431798\n", + " Ripple’s Larsen Says US Risks Losing Stewardsh...\n", + " 5429501\n", " https://static.coindesk.com/wp-content/uploads...\n", " \n", " CoinDesk\n", - " Russia changed its draft bill regulating crypt...\n", - " https://www.coindesk.com/russia-to-treat-crypt...\n", + " Chris Larsen, Ripple co-founder and chairman o...\n", + " https://www.coindesk.com/ripples-larsen-says-u...\n", " \n", " \n", " 10\n", " crypto\n", - " 1595356560\n", - " Kazakhstan Needs National Crypto to Fight Corr...\n", - " 5012122\n", + " 1602429540\n", + " Spanish lawmakers get cryptocurrency in a bid ...\n", + " 5429300\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " Kazakhstan’s digital tenge has the potential t...\n", - " https://cointelegraph.com/news/kazakhstan-need...\n", + " All 350 members of Spain’s lower house got 1 e...\n", + " https://cointelegraph.com/news/spanish-lawmake...\n", " \n", " \n", " 11\n", " crypto\n", - " 1595353094\n", - " July’s Decentralized Exchange Volumes Have Alr...\n", - " 5011898\n", - " https://static.coindesk.com/wp-content/uploads...\n", + " 1602423000\n", + " NFT and crypto art can magnify the truth of ou...\n", + " 5428993\n", + " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", - " CoinDesk\n", - " DEX trading volume already beat June's record,...\n", - " https://www.coindesk.com/julys-decentralized-e...\n", + " Cointelegraph\n", + " There are already enough signs to say that the...\n", + " https://cointelegraph.com/news/nft-and-crypto-...\n", " \n", " \n", " 12\n", " crypto\n", - " 1595351340\n", - " Could Compound’s Governance Token COMP Be Deem...\n", - " 5011789\n", - " https://res.cloudinary.com/whirlpooldata/image...\n", + " 1602421200\n", + " Is Bitcoin More Correlated to Stocks or Gold?\n", + " 5428892\n", + " https://static.coindesk.com/wp-content/uploads...\n", " \n", - " Cointelegraph\n", - " Examining COMP’s ability to pass the Howey tes...\n", - " https://cointelegraph.com/news/could-compounds...\n", + " CoinDesk\n", + " According to analyst Lyn Alden, bitcoin's corr...\n", + " https://www.coindesk.com/bitcoin-correlated-st...\n", " \n", " \n", " 13\n", " crypto\n", - " 1595350380\n", - " Sizeable Portion of Tether’s $4.5B Growth Come...\n", - " 5011686\n", + " 1602403200\n", + " Wolf of Wall Street on steroids: DeFi may be a...\n", + " 5427896\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " Tether rose quickly to $9.1 billion in 2020 as...\n", - " https://cointelegraph.com/news/sizeable-portio...\n", + " We’re in the middle of the greatest wealth tra...\n", + " https://cointelegraph.com/news/wolf-of-wall-st...\n", " \n", " \n", " 14\n", " crypto\n", - " 1595349331\n", - " Blockchain Bites: China’s BSN Integrations and...\n", - " 5011682\n", + " 1602383345\n", + " Coinbase Senior Software Engineer Left This We...\n", + " 5426807\n", " https://static.coindesk.com/wp-content/uploads...\n", " \n", " CoinDesk\n", - " Ethereum Classic supporters are ditching the p...\n", - " https://www.coindesk.com/blockchain-bites-chin...\n", + " Andrei Anisimov, whose LInkedIn profile still ...\n", + " https://www.coindesk.com/coinbase-senior-engin...\n", " \n", " \n", " 15\n", " crypto\n", - " 1595348280\n", - " Crypto Scammer Sentenced by South Korean Autho...\n", - " 5011568\n", + " 1602370759\n", + " Ethereum miners made 450K ETH from high networ...\n", + " 5426115\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " Man sentenced to two years and six months in p...\n", - " https://cointelegraph.com/news/crypto-scammer-...\n", + " On-chain data shows Ethereum miners saw a 39% ...\n", + " https://cointelegraph.com/news/ethereum-miners...\n", " \n", " \n", " 16\n", " crypto\n", - " 1595347920\n", - " Bitcoin Volatility Hits 2018 Lows but Is a Rep...\n", - " 5011569\n", + " 1602367800\n", + " OneCoin movie starring Kate Winslet coming soon\n", + " 5425916\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " Traders remain cautious as Bitcoin’s current l...\n", - " https://cointelegraph.com/news/bitcoin-volatil...\n", + " If the courtroom drama of OneCoin is not enoug...\n", + " https://cointelegraph.com/news/onecoin-movie-s...\n", " \n", " \n", " 17\n", " crypto\n", - " 1595347706\n", - " Blockchain Fintech Firm BitBond Joins German B...\n", - " 5011566\n", + " 1602362531\n", + " Shenzhen Giving Away Millions in Digital Yuan ...\n", + " 5425621\n", " https://static.coindesk.com/wp-content/uploads...\n", " \n", " CoinDesk\n", - " The Berlin-based fintech firm announced on Tue...\n", - " https://www.coindesk.com/blockchain-fintech-fi...\n", + " The promotion is part of China's efforts to tr...\n", + " https://www.coindesk.com/shenzhen-giving-away-...\n", " \n", " \n", " 18\n", " crypto\n", - " 1595347200\n", - " Crypto Tax Disclosures Can Help With Internal ...\n", - " 5011570\n", + " 1602358800\n", + " Payments firm Rocketfuel Blockchain sues co-fo...\n", + " 5425423\n", " https://res.cloudinary.com/whirlpooldata/image...\n", " \n", " Cointelegraph\n", - " Disclosure sounds like it exposes you to extra...\n", - " https://cointelegraph.com/news/crypto-tax-disc...\n", + " The blockchain payments company said it unknow...\n", + " https://cointelegraph.com/news/payments-firm-r...\n", " \n", " \n", " 19\n", " crypto\n", - " 1595347200\n", - " Bitcoin News Roundup for July 21, 2020\n", - " 5011567\n", + " 1602356400\n", + " The Potential Ripple Effects of Ethereum 2.0, ...\n", + " 5425322\n", " https://static.coindesk.com/wp-content/uploads...\n", " \n", " CoinDesk\n", - " With the price of BTC catching a bid in early ...\n", - " https://www.coindesk.com/bitcoin-news-roundup-...\n", + " CoinDesk’s Christine Kim spoke to colleagues M...\n", + " https://www.coindesk.com/eth-2-podcast-unanswe...\n", " \n", " \n", "\n", @@ -669,108 +655,108 @@ ], "text/plain": [ " category datetime headline \\\n", - "0 crypto 1595366450 Bitcoiners Are Not Looking for a Store of Valu... \n", - "1 crypto 1595366367 Grayscale Moves to List Bitcoin Cash and Litec... \n", - "2 crypto 1595365320 China Considers Implementing Blockchain Tech i... \n", - "3 crypto 1595363296 Market Wrap: Bitcoin Briefly Pops Above $9,400... \n", - "4 crypto 1595362170 ERX Gets License to Launch Exchange in Thailand \n", - "5 crypto 1595361488 Over 7M Americans Own BTC But Hold None In Ret... \n", - "6 crypto 1595360640 Ethereum ‘Flippens’ Stablecoins to Become the ... \n", - "7 crypto 1595358600 Why Did LocalBitcoins Give Up Their Users’ Pri... \n", - "8 crypto 1595358000 What’s Behind the Fed’s New Push to Promote In... \n", - "9 crypto 1595356862 Russia to Treat Crypto as a Taxable Property \n", - "10 crypto 1595356560 Kazakhstan Needs National Crypto to Fight Corr... \n", - "11 crypto 1595353094 July’s Decentralized Exchange Volumes Have Alr... \n", - "12 crypto 1595351340 Could Compound’s Governance Token COMP Be Deem... \n", - "13 crypto 1595350380 Sizeable Portion of Tether’s $4.5B Growth Come... \n", - "14 crypto 1595349331 Blockchain Bites: China’s BSN Integrations and... \n", - "15 crypto 1595348280 Crypto Scammer Sentenced by South Korean Autho... \n", - "16 crypto 1595347920 Bitcoin Volatility Hits 2018 Lows but Is a Rep... \n", - "17 crypto 1595347706 Blockchain Fintech Firm BitBond Joins German B... \n", - "18 crypto 1595347200 Crypto Tax Disclosures Can Help With Internal ... \n", - "19 crypto 1595347200 Bitcoin News Roundup for July 21, 2020 \n", + "0 crypto 1602453960 Fans voting with tokens pick a winning team \n", + "1 crypto 1602452771 Crypto Long & Short: A U.K. Ban on Crypto Deri... \n", + "2 crypto 1602446435 Data encryption a threat to fighting child sex... \n", + "3 crypto 1602443340 Top 5 cryptocurrencies to watch this week: BTC... \n", + "4 crypto 1602442833 Bitcoin rallies, McAfee compares prison to Hil... \n", + "5 crypto 1602442800 Signal, Noise and the Coming Era of AI Curation \n", + "6 crypto 1602439078 Pelosi Says Stimulus Talks at Impasse; Trump B... \n", + "7 crypto 1602435300 Group raising funds to sue Andre Cronje over E... \n", + "8 crypto 1602432148 More investors HODL Bitcoin in anticipation of... \n", + "9 crypto 1602431798 Ripple’s Larsen Says US Risks Losing Stewardsh... \n", + "10 crypto 1602429540 Spanish lawmakers get cryptocurrency in a bid ... \n", + "11 crypto 1602423000 NFT and crypto art can magnify the truth of ou... \n", + "12 crypto 1602421200 Is Bitcoin More Correlated to Stocks or Gold? \n", + "13 crypto 1602403200 Wolf of Wall Street on steroids: DeFi may be a... \n", + "14 crypto 1602383345 Coinbase Senior Software Engineer Left This We... \n", + "15 crypto 1602370759 Ethereum miners made 450K ETH from high networ... \n", + "16 crypto 1602367800 OneCoin movie starring Kate Winslet coming soon \n", + "17 crypto 1602362531 Shenzhen Giving Away Millions in Digital Yuan ... \n", + "18 crypto 1602358800 Payments firm Rocketfuel Blockchain sues co-fo... \n", + "19 crypto 1602356400 The Potential Ripple Effects of Ethereum 2.0, ... \n", "\n", " id image related \\\n", - "0 5012674 https://res.cloudinary.com/whirlpooldata/image... \n", - "1 5012788 https://static.coindesk.com/wp-content/uploads... \n", - "2 5012675 https://res.cloudinary.com/whirlpooldata/image... \n", - "3 5012557 https://static.coindesk.com/wp-content/uploads... \n", - "4 5012439 https://static.coindesk.com/wp-content/uploads... \n", - "5 5012440 https://res.cloudinary.com/whirlpooldata/image... \n", - "6 5012336 https://res.cloudinary.com/whirlpooldata/image... \n", - "7 5012230 https://res.cloudinary.com/whirlpooldata/image... \n", - "8 5012229 https://static.coindesk.com/wp-content/uploads... \n", - "9 5012121 https://static.coindesk.com/wp-content/uploads... \n", - "10 5012122 https://res.cloudinary.com/whirlpooldata/image... \n", - "11 5011898 https://static.coindesk.com/wp-content/uploads... \n", - "12 5011789 https://res.cloudinary.com/whirlpooldata/image... \n", - "13 5011686 https://res.cloudinary.com/whirlpooldata/image... \n", - "14 5011682 https://static.coindesk.com/wp-content/uploads... \n", - "15 5011568 https://res.cloudinary.com/whirlpooldata/image... \n", - "16 5011569 https://res.cloudinary.com/whirlpooldata/image... \n", - "17 5011566 https://static.coindesk.com/wp-content/uploads... \n", - "18 5011570 https://res.cloudinary.com/whirlpooldata/image... \n", - "19 5011567 https://static.coindesk.com/wp-content/uploads... \n", + "0 5430725 https://res.cloudinary.com/whirlpooldata/image... \n", + "1 5430623 https://static.coindesk.com/wp-content/uploads... \n", + "2 5430414 https://res.cloudinary.com/whirlpooldata/image... \n", + "3 5430109 https://res.cloudinary.com/whirlpooldata/image... \n", + "4 5430110 https://res.cloudinary.com/whirlpooldata/image... \n", + "5 5430108 https://static.coindesk.com/wp-content/uploads... \n", + "6 5429905 https://static.coindesk.com/wp-content/uploads... \n", + "7 5429708 https://res.cloudinary.com/whirlpooldata/image... \n", + "8 5429502 https://res.cloudinary.com/whirlpooldata/image... \n", + "9 5429501 https://static.coindesk.com/wp-content/uploads... \n", + "10 5429300 https://res.cloudinary.com/whirlpooldata/image... \n", + "11 5428993 https://res.cloudinary.com/whirlpooldata/image... \n", + "12 5428892 https://static.coindesk.com/wp-content/uploads... \n", + "13 5427896 https://res.cloudinary.com/whirlpooldata/image... \n", + "14 5426807 https://static.coindesk.com/wp-content/uploads... \n", + "15 5426115 https://res.cloudinary.com/whirlpooldata/image... \n", + "16 5425916 https://res.cloudinary.com/whirlpooldata/image... \n", + "17 5425621 https://static.coindesk.com/wp-content/uploads... \n", + "18 5425423 https://res.cloudinary.com/whirlpooldata/image... \n", + "19 5425322 https://static.coindesk.com/wp-content/uploads... \n", "\n", " source summary \\\n", - "0 Cointelegraph Although Bitcoin holders often describe the as... \n", - "1 CoinDesk Bitcoin Cash Trust and Litecoin Trust will car... \n", - "2 Cointelegraph China’s Securities Regulatory Commission allow... \n", - "3 CoinDesk Bitcoin broke through $9,400 as stock indices ... \n", - "4 CoinDesk Thailand’s securities watchdog has granted a d... \n", - "5 Cointelegraph Millions of U.S. citizens own both Bitcoin and... \n", - "6 Cointelegraph Increasing stablecoin use and the rise of DeFi... \n", - "7 Cointelegraph LocalBitcoins COO Elena Tonoyan explains how t... \n", - "8 CoinDesk Why the Fed’s strategy on inflation is changin... \n", - "9 CoinDesk Russia changed its draft bill regulating crypt... \n", - "10 Cointelegraph Kazakhstan’s digital tenge has the potential t... \n", - "11 CoinDesk DEX trading volume already beat June's record,... \n", - "12 Cointelegraph Examining COMP’s ability to pass the Howey tes... \n", - "13 Cointelegraph Tether rose quickly to $9.1 billion in 2020 as... \n", - "14 CoinDesk Ethereum Classic supporters are ditching the p... \n", - "15 Cointelegraph Man sentenced to two years and six months in p... \n", - "16 Cointelegraph Traders remain cautious as Bitcoin’s current l... \n", - "17 CoinDesk The Berlin-based fintech firm announced on Tue... \n", - "18 Cointelegraph Disclosure sounds like it exposes you to extra... \n", - "19 CoinDesk With the price of BTC catching a bid in early ... \n", + "0 Cointelegraph Fans chose the formation and the attacking lin... \n", + "1 CoinDesk The FCA’s retail investor crypto derivatives b... \n", + "2 Cointelegraph The department, along with other international... \n", + "3 Cointelegraph Bitcoin price could achieve a new 2020 high if... \n", + "4 Cointelegraph The best (and worst) quotes, adoption and regu... \n", + "5 CoinDesk On this \"Speaking of Bitcoin\" episode, join ho... \n", + "6 CoinDesk The House Speaker says the president's recentl... \n", + "7 Cointelegraph Cronje may have gone silent on Twitter, but it... \n", + "8 Cointelegraph On-chain data shows a rise in HODLing among re... \n", + "9 CoinDesk Chris Larsen, Ripple co-founder and chairman o... \n", + "10 Cointelegraph All 350 members of Spain’s lower house got 1 e... \n", + "11 Cointelegraph There are already enough signs to say that the... \n", + "12 CoinDesk According to analyst Lyn Alden, bitcoin's corr... \n", + "13 Cointelegraph We’re in the middle of the greatest wealth tra... \n", + "14 CoinDesk Andrei Anisimov, whose LInkedIn profile still ... \n", + "15 Cointelegraph On-chain data shows Ethereum miners saw a 39% ... \n", + "16 Cointelegraph If the courtroom drama of OneCoin is not enoug... \n", + "17 CoinDesk The promotion is part of China's efforts to tr... \n", + "18 Cointelegraph The blockchain payments company said it unknow... \n", + "19 CoinDesk CoinDesk’s Christine Kim spoke to colleagues M... \n", "\n", " url \n", - "0 https://cointelegraph.com/news/bitcoiners-are-... \n", - "1 https://www.coindesk.com/grayscale-moves-to-li... \n", - "2 https://cointelegraph.com/news/china-considers... \n", - "3 https://www.coindesk.com/market-wrap-bitcoin-b... \n", - "4 https://www.coindesk.com/erx-gets-license-to-l... \n", - "5 https://cointelegraph.com/news/over-7m-america... \n", - "6 https://cointelegraph.com/news/ethereum-flippe... \n", - "7 https://cointelegraph.com/news/why-did-localbi... \n", - "8 https://www.coindesk.com/whats-behind-the-feds... \n", - "9 https://www.coindesk.com/russia-to-treat-crypt... \n", - "10 https://cointelegraph.com/news/kazakhstan-need... \n", - "11 https://www.coindesk.com/julys-decentralized-e... \n", - "12 https://cointelegraph.com/news/could-compounds... \n", - "13 https://cointelegraph.com/news/sizeable-portio... \n", - "14 https://www.coindesk.com/blockchain-bites-chin... \n", - "15 https://cointelegraph.com/news/crypto-scammer-... \n", - "16 https://cointelegraph.com/news/bitcoin-volatil... \n", - "17 https://www.coindesk.com/blockchain-fintech-fi... \n", - "18 https://cointelegraph.com/news/crypto-tax-disc... \n", - "19 https://www.coindesk.com/bitcoin-news-roundup-... " + "0 https://cointelegraph.com/news/fans-voting-wit... \n", + "1 https://www.coindesk.com/fca-ban-crypto-deriva... \n", + "2 https://cointelegraph.com/news/data-encryption... \n", + "3 https://cointelegraph.com/news/top-5-cryptocur... \n", + "4 https://cointelegraph.com/magazine/2020/10/11/... \n", + "5 https://www.coindesk.com/ai-curation-speaking-... \n", + "6 https://www.coindesk.com/pelosi-says-stimulus-... \n", + "7 https://cointelegraph.com/news/group-raising-f... \n", + "8 https://cointelegraph.com/news/more-investors-... \n", + "9 https://www.coindesk.com/ripples-larsen-says-u... \n", + "10 https://cointelegraph.com/news/spanish-lawmake... \n", + "11 https://cointelegraph.com/news/nft-and-crypto-... \n", + "12 https://www.coindesk.com/bitcoin-correlated-st... \n", + "13 https://cointelegraph.com/news/wolf-of-wall-st... \n", + "14 https://www.coindesk.com/coinbase-senior-engin... \n", + "15 https://cointelegraph.com/news/ethereum-miners... \n", + "16 https://cointelegraph.com/news/onecoin-movie-s... \n", + "17 https://www.coindesk.com/shenzhen-giving-away-... \n", + "18 https://cointelegraph.com/news/payments-firm-r... \n", + "19 https://www.coindesk.com/eth-2-podcast-unanswe... " ] }, - "execution_count": 5, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# category = general/forex/crypto/merger\n", - "df = dc.query('general_news', category='crypto')\n", + "df = await dc.query('general_news', category='crypto')\n", "df" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -880,6 +866,18 @@ " \n", " \n", " 195\n", + " company news\n", + " 1588331340\n", + " Forget a 1-for-12 Split, Aurora Stock May as W...\n", + " 629448\n", + " https://investorplace.com/wp-content/uploads/2...\n", + " AAPL\n", + " INVESTORPLACE\n", + " Aurora Cannabis (NYSE:ACB) trades below $1. To...\n", + " https://investorplace.com/2020/05/forget-1-for...\n", + " \n", + " \n", + " 196\n", " company\n", " 1588331305\n", " Futures slide as Trump threatens new tariffs o...\n", @@ -891,7 +889,19 @@ " https://www.reuters.com/article/us-usa-stocks/...\n", " \n", " \n", - " 196\n", + " 197\n", + " company\n", + " 1588331100\n", + " Apple Just Announced a Dividend Increase | The...\n", + " 55079783\n", + " https://g.foolcdn.com/editorial/images/570752/...\n", + " AAPL\n", + " https://www.fool.com\n", + " The dividend hike during this pandemic demonst...\n", + " https://www.fool.com/investing/2020/05/01/appl...\n", + " \n", + " \n", + " 198\n", " company news\n", " 1588331100\n", " Apple Just Announced a Dividend Increase\n", @@ -903,7 +913,7 @@ " https://www.fool.com/investing/2020/05/01/appl...\n", " \n", " \n", - " 197\n", + " 199\n", " company\n", " 1588330811\n", " Bitcoin Rises Back to $8.8K Even as US Stock F...\n", @@ -914,30 +924,6 @@ " While bitcoin is rising so far on Friday, the ...\n", " https://www.coindesk.com/bitcoin-rises-8-8k-fu...\n", " \n", - " \n", - " 198\n", - " company\n", - " 1588330698\n", - " US STOCKS-Futures slide as Trump threatens new...\n", - " 20582\n", - " https://s4.reutersmedia.net/resources_v2/image...\n", - " AAPL\n", - " reuters\n", - " U.S. stock index futures slid on Friday after ...\n", - " https://www.reuters.com/article/usa-stocks/us-...\n", - " \n", - " \n", - " 199\n", - " company news\n", - " 1588330614\n", - " FX Daily: Treading Carefully With Risk\n", - " 629451\n", - " https://d1ty0e8cxefhfl.cloudfront.net/contribu...\n", - " AAPL\n", - " TALKMARKETS\n", - " With the S&P 500 seemingly stalling at a 62% t...\n", - " https://talkmarkets.com/content/us-markets/fx-...\n", - " \n", " \n", "\n", "

200 rows × 9 columns

\n", @@ -951,24 +937,24 @@ "3 company 1588377600 \n", "4 company 1588377600 \n", ".. ... ... \n", - "195 company 1588331305 \n", - "196 company news 1588331100 \n", - "197 company 1588330811 \n", - "198 company 1588330698 \n", - "199 company news 1588330614 \n", + "195 company news 1588331340 \n", + "196 company 1588331305 \n", + "197 company 1588331100 \n", + "198 company news 1588331100 \n", + "199 company 1588330811 \n", "\n", - " headline id \\\n", - "0 WhatsApp Suddenly Gets Powerful New Security B... 691320 \n", - "1 2020 iPhone Alert: Apple’s New Price Changes R... 691319 \n", - "2 Forget Google—Huawei Plans A Killer New Update... 691318 \n", - "3 Apple Watch Series 6 Leak Details 5 Great Inno... 687591 \n", - "4 Market Slides More Than 2% to Begin May 666265 \n", - ".. ... ... \n", - "195 Futures slide as Trump threatens new tariffs o... 20617 \n", - "196 Apple Just Announced a Dividend Increase 629449 \n", - "197 Bitcoin Rises Back to $8.8K Even as US Stock F... 691450 \n", - "198 US STOCKS-Futures slide as Trump threatens new... 20582 \n", - "199 FX Daily: Treading Carefully With Risk 629451 \n", + " headline id \\\n", + "0 WhatsApp Suddenly Gets Powerful New Security B... 691320 \n", + "1 2020 iPhone Alert: Apple’s New Price Changes R... 691319 \n", + "2 Forget Google—Huawei Plans A Killer New Update... 691318 \n", + "3 Apple Watch Series 6 Leak Details 5 Great Inno... 687591 \n", + "4 Market Slides More Than 2% to Begin May 666265 \n", + ".. ... ... \n", + "195 Forget a 1-for-12 Split, Aurora Stock May as W... 629448 \n", + "196 Futures slide as Trump threatens new tariffs o... 20617 \n", + "197 Apple Just Announced a Dividend Increase | The... 55079783 \n", + "198 Apple Just Announced a Dividend Increase 629449 \n", + "199 Bitcoin Rises Back to $8.8K Even as US Stock F... 691450 \n", "\n", " image related \\\n", "0 https://thumbor.forbes.com/thumbor/fit-in/1200... AAPL \n", @@ -977,11 +963,11 @@ "3 https://thumbor.forbes.com/thumbor/fit-in/1200... AAPL \n", "4 https://i-invdn-com.akamaized.net/redesign/ima... AAPL \n", ".. ... ... \n", - "195 https://s3.reutersmedia.net/resources/r/?m=02&... AAPL \n", - "196 https://g.foolcdn.com/editorial/images/570752/... AAPL \n", - "197 https://static.coindesk.com/wp-content/uploads... AAPL \n", - "198 https://s4.reutersmedia.net/resources_v2/image... AAPL \n", - "199 https://d1ty0e8cxefhfl.cloudfront.net/contribu... AAPL \n", + "195 https://investorplace.com/wp-content/uploads/2... AAPL \n", + "196 https://s3.reutersmedia.net/resources/r/?m=02&... AAPL \n", + "197 https://g.foolcdn.com/editorial/images/570752/... AAPL \n", + "198 https://g.foolcdn.com/editorial/images/570752/... AAPL \n", + "199 https://static.coindesk.com/wp-content/uploads... AAPL \n", "\n", " source \\\n", "0 https://www.forbes.com \n", @@ -990,11 +976,11 @@ "3 https://www.forbes.com \n", "4 investing \n", ".. ... \n", - "195 reuters \n", - "196 FOOL \n", - "197 https://www.coindesk.com \n", - "198 reuters \n", - "199 TALKMARKETS \n", + "195 INVESTORPLACE \n", + "196 reuters \n", + "197 https://www.fool.com \n", + "198 FOOL \n", + "199 https://www.coindesk.com \n", "\n", " summary \\\n", "0 WhatsApp has been seriously boosted this week—... \n", @@ -1003,11 +989,11 @@ "3 A leak, confirmed by one of the hottest tipste... \n", "4 Stocks Analysis by Zacks Investment Research c... \n", ".. ... \n", - "195 U.S. stock index futures slid on Friday after ... \n", - "196 The dividend hike during this pandemic demonst... \n", - "197 While bitcoin is rising so far on Friday, the ... \n", - "198 U.S. stock index futures slid on Friday after ... \n", - "199 With the S&P 500 seemingly stalling at a 62% t... \n", + "195 Aurora Cannabis (NYSE:ACB) trades below $1. To... \n", + "196 U.S. stock index futures slid on Friday after ... \n", + "197 The dividend hike during this pandemic demonst... \n", + "198 The dividend hike during this pandemic demonst... \n", + "199 While bitcoin is rising so far on Friday, the ... \n", "\n", " url \n", "0 https://www.forbes.com/sites/zakdoffman/2020/0... \n", @@ -1016,28 +1002,28 @@ "3 https://www.forbes.com/sites/davidphelan/2020/... \n", "4 https://www.investing.com/analysis/market-slid... \n", ".. ... \n", - "195 https://www.reuters.com/article/us-usa-stocks/... \n", - "196 https://www.fool.com/investing/2020/05/01/appl... \n", - "197 https://www.coindesk.com/bitcoin-rises-8-8k-fu... \n", - "198 https://www.reuters.com/article/usa-stocks/us-... \n", - "199 https://talkmarkets.com/content/us-markets/fx-... \n", + "195 https://investorplace.com/2020/05/forget-1-for... \n", + "196 https://www.reuters.com/article/us-usa-stocks/... \n", + "197 https://www.fool.com/investing/2020/05/01/appl... \n", + "198 https://www.fool.com/investing/2020/05/01/appl... \n", + "199 https://www.coindesk.com/bitcoin-rises-8-8k-fu... \n", "\n", "[200 rows x 9 columns]" ] }, - "execution_count": 6, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = dc.query('company_news', symbol='AAPL', from_='2020-04-30', to='2020-05-01')\n", + "df = await dc.query('company_news', symbol='AAPL', from_='2020-04-01', to='2020-05-01')\n", "df" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -1074,56 +1060,56 @@ " \n", " \n", " 0\n", - " 0000320193-20-000056\n", + " 0000320193-20-000084\n", " AAPL\n", " 320193\n", " 4\n", - " 2020-05-12 00:00:00\n", - " 2020-05-12 18:30:32\n", + " 2020-10-05 00:00:00\n", + " 2020-10-05 18:33:56\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 1\n", - " 0001193125-20-139112\n", + " 0000320193-20-000083\n", " AAPL\n", " 320193\n", - " 8-K\n", - " 2020-05-11 00:00:00\n", - " 2020-05-11 16:31:15\n", - " https://www.sec.gov/ix?doc=/Archives/edgar/dat...\n", + " 4\n", + " 2020-10-05 00:00:00\n", + " 2020-10-05 18:32:48\n", + " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 2\n", - " 0001193125-20-133777\n", + " 0000320193-20-000082\n", " AAPL\n", " 320193\n", - " 424B2\n", - " 2020-05-05 00:00:00\n", - " 2020-05-05 16:31:51\n", + " 4\n", + " 2020-10-05 00:00:00\n", + " 2020-10-05 18:30:48\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 3\n", - " 0001193125-20-132661\n", + " 0000320193-20-000078\n", " AAPL\n", " 320193\n", - " FWP\n", - " 2020-05-05 00:00:00\n", - " 2020-05-04 19:01:03\n", + " 4\n", + " 2020-09-29 00:00:00\n", + " 2020-09-29 18:36:50\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 4\n", - " 0001193125-20-131780\n", + " 0000320193-20-000077\n", " AAPL\n", " 320193\n", - " 424B2\n", - " 2020-05-04 00:00:00\n", - " 2020-05-04 08:13:55\n", + " 4\n", + " 2020-09-29 00:00:00\n", + " 2020-09-29 18:35:51\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", @@ -1140,56 +1126,56 @@ " \n", " \n", " 245\n", - " 9999999997-14-000040\n", + " 0001193125-14-271698\n", " AAPL\n", " 320193\n", - " NO ACT\n", - " 2013-12-17 00:00:00\n", - " 2014-01-08 11:47:13\n", + " 8-K\n", + " 2014-07-17 00:00:00\n", + " 2014-07-17 16:39:12\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 246\n", - " 0001193125-13-486406\n", + " 0001193125-14-228798\n", " AAPL\n", " 320193\n", - " PRE 14A\n", - " 2013-12-27 00:00:00\n", - " 2013-12-27 17:01:57\n", + " 8-K\n", + " 2014-06-06 00:00:00\n", + " 2014-06-06 16:31:06\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 247\n", - " 0001181431-13-064578\n", + " 0001181431-14-022494\n", " AAPL\n", " 320193\n", " 4\n", - " 2013-12-26 00:00:00\n", - " 2013-12-26 18:32:35\n", + " 2014-06-03 00:00:00\n", + " 2014-06-03 18:31:07\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 248\n", - " 0000928464-13-000275\n", + " 0001181431-14-022493\n", " AAPL\n", " 320193\n", - " DFAN14A\n", - " 2013-12-04 00:00:00\n", - " 2013-12-04 15:37:31\n", + " 4\n", + " 2014-06-03 00:00:00\n", + " 2014-06-03 18:30:40\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", " \n", " 249\n", - " 0001193125-13-416534\n", + " 0001181431-14-021923\n", " AAPL\n", " 320193\n", - " 10-K\n", - " 2013-10-30 00:00:00\n", - " 2013-10-29 20:38:28\n", + " 8-K\n", + " 2014-05-30 00:00:00\n", + " 2014-05-30 17:23:51\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " https://www.sec.gov/Archives/edgar/data/320193...\n", " \n", @@ -1199,31 +1185,31 @@ "" ], "text/plain": [ - " accessNumber symbol cik form filedDate \\\n", - "0 0000320193-20-000056 AAPL 320193 4 2020-05-12 00:00:00 \n", - "1 0001193125-20-139112 AAPL 320193 8-K 2020-05-11 00:00:00 \n", - "2 0001193125-20-133777 AAPL 320193 424B2 2020-05-05 00:00:00 \n", - "3 0001193125-20-132661 AAPL 320193 FWP 2020-05-05 00:00:00 \n", - "4 0001193125-20-131780 AAPL 320193 424B2 2020-05-04 00:00:00 \n", - ".. ... ... ... ... ... \n", - "245 9999999997-14-000040 AAPL 320193 NO ACT 2013-12-17 00:00:00 \n", - "246 0001193125-13-486406 AAPL 320193 PRE 14A 2013-12-27 00:00:00 \n", - "247 0001181431-13-064578 AAPL 320193 4 2013-12-26 00:00:00 \n", - "248 0000928464-13-000275 AAPL 320193 DFAN14A 2013-12-04 00:00:00 \n", - "249 0001193125-13-416534 AAPL 320193 10-K 2013-10-30 00:00:00 \n", + " accessNumber symbol cik form filedDate \\\n", + "0 0000320193-20-000084 AAPL 320193 4 2020-10-05 00:00:00 \n", + "1 0000320193-20-000083 AAPL 320193 4 2020-10-05 00:00:00 \n", + "2 0000320193-20-000082 AAPL 320193 4 2020-10-05 00:00:00 \n", + "3 0000320193-20-000078 AAPL 320193 4 2020-09-29 00:00:00 \n", + "4 0000320193-20-000077 AAPL 320193 4 2020-09-29 00:00:00 \n", + ".. ... ... ... ... ... \n", + "245 0001193125-14-271698 AAPL 320193 8-K 2014-07-17 00:00:00 \n", + "246 0001193125-14-228798 AAPL 320193 8-K 2014-06-06 00:00:00 \n", + "247 0001181431-14-022494 AAPL 320193 4 2014-06-03 00:00:00 \n", + "248 0001181431-14-022493 AAPL 320193 4 2014-06-03 00:00:00 \n", + "249 0001181431-14-021923 AAPL 320193 8-K 2014-05-30 00:00:00 \n", "\n", " acceptedDate reportUrl \\\n", - "0 2020-05-12 18:30:32 https://www.sec.gov/Archives/edgar/data/320193... \n", - "1 2020-05-11 16:31:15 https://www.sec.gov/ix?doc=/Archives/edgar/dat... \n", - "2 2020-05-05 16:31:51 https://www.sec.gov/Archives/edgar/data/320193... \n", - "3 2020-05-04 19:01:03 https://www.sec.gov/Archives/edgar/data/320193... \n", - "4 2020-05-04 08:13:55 https://www.sec.gov/Archives/edgar/data/320193... \n", + "0 2020-10-05 18:33:56 https://www.sec.gov/Archives/edgar/data/320193... \n", + "1 2020-10-05 18:32:48 https://www.sec.gov/Archives/edgar/data/320193... \n", + "2 2020-10-05 18:30:48 https://www.sec.gov/Archives/edgar/data/320193... \n", + "3 2020-09-29 18:36:50 https://www.sec.gov/Archives/edgar/data/320193... \n", + "4 2020-09-29 18:35:51 https://www.sec.gov/Archives/edgar/data/320193... \n", ".. ... ... \n", - "245 2014-01-08 11:47:13 https://www.sec.gov/Archives/edgar/data/320193... \n", - "246 2013-12-27 17:01:57 https://www.sec.gov/Archives/edgar/data/320193... \n", - "247 2013-12-26 18:32:35 https://www.sec.gov/Archives/edgar/data/320193... \n", - "248 2013-12-04 15:37:31 https://www.sec.gov/Archives/edgar/data/320193... \n", - "249 2013-10-29 20:38:28 https://www.sec.gov/Archives/edgar/data/320193... \n", + "245 2014-07-17 16:39:12 https://www.sec.gov/Archives/edgar/data/320193... \n", + "246 2014-06-06 16:31:06 https://www.sec.gov/Archives/edgar/data/320193... \n", + "247 2014-06-03 18:31:07 https://www.sec.gov/Archives/edgar/data/320193... \n", + "248 2014-06-03 18:30:40 https://www.sec.gov/Archives/edgar/data/320193... \n", + "249 2014-05-30 17:23:51 https://www.sec.gov/Archives/edgar/data/320193... \n", "\n", " filingUrl \n", "0 https://www.sec.gov/Archives/edgar/data/320193... \n", @@ -1241,19 +1227,19 @@ "[250 rows x 8 columns]" ] }, - "execution_count": 7, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = dc.query('filings', symbol='AAPL')\n", + "df = await dc.query('filings', symbol='AAPL')\n", "df" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": { "scrolled": false }, @@ -1357,10 +1343,10 @@ " ...\n", " \n", " \n", - " 77\n", + " 74\n", " 2020-01-08\n", " None\n", - " ARDENT HEALTH PARTNERS, LLC\n", + " Ardent Health Partners, LLC\n", " NaN\n", " None\n", " withdrawn\n", @@ -1368,10 +1354,10 @@ " NaN\n", " \n", " \n", - " 78\n", + " 75\n", " 2020-01-06\n", " None\n", - " ARCUTIS BIOTHERAPEUTICS, INC.\n", + " Arcutis Biotherapeutics, Inc.\n", " NaN\n", " None\n", " filed\n", @@ -1379,10 +1365,10 @@ " 159375000.0\n", " \n", " \n", - " 79\n", + " 76\n", " 2020-01-03\n", " None\n", - " BLACK DIAMOND THERAPEUTICS, INC.\n", + " Black Diamond Therapeutics, Inc.\n", " NaN\n", " None\n", " filed\n", @@ -1390,10 +1376,10 @@ " 201140004.0\n", " \n", " \n", - " 80\n", + " 77\n", " 2020-01-03\n", " None\n", - " 1LIFE HEALTHCARE INC\n", + " 1life Healthcare Inc\n", " NaN\n", " None\n", " filed\n", @@ -1401,7 +1387,7 @@ " 245000000.0\n", " \n", " \n", - " 81\n", + " 78\n", " 2020-01-02\n", " None\n", " AVADIM HEALTH, INC.\n", @@ -1413,7 +1399,7 @@ " \n", " \n", "\n", - "

82 rows × 8 columns

\n", + "

79 rows × 8 columns

\n", "" ], "text/plain": [ @@ -1424,11 +1410,11 @@ "3 2020-04-24 None Father Time, Inc. \n", "4 2020-04-24 None SeqLL, Inc. \n", ".. ... ... ... \n", - "77 2020-01-08 None ARDENT HEALTH PARTNERS, LLC \n", - "78 2020-01-06 None ARCUTIS BIOTHERAPEUTICS, INC. \n", - "79 2020-01-03 None BLACK DIAMOND THERAPEUTICS, INC. \n", - "80 2020-01-03 None 1LIFE HEALTHCARE INC \n", - "81 2020-01-02 None AVADIM HEALTH, INC. \n", + "74 2020-01-08 None Ardent Health Partners, LLC \n", + "75 2020-01-06 None Arcutis Biotherapeutics, Inc. \n", + "76 2020-01-03 None Black Diamond Therapeutics, Inc. \n", + "77 2020-01-03 None 1life Healthcare Inc \n", + "78 2020-01-02 None AVADIM HEALTH, INC. \n", "\n", " numberOfShares price status symbol totalSharesValue \n", "0 NaN None withdrawn None NaN \n", @@ -1437,22 +1423,22 @@ "3 NaN None withdrawn None NaN \n", "4 NaN None withdrawn None NaN \n", ".. ... ... ... ... ... \n", - "77 NaN None withdrawn None NaN \n", - "78 NaN None filed ARQT 159375000.0 \n", - "79 NaN None filed BDTX 201140004.0 \n", - "80 NaN None filed ONEM 245000000.0 \n", - "81 NaN None filed AHI 92000000.0 \n", + "74 NaN None withdrawn None NaN \n", + "75 NaN None filed ARQT 159375000.0 \n", + "76 NaN None filed BDTX 201140004.0 \n", + "77 NaN None filed ONEM 245000000.0 \n", + "78 NaN None filed AHI 92000000.0 \n", "\n", - "[82 rows x 8 columns]" + "[79 rows x 8 columns]" ] }, - "execution_count": 8, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = dc.query('ipo_calender', from_='2020-01-01', to='2020-04-30')\n", + "df = await dc.query('ipo_calender', from_='2020-01-01', to='2020-04-30')\n", "df" ] }, @@ -1465,7 +1451,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": { "scrolled": false }, @@ -1505,7 +1491,7 @@ " 0\n", " 24\n", " 7\n", - " 2020-07-01\n", + " 2020-10-01\n", " 0\n", " 13\n", " 0\n", @@ -1515,24 +1501,54 @@ " 1\n", " 19\n", " 10\n", - " 2020-06-01\n", + " 2020-09-01\n", " 2\n", + " 13\n", + " 2\n", + " AAPL\n", + " \n", + " \n", + " 2\n", + " 20\n", + " 8\n", + " 2020-08-01\n", + " 2\n", + " 14\n", + " 0\n", + " AAPL\n", + " \n", + " \n", + " 3\n", + " 13\n", + " 19\n", + " 2020-07-01\n", + " 3\n", " 15\n", " 0\n", " AAPL\n", " \n", " \n", - " 2\n", - " 18\n", + " 4\n", " 13\n", + " 19\n", + " 2020-06-01\n", + " 3\n", + " 15\n", + " 0\n", + " AAPL\n", + " \n", + " \n", + " 5\n", + " 20\n", + " 8\n", " 2020-05-01\n", - " 2\n", + " 3\n", " 14\n", " 0\n", " AAPL\n", " \n", " \n", - " 3\n", + " 6\n", " 13\n", " 19\n", " 2020-04-01\n", @@ -1542,7 +1558,7 @@ " AAPL\n", " \n", " \n", - " 4\n", + " 7\n", " 13\n", " 19\n", " 2020-03-01\n", @@ -1552,7 +1568,7 @@ " AAPL\n", " \n", " \n", - " 5\n", + " 8\n", " 13\n", " 19\n", " 2020-02-01\n", @@ -1562,7 +1578,7 @@ " AAPL\n", " \n", " \n", - " 6\n", + " 9\n", " 13\n", " 19\n", " 2020-01-01\n", @@ -1572,7 +1588,7 @@ " AAPL\n", " \n", " \n", - " 7\n", + " 10\n", " 13\n", " 19\n", " 2019-12-01\n", @@ -1582,7 +1598,7 @@ " AAPL\n", " \n", " \n", - " 8\n", + " 11\n", " 13\n", " 19\n", " 2019-11-01\n", @@ -1592,7 +1608,7 @@ " AAPL\n", " \n", " \n", - " 9\n", + " 12\n", " 13\n", " 19\n", " 2019-10-01\n", @@ -1602,7 +1618,7 @@ " AAPL\n", " \n", " \n", - " 10\n", + " 13\n", " 13\n", " 19\n", " 2019-09-01\n", @@ -1612,7 +1628,7 @@ " AAPL\n", " \n", " \n", - " 11\n", + " 14\n", " 13\n", " 19\n", " 2019-08-01\n", @@ -1622,7 +1638,7 @@ " AAPL\n", " \n", " \n", - " 12\n", + " 15\n", " 13\n", " 19\n", " 2019-07-01\n", @@ -1632,7 +1648,7 @@ " AAPL\n", " \n", " \n", - " 13\n", + " 16\n", " 10\n", " 20\n", " 2019-06-01\n", @@ -1642,7 +1658,7 @@ " AAPL\n", " \n", " \n", - " 14\n", + " 17\n", " 10\n", " 22\n", " 2019-05-01\n", @@ -1652,7 +1668,7 @@ " AAPL\n", " \n", " \n", - " 15\n", + " 18\n", " 10\n", " 22\n", " 2019-04-01\n", @@ -1662,7 +1678,7 @@ " AAPL\n", " \n", " \n", - " 16\n", + " 19\n", " 10\n", " 22\n", " 2019-03-01\n", @@ -1672,7 +1688,7 @@ " AAPL\n", " \n", " \n", - " 17\n", + " 20\n", " 10\n", " 22\n", " 2019-02-01\n", @@ -1682,7 +1698,7 @@ " AAPL\n", " \n", " \n", - " 18\n", + " 21\n", " 14\n", " 18\n", " 2019-01-01\n", @@ -1697,40 +1713,43 @@ ], "text/plain": [ " buy hold period sell strongBuy strongSell symbol\n", - "0 24 7 2020-07-01 0 13 0 AAPL\n", - "1 19 10 2020-06-01 2 15 0 AAPL\n", - "2 18 13 2020-05-01 2 14 0 AAPL\n", - "3 13 19 2020-04-01 3 15 0 AAPL\n", - "4 13 19 2020-03-01 3 15 0 AAPL\n", - "5 13 19 2020-02-01 3 15 0 AAPL\n", - "6 13 19 2020-01-01 3 15 0 AAPL\n", - "7 13 19 2019-12-01 3 15 0 AAPL\n", - "8 13 19 2019-11-01 3 15 0 AAPL\n", - "9 13 19 2019-10-01 3 15 0 AAPL\n", - "10 13 19 2019-09-01 3 15 0 AAPL\n", - "11 13 19 2019-08-01 3 15 0 AAPL\n", - "12 13 19 2019-07-01 3 15 0 AAPL\n", - "13 10 20 2019-06-01 2 15 0 AAPL\n", - "14 10 22 2019-05-01 1 15 0 AAPL\n", - "15 10 22 2019-04-01 1 15 0 AAPL\n", - "16 10 22 2019-03-01 1 15 0 AAPL\n", - "17 10 22 2019-02-01 1 15 0 AAPL\n", - "18 14 18 2019-01-01 0 17 0 AAPL" + "0 24 7 2020-10-01 0 13 0 AAPL\n", + "1 19 10 2020-09-01 2 13 2 AAPL\n", + "2 20 8 2020-08-01 2 14 0 AAPL\n", + "3 13 19 2020-07-01 3 15 0 AAPL\n", + "4 13 19 2020-06-01 3 15 0 AAPL\n", + "5 20 8 2020-05-01 3 14 0 AAPL\n", + "6 13 19 2020-04-01 3 15 0 AAPL\n", + "7 13 19 2020-03-01 3 15 0 AAPL\n", + "8 13 19 2020-02-01 3 15 0 AAPL\n", + "9 13 19 2020-01-01 3 15 0 AAPL\n", + "10 13 19 2019-12-01 3 15 0 AAPL\n", + "11 13 19 2019-11-01 3 15 0 AAPL\n", + "12 13 19 2019-10-01 3 15 0 AAPL\n", + "13 13 19 2019-09-01 3 15 0 AAPL\n", + "14 13 19 2019-08-01 3 15 0 AAPL\n", + "15 13 19 2019-07-01 3 15 0 AAPL\n", + "16 10 20 2019-06-01 2 15 0 AAPL\n", + "17 10 22 2019-05-01 1 15 0 AAPL\n", + "18 10 22 2019-04-01 1 15 0 AAPL\n", + "19 10 22 2019-03-01 1 15 0 AAPL\n", + "20 10 22 2019-02-01 1 15 0 AAPL\n", + "21 14 18 2019-01-01 0 17 0 AAPL" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = dc.query('recommendations', symbol='AAPL')\n", + "df = await dc.query('recommendations', symbol='AAPL')\n", "df" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": { "scrolled": true }, @@ -1765,30 +1784,30 @@ " \n", " \n", " 0\n", - " 2.55\n", - " 2.3052\n", - " 2020-03-31\n", + " 0.64\n", + " 0.5202\n", + " 2020-06-30\n", " AAPL\n", " \n", " \n", " 1\n", - " 4.99\n", - " 4.6410\n", - " 2019-12-31\n", + " 0.64\n", + " 0.5712\n", + " 2020-03-31\n", " AAPL\n", " \n", " \n", " 2\n", - " 3.03\n", - " 2.8968\n", - " 2019-09-30\n", + " 1.25\n", + " 1.1628\n", + " 2019-12-31\n", " AAPL\n", " \n", " \n", " 3\n", - " 2.18\n", - " 2.1420\n", - " 2019-06-30\n", + " 0.76\n", + " 0.7242\n", + " 2019-09-30\n", " AAPL\n", " \n", " \n", @@ -1797,19 +1816,19 @@ ], "text/plain": [ " actual estimate period symbol\n", - "0 2.55 2.3052 2020-03-31 AAPL\n", - "1 4.99 4.6410 2019-12-31 AAPL\n", - "2 3.03 2.8968 2019-09-30 AAPL\n", - "3 2.18 2.1420 2019-06-30 AAPL" + "0 0.64 0.5202 2020-06-30 AAPL\n", + "1 0.64 0.5712 2020-03-31 AAPL\n", + "2 1.25 1.1628 2019-12-31 AAPL\n", + "3 0.76 0.7242 2019-09-30 AAPL" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "df = dc.query('earnings', symbol='AAPL')\n", + "df = await dc.query('earnings', symbol='AAPL')\n", "df" ] }, @@ -1854,61 +1873,61 @@ " \n", " 0\n", " 2020-03-13\n", - " -0.04\n", + " -0.030\n", " 0.000000\n", - " bmo\n", + " amc\n", " 4\n", " 0.000000e+00\n", - " 2.631100e+08\n", - " AGRO\n", + " 0.000000e+00\n", + " THCB\n", " 2019\n", " \n", " \n", " 1\n", " 2020-03-13\n", - " 0.00\n", + " 0.073\n", " 0.000000\n", - " bmo\n", + " amc\n", " 4\n", + " 5.216000e+06\n", " 0.000000e+00\n", - " 0.000000e+00\n", - " CBPO\n", + " PER\n", " 2019\n", " \n", " \n", " 2\n", " 2020-03-13\n", - " 0.00\n", + " -0.010\n", " 0.000000\n", " amc\n", - " 1\n", + " 4\n", " 0.000000e+00\n", " 0.000000e+00\n", - " CHN\n", - " 2020\n", + " GMHI\n", + " 2019\n", " \n", " \n", " 3\n", " 2020-03-13\n", - " 0.06\n", - " -0.040800\n", - " bmo\n", + " -0.270\n", + " 0.000000\n", + " amc\n", " 4\n", - " 6.077000e+06\n", - " 6.129000e+06\n", - " CREX\n", + " 1.110000e+05\n", + " 0.000000e+00\n", + " CDZI\n", " 2019\n", " \n", " \n", " 4\n", " 2020-03-13\n", - " 0.08\n", - " 0.092137\n", - " dmh\n", + " 0.230\n", + " 0.000000\n", + " amc\n", " 4\n", - " 3.431700e+07\n", - " 3.329900e+07\n", - " DLNG\n", + " 1.036000e+07\n", + " 0.000000e+00\n", + " PICO\n", " 2019\n", " \n", " \n", @@ -1924,98 +1943,98 @@ " ...\n", " \n", " \n", - " 234\n", + " 215\n", " 2020-03-12\n", - " 5.25\n", - " 5.436926\n", + " 5.250\n", + " 5.928546\n", " amc\n", " 1\n", " 5.858000e+09\n", - " 5.999317e+09\n", + " 6.090000e+09\n", " AVGO\n", " 2020\n", " \n", " \n", - " 235\n", + " 216\n", " 2020-03-12\n", - " -0.10\n", - " 0.035700\n", + " -0.100\n", + " 0.051000\n", " amc\n", " 4\n", " 2.161000e+07\n", - " 1.716725e+07\n", + " 1.742755e+07\n", " ASUR\n", " 2019\n", " \n", " \n", - " 236\n", + " 217\n", " 2020-03-12\n", - " 0.00\n", - " 0.173400\n", + " -0.040\n", + " 0.056355\n", " amc\n", " 4\n", - " 0.000000e+00\n", - " 2.631100e+08\n", + " 2.519910e+08\n", + " 2.670566e+08\n", " AGRO\n", " 2019\n", " \n", " \n", - " 237\n", + " 218\n", " 2020-03-12\n", - " -0.60\n", - " 0.143055\n", + " 0.090\n", + " 0.079815\n", " amc\n", " 4\n", " 6.097000e+07\n", - " 6.124400e+07\n", + " 6.215860e+07\n", " AGFS\n", " 2019\n", " \n", " \n", - " 238\n", + " 219\n", " 2020-03-12\n", - " 2.20\n", - " 2.271326\n", + " 2.270\n", + " 2.691739\n", " amc\n", " 1\n", " 3.091000e+09\n", - " 3.044629e+09\n", + " 3.095750e+09\n", " ADBE\n", " 2020\n", " \n", " \n", "\n", - "

239 rows × 9 columns

\n", + "

220 rows × 9 columns

\n", "" ], "text/plain": [ " date epsActual epsEstimate hour quarter revenueActual \\\n", - "0 2020-03-13 -0.04 0.000000 bmo 4 0.000000e+00 \n", - "1 2020-03-13 0.00 0.000000 bmo 4 0.000000e+00 \n", - "2 2020-03-13 0.00 0.000000 amc 1 0.000000e+00 \n", - "3 2020-03-13 0.06 -0.040800 bmo 4 6.077000e+06 \n", - "4 2020-03-13 0.08 0.092137 dmh 4 3.431700e+07 \n", + "0 2020-03-13 -0.030 0.000000 amc 4 0.000000e+00 \n", + "1 2020-03-13 0.073 0.000000 amc 4 5.216000e+06 \n", + "2 2020-03-13 -0.010 0.000000 amc 4 0.000000e+00 \n", + "3 2020-03-13 -0.270 0.000000 amc 4 1.110000e+05 \n", + "4 2020-03-13 0.230 0.000000 amc 4 1.036000e+07 \n", ".. ... ... ... ... ... ... \n", - "234 2020-03-12 5.25 5.436926 amc 1 5.858000e+09 \n", - "235 2020-03-12 -0.10 0.035700 amc 4 2.161000e+07 \n", - "236 2020-03-12 0.00 0.173400 amc 4 0.000000e+00 \n", - "237 2020-03-12 -0.60 0.143055 amc 4 6.097000e+07 \n", - "238 2020-03-12 2.20 2.271326 amc 1 3.091000e+09 \n", + "215 2020-03-12 5.250 5.928546 amc 1 5.858000e+09 \n", + "216 2020-03-12 -0.100 0.051000 amc 4 2.161000e+07 \n", + "217 2020-03-12 -0.040 0.056355 amc 4 2.519910e+08 \n", + "218 2020-03-12 0.090 0.079815 amc 4 6.097000e+07 \n", + "219 2020-03-12 2.270 2.691739 amc 1 3.091000e+09 \n", "\n", " revenueEstimate symbol year \n", - "0 2.631100e+08 AGRO 2019 \n", - "1 0.000000e+00 CBPO 2019 \n", - "2 0.000000e+00 CHN 2020 \n", - "3 6.129000e+06 CREX 2019 \n", - "4 3.329900e+07 DLNG 2019 \n", + "0 0.000000e+00 THCB 2019 \n", + "1 0.000000e+00 PER 2019 \n", + "2 0.000000e+00 GMHI 2019 \n", + "3 0.000000e+00 CDZI 2019 \n", + "4 0.000000e+00 PICO 2019 \n", ".. ... ... ... \n", - "234 5.999317e+09 AVGO 2020 \n", - "235 1.716725e+07 ASUR 2019 \n", - "236 2.631100e+08 AGRO 2019 \n", - "237 6.124400e+07 AGFS 2019 \n", - "238 3.044629e+09 ADBE 2020 \n", + "215 6.090000e+09 AVGO 2020 \n", + "216 1.742755e+07 ASUR 2019 \n", + "217 2.670566e+08 AGRO 2019 \n", + "218 6.215860e+07 AGFS 2019 \n", + "219 3.095750e+09 ADBE 2020 \n", "\n", - "[239 rows x 9 columns]" + "[220 rows x 9 columns]" ] }, "execution_count": 11, @@ -2024,7 +2043,7 @@ } ], "source": [ - "df = dc.query('earnings_calender', from_=\"2020-03-12\", to=\"2020-03-15\")\n", + "df = await dc.query('earnings_calender', from_=\"2020-03-12\", to=\"2020-03-15\")\n", "df" ] }, @@ -2087,75 +2106,103 @@ " \n", " \n", " 0\n", - " 233.6335\n", - " 1585008000\n", - " 251.396824\n", - " 1585008000\n", - " 246.804452\n", - " 1585526400\n", - " 264.567776\n", - " 1585526400\n", + " 118.830002\n", + " 1600128000\n", + " 103.099998\n", + " 1600646400\n", + " 117.629997\n", + " 1601510400\n", + " 112.220001\n", + " 1601596800\n", " NaN\n", " NaN\n", " ...\n", " bearish\n", - " 229.0000\n", - " 161.5\n", - " 1585526400\n", + " 98.516665\n", + " 0.000000\n", + " 1601596800\n", " NaN\n", " NaN\n", - " failed\n", - " 264.6000\n", + " complete\n", + " 118.948832\n", " AAPL.US\n", " 0.0\n", " \n", " \n", " 1\n", - " 326.2085\n", - " 1580256000\n", - " 300.657900\n", - " 1580688000\n", - " 326.336700\n", - " 1581465600\n", + " 103.099998\n", + " 1600646400\n", + " 112.860001\n", + " 1600732800\n", + " 105.000000\n", + " 1600905600\n", " 0.000000\n", " 0\n", - " 300.6579\n", - " 1.582502e+09\n", + " 112.860001\n", + " 1.601251e+09\n", " ...\n", - " bearish\n", - " 274.9791\n", + " bullish\n", + " 122.620003\n", + " 0.000000\n", + " 1601251200\n", + " 112.860001\n", + " 1.600214e+09\n", + " complete\n", + " 102.123998\n", + " AAPL.US\n", " 0.0\n", - " 1582502400\n", - " 300.6579\n", - " 1.578442e+09\n", - " successful\n", - " 328.9046\n", + " \n", + " \n", + " 2\n", + " 99.250000\n", + " 1595289600\n", + " 91.341139\n", + " 1595289600\n", + " 95.581434\n", + " 1595894400\n", + " 87.672573\n", + " 1595894400\n", + " NaN\n", + " NaN\n", + " ...\n", + " bullish\n", + " 103.490295\n", + " 132.491434\n", + " 1595894400\n", + " NaN\n", + " NaN\n", + " success\n", + " 87.672573\n", " AAPL.US\n", " 0.0\n", " \n", " \n", "\n", - "

2 rows × 25 columns

\n", + "

3 rows × 25 columns

\n", "" ], "text/plain": [ - " aprice atime bprice btime cprice ctime \\\n", - "0 233.6335 1585008000 251.396824 1585008000 246.804452 1585526400 \n", - "1 326.2085 1580256000 300.657900 1580688000 326.336700 1581465600 \n", + " aprice atime bprice btime cprice ctime \\\n", + "0 118.830002 1600128000 103.099998 1600646400 117.629997 1601510400 \n", + "1 103.099998 1600646400 112.860001 1600732800 105.000000 1600905600 \n", + "2 99.250000 1595289600 91.341139 1595289600 95.581434 1595894400 \n", "\n", - " dprice dtime end_price end_time ... patterntype \\\n", - "0 264.567776 1585526400 NaN NaN ... bearish \n", - "1 0.000000 0 300.6579 1.582502e+09 ... bearish \n", + " dprice dtime end_price end_time ... patterntype \\\n", + "0 112.220001 1601596800 NaN NaN ... bearish \n", + "1 0.000000 0 112.860001 1.601251e+09 ... bullish \n", + "2 87.672573 1595894400 NaN NaN ... bullish \n", "\n", - " profit1 profit2 sortTime start_price start_time status \\\n", - "0 229.0000 161.5 1585526400 NaN NaN failed \n", - "1 274.9791 0.0 1582502400 300.6579 1.578442e+09 successful \n", + " profit1 profit2 sortTime start_price start_time status \\\n", + "0 98.516665 0.000000 1601596800 NaN NaN complete \n", + "1 122.620003 0.000000 1601251200 112.860001 1.600214e+09 complete \n", + "2 103.490295 132.491434 1595894400 NaN NaN success \n", "\n", - " stoploss symbol terminal \n", - "0 264.6000 AAPL.US 0.0 \n", - "1 328.9046 AAPL.US 0.0 \n", + " stoploss symbol terminal \n", + "0 118.948832 AAPL.US 0.0 \n", + "1 102.123998 AAPL.US 0.0 \n", + "2 87.672573 AAPL.US 0.0 \n", "\n", - "[2 rows x 25 columns]" + "[3 rows x 25 columns]" ] }, "execution_count": 12, @@ -2164,7 +2211,7 @@ } ], "source": [ - "df = dc.query('patterns', symbol='AAPL', resolution='D')\n", + "df = await dc.query('patterns', symbol='AAPL', resolution='D')\n", "df" ] }, @@ -2213,37 +2260,37 @@ " \n", " 0\n", " New York\n", - " 413315\n", - " 32520\n", - " 2020-07-21 18:01:06\n", + " 471235\n", + " 33214\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 1\n", " New Jersey\n", - " 177256\n", - " 15826\n", - " 2020-07-21 18:01:06\n", + " 208775\n", + " 16257\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 2\n", " California\n", - " 401148\n", - " 7788\n", - " 2020-07-21 18:01:06\n", + " 835976\n", + " 16187\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 3\n", " Michigan\n", - " 83059\n", - " 6382\n", - " 2020-07-21 18:01:06\n", + " 142726\n", + " 7142\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 4\n", " Florida\n", - " 369834\n", - " 5206\n", - " 2020-07-21 18:01:06\n", + " 720130\n", + " 14781\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " ...\n", @@ -2257,35 +2304,35 @@ " Wuhan Evacuee\n", " 4\n", " 0\n", - " 2020-07-21 18:01:06\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 58\n", " Northern Mariana Islands\n", " 31\n", " 2\n", - " 2020-07-21 18:01:06\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 59\n", " US Military\n", - " 31418\n", - " 48\n", - " 2020-07-21 18:01:06\n", + " 68515\n", + " 98\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 60\n", " Federal Bureau of Prisons\n", - " 10811\n", - " 99\n", - " 2020-07-21 18:01:06\n", + " 17141\n", + " 127\n", + " 2020-10-07 00:01:27\n", " \n", " \n", " 61\n", " Veteran Affair\n", - " 33295\n", - " 1927\n", - " 2020-07-21 18:01:06\n", + " 62571\n", + " 3466\n", + " 2020-10-07 00:01:27\n", " \n", " \n", "\n", @@ -2294,17 +2341,17 @@ ], "text/plain": [ " state case death updated\n", - "0 New York 413315 32520 2020-07-21 18:01:06\n", - "1 New Jersey 177256 15826 2020-07-21 18:01:06\n", - "2 California 401148 7788 2020-07-21 18:01:06\n", - "3 Michigan 83059 6382 2020-07-21 18:01:06\n", - "4 Florida 369834 5206 2020-07-21 18:01:06\n", + "0 New York 471235 33214 2020-10-07 00:01:27\n", + "1 New Jersey 208775 16257 2020-10-07 00:01:27\n", + "2 California 835976 16187 2020-10-07 00:01:27\n", + "3 Michigan 142726 7142 2020-10-07 00:01:27\n", + "4 Florida 720130 14781 2020-10-07 00:01:27\n", ".. ... ... ... ...\n", - "57 Wuhan Evacuee 4 0 2020-07-21 18:01:06\n", - "58 Northern Mariana Islands 31 2 2020-07-21 18:01:06\n", - "59 US Military 31418 48 2020-07-21 18:01:06\n", - "60 Federal Bureau of Prisons 10811 99 2020-07-21 18:01:06\n", - "61 Veteran Affair 33295 1927 2020-07-21 18:01:06\n", + "57 Wuhan Evacuee 4 0 2020-10-07 00:01:27\n", + "58 Northern Mariana Islands 31 2 2020-10-07 00:01:27\n", + "59 US Military 68515 98 2020-10-07 00:01:27\n", + "60 Federal Bureau of Prisons 17141 127 2020-10-07 00:01:27\n", + "61 Veteran Affair 62571 3466 2020-10-07 00:01:27\n", "\n", "[62 rows x 4 columns]" ] @@ -2315,7 +2362,7 @@ } ], "source": [ - "df = dc.query('covid19')\n", + "df = await dc.query('covid19')\n", "df" ] }, @@ -2501,7 +2548,7 @@ } ], "source": [ - "df = dc.query('countries')\n", + "df = await dc.query('countries')\n", "df" ] }, @@ -2544,58 +2591,58 @@ " \n", " \n", " 0\n", - " 2.4\n", - " GB\n", + " 49.30\n", + " JP\n", " NaN\n", - " United Kingdom-Rightmove House Prices-House Pr...\n", + " Japan-Economy Watchers-Economy Watchers Poll SA*\n", " low\n", - " -0.200\n", - " 2020-07-19 23:01:00\n", - " %\n", + " 43.90\n", + " 2020-10-08 05:00:00\n", + " Index (diffusion)\n", " \n", " \n", " 1\n", - " 3.7\n", - " GB\n", - " NaN\n", - " United Kingdom-Rightmove House Prices-House Pr...\n", + " 3.30\n", + " CH\n", + " 3.4\n", + " Switzerland-Jobless-Unemployment Rate Adj\n", " low\n", - " 2.100\n", - " 2020-07-19 23:01:00\n", + " 3.40\n", + " 2020-10-08 05:45:00\n", " %\n", " \n", " \n", " 2\n", - " -26.2\n", - " JP\n", - " -24.9\n", - " Japan-Trade-Exports YY\n", + " 3.20\n", + " CH\n", + " 3.3\n", + " Switzerland-Jobless-Unemployment Rate Unadj\n", " low\n", - " -28.300\n", - " 2020-07-19 23:50:00\n", + " 3.30\n", + " 2020-10-08 05:45:00\n", " %\n", " \n", " \n", " 3\n", - " -14.4\n", - " JP\n", - " -16.8\n", - " Japan-Trade-Imports YY\n", + " 9.01\n", + " GB\n", + " NaN\n", + " United Kingdom-Comprehensive Risk-Overall Comp...\n", " low\n", - " -26.200\n", - " 2020-07-19 23:50:00\n", - " %\n", + " 9.01\n", + " 2020-10-08 09:00:00\n", + " Indicator\n", " \n", " \n", " 4\n", - " -268.8\n", - " JP\n", - " -35.8\n", - " Japan-Trade-Trade Balance Total Yen\n", + " NaN\n", + " GB\n", + " NaN\n", + " United Kingdom-Labor Mkt-Labour Productivity*\n", " low\n", - " -838.200\n", - " 2020-07-19 23:50:00\n", - " JPY\n", + " -0.60\n", + " 2020-10-08 09:00:00\n", + " %\n", " \n", " \n", " ...\n", @@ -2609,106 +2656,106 @@ " ...\n", " \n", " \n", - " 180\n", + " 274\n", " NaN\n", " US\n", " NaN\n", - " United States-API OIL STOCKS-API weekly crude ...\n", + " United States-Business inventories-Retail Inve...\n", " low\n", - " 7.544\n", - " 2020-07-28 20:30:00\n", - " Number of\n", + " 0.60\n", + " 2020-10-16 14:00:00\n", + " %\n", " \n", " \n", - " 181\n", + " 275\n", " NaN\n", " US\n", " NaN\n", - " United States-API OIL STOCKS-API weekly dist. ...\n", + " United States-Net flows-Foreign Buying, T-Bonds\n", " low\n", - " -1.357\n", - " 2020-07-28 20:30:00\n", - " Number of\n", + " -22.80\n", + " 2020-10-16 20:00:00\n", + " USD\n", " \n", " \n", - " 182\n", + " 276\n", " NaN\n", " US\n", " NaN\n", - " United States-API OIL STOCKS-API weekly gasoli...\n", + " United States-Net flows-Net L-T Flows,Exswaps\n", " low\n", - " -2.019\n", - " 2020-07-28 20:30:00\n", - " Number of\n", + " 10.80\n", + " 2020-10-16 20:00:00\n", + " USD\n", " \n", " \n", - " 183\n", + " 277\n", " NaN\n", " US\n", " NaN\n", - " United States-API OIL STOCKS-API weekly heatin...\n", + " United States-Net flows-Net L-T Flows,Incl.Swaps\n", " low\n", - " 0.112\n", - " 2020-07-28 20:30:00\n", - " Number of\n", + " -29.00\n", + " 2020-10-16 20:00:00\n", + " USD\n", " \n", " \n", - " 184\n", + " 278\n", " NaN\n", " US\n", " NaN\n", - " United States-API OIL STOCKS-API weekly produc...\n", + " United States-Net flows-Overall Net Capital Flows\n", " low\n", - " 0.167\n", - " 2020-07-28 20:30:00\n", - " Number of\n", + " -88.70\n", + " 2020-10-16 20:00:00\n", + " USD\n", " \n", " \n", "\n", - "

185 rows × 8 columns

\n", + "

279 rows × 8 columns

\n", "" ], "text/plain": [ " actual country estimate \\\n", - "0 2.4 GB NaN \n", - "1 3.7 GB NaN \n", - "2 -26.2 JP -24.9 \n", - "3 -14.4 JP -16.8 \n", - "4 -268.8 JP -35.8 \n", + "0 49.30 JP NaN \n", + "1 3.30 CH 3.4 \n", + "2 3.20 CH 3.3 \n", + "3 9.01 GB NaN \n", + "4 NaN GB NaN \n", ".. ... ... ... \n", - "180 NaN US NaN \n", - "181 NaN US NaN \n", - "182 NaN US NaN \n", - "183 NaN US NaN \n", - "184 NaN US NaN \n", + "274 NaN US NaN \n", + "275 NaN US NaN \n", + "276 NaN US NaN \n", + "277 NaN US NaN \n", + "278 NaN US NaN \n", "\n", - " event impact prev \\\n", - "0 United Kingdom-Rightmove House Prices-House Pr... low -0.200 \n", - "1 United Kingdom-Rightmove House Prices-House Pr... low 2.100 \n", - "2 Japan-Trade-Exports YY low -28.300 \n", - "3 Japan-Trade-Imports YY low -26.200 \n", - "4 Japan-Trade-Trade Balance Total Yen low -838.200 \n", - ".. ... ... ... \n", - "180 United States-API OIL STOCKS-API weekly crude ... low 7.544 \n", - "181 United States-API OIL STOCKS-API weekly dist. ... low -1.357 \n", - "182 United States-API OIL STOCKS-API weekly gasoli... low -2.019 \n", - "183 United States-API OIL STOCKS-API weekly heatin... low 0.112 \n", - "184 United States-API OIL STOCKS-API weekly produc... low 0.167 \n", + " event impact prev \\\n", + "0 Japan-Economy Watchers-Economy Watchers Poll SA* low 43.90 \n", + "1 Switzerland-Jobless-Unemployment Rate Adj low 3.40 \n", + "2 Switzerland-Jobless-Unemployment Rate Unadj low 3.30 \n", + "3 United Kingdom-Comprehensive Risk-Overall Comp... low 9.01 \n", + "4 United Kingdom-Labor Mkt-Labour Productivity* low -0.60 \n", + ".. ... ... ... \n", + "274 United States-Business inventories-Retail Inve... low 0.60 \n", + "275 United States-Net flows-Foreign Buying, T-Bonds low -22.80 \n", + "276 United States-Net flows-Net L-T Flows,Exswaps low 10.80 \n", + "277 United States-Net flows-Net L-T Flows,Incl.Swaps low -29.00 \n", + "278 United States-Net flows-Overall Net Capital Flows low -88.70 \n", "\n", - " time unit \n", - "0 2020-07-19 23:01:00 % \n", - "1 2020-07-19 23:01:00 % \n", - "2 2020-07-19 23:50:00 % \n", - "3 2020-07-19 23:50:00 % \n", - "4 2020-07-19 23:50:00 JPY \n", - ".. ... ... \n", - "180 2020-07-28 20:30:00 Number of \n", - "181 2020-07-28 20:30:00 Number of \n", - "182 2020-07-28 20:30:00 Number of \n", - "183 2020-07-28 20:30:00 Number of \n", - "184 2020-07-28 20:30:00 Number of \n", + " time unit \n", + "0 2020-10-08 05:00:00 Index (diffusion) \n", + "1 2020-10-08 05:45:00 % \n", + "2 2020-10-08 05:45:00 % \n", + "3 2020-10-08 09:00:00 Indicator \n", + "4 2020-10-08 09:00:00 % \n", + ".. ... ... \n", + "274 2020-10-16 14:00:00 % \n", + "275 2020-10-16 20:00:00 USD \n", + "276 2020-10-16 20:00:00 USD \n", + "277 2020-10-16 20:00:00 USD \n", + "278 2020-10-16 20:00:00 USD \n", "\n", - "[185 rows x 8 columns]" + "[279 rows x 8 columns]" ] }, "execution_count": 15, @@ -2717,7 +2764,7 @@ } ], "source": [ - "df = dc.query('economic_calender')\n", + "df = await dc.query('economic_calender')\n", "df" ] },