Skip to main content

A package for interacting with PredictIt markets

Project description

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.

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

predictit_markets-0.1.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

predictit_markets-0.1.1-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page