Python wrapper for CNN Fear & Greed Index.
Project description
Python wrapper for CNN's Fear & Greed Index.
Fetches CNN's website, parses the index value and returns the data as a three-element tuple.
Installation
pip install fear-and-greed
Usage example
import fear_and_greed
fear_and_greed.get()
Returns a three-element namedtuple with (a) the current value of the Fear & Greed Index, (b) a description of the category into which the index value falls (from "Extreme Fear" to "Extreme Greed") and (c) the timestamp at which the index value was last updated on CNN's website. Example:
FearGreedIndex(
value=31.4266,
description='fear',
last_update=datetime.datetime(2022, 4, 25, 16, 51, 9, 254000, tzinfo=datetime.timezone.utc)),
)
Requests to CNN's website are locally cached for 1m.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fear-and-greed-0.4.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for fear_and_greed-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15fbd3ce89762c15d8649b56e43acaa16424c9c5013efa896d61a3d7f863386 |
|
MD5 | d70b6cfb94537cf28c199aed0cbf8749 |
|
BLAKE2b-256 | 4abecbcdc55b93bb7207a63015ad21a5fd7697f7010657c9d2aab8d70310c740 |