Skip to content

Python wrapper for CNN's Fear & Greed Index.

License

Notifications You must be signed in to change notification settings

amalysh/fear-and-greed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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=58,
    description='Greed',
    last_update=datetime.datetime(2020, 3, 18, 14, 11, tzinfo=<DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD>)),
 )

Requests to CNN's website are locally cached for 1m.

About

Python wrapper for CNN's Fear & Greed Index.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.5%
  • Makefile 8.5%