Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Update README files
Browse files Browse the repository at this point in the history
  • Loading branch information
avhn committed Jan 27, 2019
1 parent 84a348c commit 5201cba
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 115 deletions.
114 changes: 75 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,108 @@
# Coindata
[![PyPI version](https://badge.fury.io/py/coindata.svg)/](https://badge.fury.io/py/coindata)
[![Build Status](https://travis-ci.org/anaxilaus/coindata.svg?branch=master)](https://travis-ci.org/anaxilaus/coindata)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/anaxilaus/coindata/blob/master/LICENSE)
[![PyPI version](https://badge.fury.io/py/coindata.svg)](https://badge.fury.io/py/coindata)
[![Python version](https://img.shields.io/badge/Python-3.5|3.6|3.7-blue.svg)](https://github.com/Anaxilaus/coindata/blob/master/.travis.yml)
[![Build Status](https://travis-ci.org/Anaxilaus/coindata.svg?branch=master)](https://travis-ci.org/Anaxilaus/coindata)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Anaxilaus/coindata/blob/master/LICENSE)

Parse any crypto's historical data from CoinMarketCap, `write .csv files` or handle as you wish.
Do not waste time.
Take one snapshot, use all data as cached.

`Compatible with Python 2 & 3.`
Use it for machine learning, vector prediction or for whatever you like. Be my guest.

### Install
### How this works?
You take one snapshot, and access hundreds of cryptos without slowing down.

Install with pip:
```
pip install coindata
```
Install remotely:
Basically, this program parses all historical data, stores/caches at CSV files through running a snapshot.
When you access through this package, requesting a data vector, calculates what coinmarketcap doesn't give you,
like circulation supply, daily percentage change, datetime object etc. and returns the vector.



If you want, you can use .csv files seperately.
#### File structure
```
python setup.py install
|source-code:
|coindata:
|snapshots:
|CSV files
|tickers:
|JSON files
```

### Install

### Obtain data instantly.
Install with pip or clone, both works.

![](https://media.giphy.com/media/bqU3p01XL126bmEatX/giphy.gif)
```
$ pip install coindata
---- or ----
$ git clone git@github.com:anaxilaus/coindata
$ python coindata/setup.py install
```
Requirements are just beautifulsoup4 and requests. Setup installs them itself.

### Write .csv file
### Modules
There are 3 modules you will use:
```
snapshot
parser
request
```

![](https://thumbs.gfycat.com/QuestionableConstantGander-size_restricted.gif)
##### Update cache with `snapshot`

`Specify write path with file_path=None parameter.`
Note: It will ask for a snapshot at initial import, and show you the progress, write out the cache path.
```
>>> coindata.snapshot.take()
```

### Get documentation with help(* func). You can use:
##### Get data with `parser`
```
>>> coindata.parser.vector_of('btc')
[
. . .
[ 'Date': string,
'Open*': float,
'High': float,
'Low': float,
'Close**': float,
'Volume': float,
'Market Cap': float,
# additional info below #
'date': datetime.object,
'circulation': decimal,
'change': float ]
. . .
]
```
##### Get specific with `request`
You don't need to use if you don't want to get specific. API related operations. ( write, read, retrieve without writing, get ticker etc. )

Note: I recommend caching with snapshot.
```
* retrieve
* write
* read
* interval
* retrieve_raw
* get_global_data
* get_ticker
* get_id
# write all history of one $indicator to $where as CSV file
>>> coindata.request.write($indicator, $where)
```

### Notes
`+ Use either symbol or name of crypto. Both works.`
#### Get documentation for more with built-in help() or read the code.

### Important Notes
`+ Symbol, name and case doesn't matter.`
```
# these give same outputs
>>> coindata.retrieve('ltc')
>>> coindata.retrieve('LTC')
>>> coindata.retrieve('litecoin')
>>> coindata.retrieve('LITECOIN')
btc = BTC = bitcoin = BITCOIN
```

`+ Based on USD.`

`+ Date notation is ISO8601.`
`+ Date notation is ISO8601 in CSV files.`

```
>>> coindata.ISO8601
"%Y-%m-%d"
```

##### Support
Tweet, or donate anytime you feel this helped you.

[![Twitter](https://img.shields.io/twitter/url/https/github.com/anaxilaus/coindata.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20this%20out:&url=https%3A%2F%2Fgithub.com%2Fanaxilaus%2Fcoindata)
#### Give this a star this if you feel this helped you. Contributions are always welcomed.
##### Also, if you want to buy a beer:
```
BTC: 16XwDdxUaphSX4yWDTTiSfNy2dTyEZ5MLy
ETH: 0x35F4B63f7eBBB2E6080F7f9f797A068004faf323
Expand Down
166 changes: 90 additions & 76 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,126 +1,140 @@
Coindata
========
|PyPI|
|Python|
|Build Status|
|License|

Parse any crypto's historical data from CoinMarketCap, write .csv files or handle as you wish. Do not waste time.
Take one snapshot, use all data as cached.

Compatible with Python 2 & 3.
Use it for machine learning, vector prediction or for whatever you like. Be my guest.

Install
-------
How this works?
---------------
You take one snapshot, and access hundreds of cryptos without slowing down.

Install with pip:
Basically, this program parses all historical data, stores/caches at CSV files through running a snapshot.
When you access through this package, requesting a data vector, calculates what coinmarketcap doesn't give you,
like circulation supply, daily percentage change, datetime object etc. and returns the vector.

.. code:: bash
If you want, you can use .csv files seperately.

File structure:
---------------

::

pip install coindata
source-code:
coindata:
snapshots:
CSV files
tickers:
JSON files

Install remotely:

Install
-------

Install with pip or clone, both works.

.. code:: bash
python setup.py install
$ pip install coindata
---- or ----
$ git clone git@github.com:anaxilaus/coindata
$ python coindata/setup.py install
Usage
-----
Modules
-------

Retrieve
^^^^^^^^
There are 3 modules you will use:

Obtain data instantly?:
::

.. code:: python
snapshot
parser
request

>>> import coindata
>>> coindata.retrieve('LTC')
Update cache with ``snapshot``
------------------------------

Done!
``Note:`` It will ask for a snapshot at initial import, and show you the progress, write out the cache path.

.. code:: python
[
>>> coindata.snapshot.take()
{'Date': '2018-07-07', 'Open*': 83.40, 'High': 86.20, 'Low': 80.70, 'Close**': 86.20, 'Volume': 238937000, 'Market Cap': 4778260000},
.
.
.
{'Date': '2013-04-28', 'Open*': 4.30, 'High': 4.40, 'Low': 4.18, 'Close**': 4.35, 'Volume': '-', 'Market Cap': 73773400}
Get data with ``parser``
------------------------

]
.. code:: python
Write .csv file
^^^^^^^^^^^^^^^
>>> coindata.parser.vector_of('btc')
[
. . .
[ 'Date': string,
'Open*': float,
'High': float,
'Low': float,
'Close**': float,
'Volume': float,
'Market Cap': float,
# additional info below #
'date': datetime.object,
'circulation': decimal,
'change': float ]
. . .
]
Get specific with ``request``
-----------------------------

You don't need to use if you don't want to get specific. API related operations. ( write, read, retrieve without writing, get ticker etc. )

``Note:`` I recommend caching with snapshot.

.. code:: python
coindata.write('LTC', 'FILE_PATH.csv')
# write all history of one $indicator to $where as CSV file
>>> coindata.request.write($indicator, $where)
+------------+--------+-------+-------+----------+-----------+------------+
| Date | Open* | High | Low | Close** | Volume | Market Cap |
+============+========+=======+=======+==========+===========+============+
| 2018-07-07 | 83.40 | 86.20 | 80.70 | 86.20 | 238937000 | 4778260000 |
+------------+--------+-------+-------+----------+-----------+------------+
| 2018-07-06 | 83.84 | 84.60 | 81.32 | 83.38 | 253160000 | 4801850000 |
+------------+--------+-------+-------+----------+-----------+------------+
| ... | ... | ... | ... | ... | ... | ... |
+------------+--------+-------+-------+----------+-----------+------------+
| ... | ... | ... | ... | ... | ... | ... |
+------------+--------+-------+-------+----------+-----------+------------+
Get documentation with help(* func). You can use:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::
Get documentation for more with built-in help() or read the code.

* retrieve
* write
* read
* interval
* retrieve_raw
* get_global_data
* get_ticker
* get_id
Important Notes
---------------

Notes
^^^^^
``+ Use either symbol or name of crypto. Both works.``
``+ Symbol, name and case doesn't matter.``

.. code:: python
::

# these give same outputs
>>> coindata.retrieve('ltc')
>>> coindata.retrieve('LTC')
>>> coindata.retrieve('litecoin')
>>> coindata.retrieve('LITECOIN')
btc = BTC = bitcoin = BITCOIN

``+ Based on USD.``

``+ Date notation is ISO8601.``

``+ Date notation is ISO8601 in CSV files.``
.. code:: python
>>> coindata.ISO8601
"%Y-%m-%d"
>>> coindata.ISO8601
"%Y-%m-%d"
Support
^^^^^^^
Tweet, or donate anytime you feel this helped you.
|Tweet|
Give this a star this if you feel this helped you.

- BTC: 16XwDdxUaphSX4yWDTTiSfNy2dTyEZ5MLy
- ETH: 0x35F4B63f7eBBB2E6080F7f9f797A068004faf323
- LTC: LdukNLZqzeEvvFYMw98L9Rj8AYvP86BhEe
Also, if you want to buy a beer:

::

BTC: 16XwDdxUaphSX4yWDTTiSfNy2dTyEZ5MLy
ETH: 0x35F4B63f7eBBB2E6080F7f9f797A068004faf323
LTC: LdukNLZqzeEvvFYMw98L9Rj8AYvP86BhEe


.. |PyPI| image:: https://badge.fury.io/py/coindata.svg
:target: https://badge.fury.io/py/coindata
.. |Build Status| image:: https://travis-ci.org/anaxilaus/coindata.svg?branch=master
:target: https://travis-ci.org/anaxilaus/coindata
.. |Build Status| image:: https://travis-ci.org/Anaxilaus/coindata.svg?branch=master
:target: https://travis-ci.org/Anaxilaus/coindata
.. |License| image:: https://img.shields.io/badge/license-MIT-green.svg
:target: https://github.com/anaxilaus/coindata/blob/master/LICENSE
.. |Tweet| image:: https://img.shields.io/twitter/url/https/github.com/anaxilaus/coindata.svg?style=social
:target: https://twitter.com/intent/tweet?text=Check%20this%20out:&url=https%3A%2F%2Fgithub.com%2Fanaxilaus%2Fcoindata
:target: https://github.com/Anaxilaus/coindata/blob/master/LICENSE
.. |Python| image:: https://img.shields.io/badge/Python-3.5|3.6|3.7-blue.svg
:target: https://github.com/Anaxilaus/coindata/blob/master/.travis.yml

0 comments on commit 5201cba

Please sign in to comment.