A package of getting game reviews from steam platform easily, for further text analytics projects.
Project description
Steam Reviews
A package of getting game reviews from steam easily, for further text analytics projects.
Install
The package is available in PyPi.
pip install steam_reviews
Use
Basic usage
For example, we load the reviews of Cyberpunk 2077 from the api.
The function load_from_api
takes two arguments.
- First is necessary, the appid. It can be find in the web page of the game in steam store. Like Cyberpunk 2077's page: https://store.steampowered.com/app/1091500/_2077/, the number 1091500 in the url is its appid.
- Second can be ignored, if you want to take all the reviews, it controls the number of reviews that the program will take from the web api.
from steam_reviews import ReviewLoader
# AppId is 1091500, and we need 1000 reviews
reviews = ReviewLoader().load_from_api(1091500, 1000)
# Save the review text to a list
review_list = reviews.review_list()
print(review_list[0])
# Save the data as json file, provide the folder path as the argument
reviews.save_json('path/to/data/')
With more parameters
You can add more parameters to get customized reviews. More information can be found in the functions' documents in the source code.
set_language()
is used most frequently, it sets the language of the reviews that downloaded by the program.
All supported language can be found here: https://partner.steamgames.com/doc/store/localization.
from steam_reviews import ReviewLoader
# Set the language of reviews to english
reviews_en = ReviewLoader().set_language('english') \
.load_from_api(1091500, 1000)
# Set the language of reviews to simplified chinese
reviews_zh = ReviewLoader().set_language('schinese') \
.load_from_api(1091500, 1000)
Load reviews of several games
The funciton load_batch_from_api()
can receive a list containing appids
and request all the reviews for each of the game.
from steam_reviews import ReviewLoader
appids = [1091500, 1097150]
reviews = ReviewLoader().set_language('english') \
.set_num_per_page(50) \
.load_batch_from_api(appids, 1000)
Load from local json files
from steam_reviews import ReviewLoader
# File path of the saved json data
file_path = 'path/to/data/reviews_1091500.json'
reviews = ReviewLoader().load_from_local(file_path)
Project details
Release history Release notifications | RSS feed
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
Hashes for steam_reviews-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a438bd8848eb6899c390ebaf5d36d9a38e6d2b19055ab8407ddeebb99098f8f |
|
MD5 | 361457454eac83f4cc1296fe29d940d7 |
|
BLAKE2b-256 | 3ea69d8bafd55f4da9cbd8033110bd8045b1f571e928d5264db3db1fee11fcb0 |