Skip to main content

Interact with the REST-API of itch.io

Project description

itchio-lib

Since I didn't find one, I made it on my own.

Purpose

Use the REST-API of itch.io in python in a simple way

How does it work?

When you want to use the lib, you first need to create a Session object, in which you have to pass your API-key. It could look something like this:

import itchio

session = itchio.Session(key)

If you want to access your games, you can just now create an GameCollection object with your session.

gameCollection = itchio.GameCollection(session)

After that you can get a game by its id or you can just get all of your games.

all_my_games = gameCollection.all()

The all_my_games variable is now a list containing Game objects. You can now easily access the information of a game.

my_game = all_my_games[0]

print(my_game.views_count)
35

Examples

import itchio

session = itchio.Session("1234")
#                        ^
#                        This is your API-key

userCollection = itchio.UserCollection(session)

me = userCollection.me()

print(me.username)
Tch1b0

Installation

You can install this library via pip

$ pip install itchio

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

itchio-0.1.1.tar.gz (4.0 kB view hashes)

Uploaded Source

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