Skip to content

Simple Python code that helps to retreive predictit market data.

Notifications You must be signed in to change notification settings

tuttlepower/predictit_markets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

predictit_markets

Simple Python code that helps to retrieve predictit market data.

data

Given a number, returns a Pandas dataframe of the market data. It attempts to grab the last 90 days, but can be changed to 24h,7d, or 30d as well. Constructor defaults to '90d', but can take the other dates as an argument.

df = data(6598)

print(df.head())

alt text

market_name

print(market_name(6598))

Returns the name of the market as a string.

Which party will win Washington in the 2020 presidential election?

That's all there is to it. Predictit's API is in XML format, which I thought was a pain, and they have download buttons for every market. I found this and it helped me understand the urls that are used to download the market CSV's so I recreated it for Python. I didn't see anything else like this posted, and I figured it may help someone else down the line. Was considering putting this as a package, but it doesn't seem like it would be worth it.

About

Simple Python code that helps to retreive predictit market data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages