@@ -778,6 +778,104 @@ result
778
778
779
779
</details >
780
780
781
+ #### [ CoinGecko] ( ./coingecko ) -- Collect Cryptocurrency Data
782
+
783
+ <details >
784
+ <summary >What are the 10 cryptocurrencies with highest market cap and their current information?</summary >
785
+
786
+ ``` python
787
+ from dataprep.connector import connect
788
+
789
+ conn_coingecko = connect(" coingecko" )
790
+ df = await conn_coingecko.query(' markets' , vs_currency = ' usd' , order = ' market_cap_desc' , per_page = 10 , page = 1 )
791
+ df
792
+ ```
793
+ | | name | symbol | current_price | market_cap | market_cap_rank | high_24h | low_24h | price_change_24h | price_change_percentage_24h | market_cap_change_24h | market_cap_change_percentage_24h | last_updated |
794
+ | ---:| :-------------| :---------| ----------------:| -------------:| ------------------:| -------------:| -------------:| -------------------:| ------------------------------:| ------------------------:| -----------------------------------:| :-------------------------|
795
+ | 0 | Bitcoin | btc | 36811 | 6.86613e+11 | 1 | 37153 | 35344 | 1440.68 | 4.0731 | 3.10933e+10 | 4.7433 | 2021-02-03T19:24:09.271Z |
796
+ | 1 | Ethereum | eth | 1628.99 | 1.87035e+11 | 2 | 1645.73 | 1486.42 | 132.91 | 8.88404 | 1.64296e+10 | 9.63018 | 2021-02-03T19:22:32.413Z |
797
+ | .. | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
798
+ | 9 | Binance Coin | bnb | 51.47 | 7.60256e+09 | 10 | 51.63 | 49.76 | 1.24 | 2.47631 | 1.64863e+08 | 2.21659 | 2021-02-03T19:25:45.456Z |
799
+ </details >
800
+
801
+ <details >
802
+ <summary >What are the cryptocurrencies with highest increasing and decreasing percentage?</summary >
803
+
804
+ ``` python
805
+ from dataprep.connector import connect
806
+
807
+ conn_coingecko = connect(" coingecko" )
808
+ df = await conn_coingecko.query(' markets' , vs_currency = ' usd' , per_page = 1000 , page = 1 )
809
+ df = df.sort_values(by = [' price_change_percentage_24h' ]).reset_index(drop = True ).dropna()
810
+ print (" Coin with highest decreasing percetage: {} , which decreases {} %" .format(df[' name' ].iloc[0 ], df[' price_change_percentage_24h' ].iloc[0 ]))
811
+ print (" Coin with highest increasing percetage: {} , which increases {} %" .format(df[' name' ].iloc[- 1 ], df[' price_change_percentage_24h' ].iloc[- 1 ]))
812
+ ```
813
+ Coin with the highest decreasing percentage: ` PancakeSwap ` , which decreases ` -13.79622% `
814
+
815
+ Coin with the highest increasing percentage: ` StormX ` , which increases ` 101.24182% `
816
+ </details >
817
+
818
+ <details >
819
+ <summary >Which cryptocurrencies are trending in CoinGecko?</summary >
820
+
821
+ ``` python
822
+ from dataprep.connector import connect
823
+
824
+ conn_coingecko = connect(" coingecko" )
825
+ df = await conn_coingecko.query(' trend' )
826
+ df
827
+ ```
828
+ | | id | name | symbol | market_cap_rank | score |
829
+ | ---:| :------------------| :------------| :---------| ------------------:| --------:|
830
+ | 0 | bao-finance | Bao Finance | BAO | 175 | 0 |
831
+ | 1 | milk2 | MILK2 | MILK2 | 634 | 1 |
832
+ | 2 | unitrade | Unitrade | TRADE | 529 | 2 |
833
+ | 3 | pancakeswap-token | PancakeSwap | CAKE | 110 | 3 |
834
+ | 4 | fsw-token | Falconswap | FSW | 564 | 4 |
835
+ | 5 | zeroswap | ZeroSwap | ZEE | 550 | 5 |
836
+ | 6 | storm | StormX | STMX | 211 | 6 |
837
+
838
+ </details >
839
+
840
+ <details >
841
+ <summary >What are the 10 US exchanges with highest trade volume in the past 24 hours?</summary >
842
+
843
+ ``` python
844
+ from dataprep.connector import connect
845
+
846
+ conn_coingecko = connect(" coingecko" )
847
+ df = await conn_coingecko.query(' exchanges' )
848
+ result = df[df[' country' ]== ' United States' ].reset_index(drop = True ).head(10 )
849
+ result
850
+ ```
851
+ | | id | name | year_established | ... | trade_volume_24h_btc_normalized |
852
+ | ---:| :-----------| :-------------| -------------------:| :----| ----------------------------------:|
853
+ | 0 | gdax | Coinbase Pro | 2012 | ... | 90085.6 |
854
+ | 1 | kraken | Kraken | 2011 | ... | 48633.1 |
855
+ | 2 | binance_us | Binance US | 2019 | ... | 7380.83 |
856
+ | .. | ... | ... | ... | ... | ... |
857
+
858
+ </details >
859
+
860
+ <details >
861
+ <summary >What are the 3 latest traded derivatives with perpetual contract?</summary >
862
+
863
+ ``` python
864
+ from dataprep.connector import connect
865
+ import pandas as pd
866
+
867
+ conn_coingecko = connect(" coingecko" )
868
+ df = await conn_coingecko.query(' derivatives' )
869
+ perpetual_df = df[df[' contract_type' ] == ' perpetual' ].reset_index(drop = True )
870
+ perpetual_df[' last_traded_at' ] = pd.to_datetime(perpetual_df[' last_traded_at' ], unit = ' s' )
871
+ perpetual_df.sort_values(by = [' last_traded_at' ], ascending = False ).head(3 ).reset_index(drop = True )
872
+ ```
873
+ | | market | symbol | index_id | contract_type | index | basis | funding_rate | open_interest | volume_24h | last_traded_at |
874
+ | ---:| :---------------| :-----------| :-----------| :----------------| --------------:| ----------:| ---------------:| ----------------:| -----------------:| :--------------------|
875
+ | 0 | Huobi Futures | MATIC-USDT | MATIC | perpetual | 0.0433357 | -0.606296 | 0.247604 | nan | 1.43338e+06 | 2021-02-03 20:14:24 |
876
+ | 1 | Biki (Futures) | 1 | BTC | perpetual | 36769.8 | -0.153111 | -0.0519 | nan | 1.00131e+08 | 2021-02-03 20:14:23 |
877
+ | 2 | Huobi Futures | CVC-USDT | CVC | perpetual | 0.178268 | -0.336302 | 0.106314 | nan | 876960 | 2021-02-03 20:14:23 |
878
+ </details >
781
879
782
880
### Geocoding
783
881
@@ -2276,6 +2374,58 @@ ranking_df
2276
2374
| 5 | Kim Kardashian | 0 |
2277
2375
</details >
2278
2376
2377
+ #### [ Currents] ( ./currents ) -- Collect Currents News Data
2378
+ <details >
2379
+ <summary >How to get latest Chinese news?</summary >
2380
+
2381
+ ``` python
2382
+ from dataprep.connector import connect
2383
+
2384
+ # You can get ”currents_access_token“ by following https://currentsapi.services/zh_CN
2385
+ conn_currents = connect(' currents' , _auth = {' access_token' : currents_access_token})
2386
+ df = await conn_currents.query(' latest_news' , language = ' zh' )
2387
+ df.head()
2388
+ ```
2389
+ | id | title | category | ... | author | published |
2390
+ | ---:| :-----------------| :-------------| :----| :--------| :--------------------------|
2391
+ | 0 | 為何上市公司該汰換了 | [ entrepreneur] | ... | 經濟日報 | 2021-02-03 08:48:39 +0000 |
2392
+ </details >
2393
+
2394
+ <details >
2395
+ <summary >How to get the political news about 'Trump'?</summary >
2396
+
2397
+ ``` python
2398
+ from dataprep.connector import connect
2399
+
2400
+ # You can get ”currents_access_token“ by following https://currentsapi.services/zh_CN
2401
+ conn_currents = connect(' currents' , _auth = {' access_token' : currents_access_token})
2402
+ df = await conn_currents.query(' search' , keywords = ' Trump' , category = ' politics' )
2403
+ df.head(3 )
2404
+ ```
2405
+ | | title | category | description | url | author | published |
2406
+ | ---:| :-------------------------------------------------------------------------------------------------------------| :----------------------| :-------------------------------------------------------------------------------------------------------------------------------| :------------------------------------------------------------------------------------------------------------------| :--------------| :--------------------------|
2407
+ | 0 | Biden Started The Process Of Unwinding Trump's Assault On Immigration, But Activists Want Him To Move Faster | [ 'politics', 'world'] | "These people cannot continue to wait." | https://www.buzzfeednews.com/article/adolfoflores/biden-immigration-executive-orders-review | Adolfo Flores | 2021-02-03 08:39:51 +0000 |
2408
+ | 1 | Pro-Trump lawyer Lin Wood reportedly under investigation for voter fraud | [ 'politics', 'world'] | A source told CBS Atlanta affiliate WGCL that Lin Wood is being investigated for allegedly voting "out of state." | https://www.cbsnews.com/news/pro-trump-lawyer-lin-wood-under-investigation-for-alleged-illegal-voting-2020-02-03/ | April Siese | 2021-02-03 08:21:25 +0000 |
2409
+ | 2 | Trump Supporters Say They Attacked The Capitol Because He Told Them To, Undercutting His Impeachment Defense | [ 'politics', 'world'] | “President Trump told Us to ‘fight like hell,’” one Trump supporter reportedly posted online after the assault on the Capitol. | https://www.buzzfeednews.com/article/zoetillman/trump-impeachment-capitol-rioters-fight-like-hell | Zoe Tillman | 2021-02-03 07:25:34 +0000 |
2410
+ </details >
2411
+
2412
+ <details >
2413
+ <summary >How to get the news about COVID-19 from 2020-12-25?</summary >
2414
+
2415
+ ``` python
2416
+ from dataprep.connector import connect
2417
+
2418
+ # You can get ”currents_access_token“ by following https://currentsapi.services/zh_CN
2419
+ conn_currents = connect(' currents' , _auth = {' access_token' : currents_access_token})
2420
+ df = await conn_currents.query(' search' , keywords = ' covid' , start_date = ' 2020-12-25' ,end_date = ' 2020-12-25' )
2421
+ df.head(1 )
2422
+ ```
2423
+
2424
+ | | title | category | ... | published |
2425
+ | ---:| :--------------------------------------------------------------------| :------------| :----| :--------------------------|
2426
+ | 0 | Commentary: Let our charitable giving equal our political donations | [ 'opinion'] | ... | 2020-12-25 00:00:00 +0000 |
2427
+ </details >
2428
+
2279
2429
2280
2430
### Science
2281
2431
0 commit comments