Skip to main content

A Python wrapper for SteamCharts

Project description

SteamCharts

This module makes it possible to get the player count of a game on Steam using the Steamcharts website. It uses aiohttp, BeautifulSoup and http modules.

Installation

pip install SteamPlayerCharts

Example

import asyncio
import SteamCharts

async def main():
	steamgameID = "4000"
	player_count = await SteamCharts.playercount(steamgameID)
	print(player_count)
	try:
		current_players = player_count['Current Players']
		day_peak = player_count['Peak Players 24h']
		all_time_peak = player_count['Peak Players All Time']
	except:
		error_code = player_count['error']['code']
		error_message = player_count['error']['message']

asyncio.run(main())

The playercount function returns a Python dict containing the current player counts, as well as the peak values for the last 24 hours and all time.

If the query fails, an error dict is returned that contains the HTTP error code and message.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SteamPlayerCharts-0.2-py3-none-any.whl (1.5 kB view details)

Uploaded Python 3

File details

Details for the file SteamPlayerCharts-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for SteamPlayerCharts-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 200e23c9df80ba5216a1fbacdf47f1f33bb9148b094d15616ea2374deecccc02
MD5 d637c6b7daf5b58e16657be40f4b5bd4
BLAKE2b-256 4032959808976fb06e964da461c8d8457bb4dcf77bee3c02dd46b36073508ba4

See more details on using hashes here.

Supported by

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