Metadata-Version: 2.4
Name: Historic-Crypto-Modern
Version: 1.0.1
Summary: An open source Python library for scraping Historical Cryptocurrency data from CoinBase Pro API. (Maintained fork of Historic-Crypto)
Author-email: David Woroniuk <david.j.woroniuk@durham.ac.uk>
Maintainer-email: Amir Hariri <a.r.hariri2000@gmail.com>
License: MIT License
        
        Copyright (c) 2020 David Woroniuk
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/A-R-Hariri/Historic_Crypto_Modern
Project-URL: Upstream, https://github.com/David-Woroniuk/Historic_Crypto
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0
Requires-Dist: requests>=2.25
Dynamic: license-file

This is a maintained fork of Historic-Crypto by David Woroniuk (https://github.com/David-Woroniuk/Historic_Crypto).

# Historic Crypto

An open source Python library for the collection of Historical Cryptocurrency data.

This library interacts with the [CoinBase Pro][website] API to:
- List the Cyptocurrency Pairs available through the API.
- Return Live Data from the API
- Return historical data from the API in a Pandas DataFrame.
 

The HistoricalData class returns all attributes (Open, Close, High, Low, Volume) of the selected Cryptocurrency, whilst the Cryptocurrencies class returns all Cryptocurrencies available through the API, with a 'coin_search' parameter if the user wishes to check if that Coin ID is available.

# Installation

Install: 
```bash
pip install Historic-Crypto-Modern
```
Backward compatible imports supported:
```python
from Historic_Crypto import HistoricalData
from Historic_Crypto import Cryptocurrencies
from Historic_Crypto import LiveCryptoData
```

# Usage
## Cryptocurrencies 

If you are unsure of the correct 'ticker' to search for:
```python
from Historic_Crypto import Cryptocurrencies

Cryptocurrencies().find_crypto_pairs()
```
Returns a Pandas DataFrame containing the columns "id" and "display_name" and "status", with the "id" column indicating the search term which should be queried by the other classes within the package. 

Additionally, a number of optional arguments can be added:

| Argument | Description |
| ------ | --------- |
| coin_search | search for a specific cryptocurrency string (str) **Default = None**. |
| extended_output | displays either a condensed or extended output (Bool) **Default = False**.|
| verbose | prints status messages (Bool) **Default = True**. |

```python
from Historic_Crypto import Cryptocurrencies

data = Cryptocurrencies(coin_search = 'XLM', extended_output=False).find_crypto_pairs()
```

## HistoricalData

Once you know the ticker which you would like to search for, you can search for it using the HistoricalData class. 
```python
from Historic_Crypto import HistoricalData

new = HistoricalData('ETH-USD', 300, '2025-06-01-00-00', '2025-06-02-00-00').retrieve_data()
new = HistoricalData('ETH-USD', '1d', '2025-06-01-00-00', '2025-06-30-00-00').retrieve_data()
```
The arguments for the class are listed below:
| Argument | Description |
| ------ | --------- |
| ticker | supply the ticker information which you want to return (str). |
| granularity | please supply a granularity in seconds (60, 300, 900, 3600, 21600, 86400) (int) or ('1m', '5m', '15m', '1h', '6h', '1d') (str). |
| start_date | a string in the format YYYY-MM-DD-HH-MM (str).  |
| end_date | a string in the format YYYY-MM-DD-HH-MM (str). **Optional, Default: Now** |
| verbose | printing during extraction. **Default: True** |


## LiveCryptoData

If you want to see the current Bid/Ask of a specific Cryptocurrency:

```python
from Historic_Crypto import LiveCryptoData

new =  LiveCryptoData('ATOM-USD').return_data()
```

Returns a Pandas DataFrame 'data', which contains the trade_id, price, size, bid, ask and volume of the previous transaction, indexed by timestamp.

The arguments for the class are listed below:

| Argument | Description |
| ------ | --------- |
| ticker | information for which the user would like to return (str). |
| verbose | print progress during extraction (bool). **Default:True** |


   [website]: <https://pro.coinbase.com/>
