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
Built Distribution
File details
Details for the file fear-and-greed-0.4.tar.gz
.
File metadata
- Download URL: fear-and-greed-0.4.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d997f049180442ca4bc33518e9d3b5b8fd140151de81826e78743eceb373ea1c
|
|
MD5 |
a67abf3bffb7ae7e122c934559290650
|
|
BLAKE2b-256 |
757e5e2da52822046c0c42ac2a71bf33e7a3ebdcdb48987757a825a2db4644ed
|
File details
Details for the file fear_and_greed-0.4-py3-none-any.whl
.
File metadata
- Download URL: fear_and_greed-0.4-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
f15fbd3ce89762c15d8649b56e43acaa16424c9c5013efa896d61a3d7f863386
|
|
MD5 |
d70b6cfb94537cf28c199aed0cbf8749
|
|
BLAKE2b-256 |
4abecbcdc55b93bb7207a63015ad21a5fd7697f7010657c9d2aab8d70310c740
|