Compare commits

..

2 Commits
0.70 ... master

Author SHA1 Message Date
Pawel Kierski
6e483edd92 Update README: GOG GALAXY 2.1, Python 3.13 2026-01-28 15:10:58 +01:00
Pawel Kierski
8a39496a11 Add missing pyproject.toml file 2025-09-18 16:10:57 +02:00
4 changed files with 87 additions and 28 deletions

View File

@@ -1,17 +1,19 @@
# GOG Galaxy Integrations Python API
# GOG GALAXY Integrations Python API
This Python library allows developers to easily build community integrations for various gaming platforms with GOG Galaxy 2.0.
This Python library allows developers to easily build community integrations for various gaming platforms with GOG GALAXY **2.1**.
- refer to our <a href='https://galaxy-integrations-python-api.readthedocs.io'>documentation</a>
Note: For integrations targeting GOG GALAXY the **below 2.1.0 version**, please refer to [this version](https://github.com/gogcom/galaxy-integrations-python-api/tree/0.69).
## Features
Each integration in GOG Galaxy 2.0 comes as a separate Python script and is launched as a separate process that needs to communicate with the main instance of GOG Galaxy 2.0.
Each integration in GOG GALAXY 2.1 comes as a separate Python script and is launched as a separate process that needs to communicate with the main instance of GOG GALAXY 2.1.
The provided features are:
- multistep authorization using a browser built into GOG Galaxy 2.0
- support for GOG Galaxy 2.0 features:
- multistep authorization using a browser built into GOG GALAXY 2.1
- support for GOG GALAXY 2.1 features:
- importing owned and detecting installed games
- installing and launching games
- importing achievements and game time
@@ -28,9 +30,11 @@ Each integration can implement only one platform. Each integration must declare
## Basic usage
Each integration should inherit from the :class:`~galaxy.api.plugin.Plugin` class. Supported methods like :meth:`~galaxy.api.plugin.Plugin.get_owned_games` should be overwritten - they are called from the GOG Galaxy client at the appropriate times.
Each of those methods can raise exceptions inherited from the :exc:`~galaxy.api.jsonrpc.ApplicationError`.
Communication between an integration and the client is also possible with the use of notifications, for example: :meth:`~galaxy.api.plugin.Plugin.update_local_game_status`.
Each integration should inherit from the `galaxy.api.plugin.Plugin` class. Supported methods like `galaxy.api.plugin.Plugin.get_owned_games` should be overwritten - they are called from the GOG GALAXY client at the appropriate times.
Each of those methods can raise exceptions inherited from the `galaxy.api.jsonrpc.ApplicationError`.
Communication between an integration and the client is also possible with the use of notifications, for example: `galaxy.api.plugin.Plugin.update_local_game_status`.
The minimum implementation requires to override `galaxy.api.plugin.Plugin.authenticate` and `galaxy.api.plugin.Plugin.get_owned_games` methods.
```python
import sys
@@ -73,7 +77,7 @@ if __name__ == "__main__":
## Deployment
The client has a built-in Python 3.13 interpreter, so integrations are delivered as Python modules.
In order to be found by GOG Galaxy 2.0 an integration folder should be placed in [lookup directory](#deploy-location). Beside all the Python files, the integration folder must contain [manifest.json](#deploy-manifest) and all third-party dependencies. See an [exemplary structure](#deploy-structure-example).
In order to be found by GOG GALAXY 2.1 an integration folder should be placed in [lookup directory](#deploy-location). Beside all the Python files, the integration folder must contain [manifest.json](#deploy-manifest) and all third-party dependencies. See an [exemplary structure](#deploy-structure-example).
### Lookup directory
@@ -88,7 +92,7 @@ In order to be found by GOG Galaxy 2.0 an integration folder should be placed in
`~/Library/Application Support/GOG.com/Galaxy/plugins/installed`
### Logging
<a href='https://docs.python.org/3.13/howto/logging.html'>Root logger</a> is already setup by GOG Galaxy to store rotated log files in:
<a href='https://docs.python.org/3.13/howto/logging.html'>Root logger</a> is already setup by GOG GALAXY to store rotated log files in:
- Windows:
@@ -149,4 +153,4 @@ installed
## Legal Notice
By integrating or attempting to integrate any applications or content with or into GOG Galaxy 2.0 you represent that such application or content is your original creation (other than any software made available by GOG) and/or that you have all necessary rights to grant such applicable rights to the relevant community integration to GOG and to GOG Galaxy 2.0 end users for the purpose of use of such community integration and that such community integration comply with any third party license and other requirements including compliance with applicable laws.
By integrating or attempting to integrate any applications or content with or into GOG GALAXY 2.1 you represent that such application or content is your original creation (other than any software made available by GOG) and/or that you have all necessary rights to grant such applicable rights to the relevant community integration to GOG and to GOG GALAXY 2.1 end users for the purpose of use of such community integration and that such community integration comply with any third party license and other requirements including compliance with applicable laws.

69
pyproject.toml Normal file
View File

@@ -0,0 +1,69 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "galaxy.plugin.api"
version = "0.71"
description = "GOG Galaxy Integrations Python API"
authors = [
{name = "Galaxy team", email = "galaxy@gog.com"}
]
readme = "README.md"
license-files = ["LICENSE"]
requires-python = "~=3.13.0"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"aiohttp>=3.12.15",
"certifi>=2026.1.4",
"psutil>=5.6.6; sys_platform == 'darwin'"
]
[project.optional-dependencies]
dev = [
"pytest==8.4.1",
"pytest-asyncio==1.1.0",
"pytest-mock==3.14.1",
"pytest-mypy==1.0.1",
"pytest-flakes==4.0.5",
"types-certifi==2021.10.8.3",
"setuptools==80.9.0",
]
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"--verbose",
]
[tool.mypy]
python_version = "3.13"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true

View File

@@ -2,6 +2,6 @@
# Copied from setup.py because of a pip bug
# see https://github.com/pypa/pip/issues/4780
aiohttp==3.12.15
certifi==2025.8.3
certifi==2026.1.4
psutil==5.6.6; sys_platform == 'darwin'
# End of copy from setup.py

View File

@@ -1,17 +1,3 @@
from setuptools import setup, find_packages
from setuptools import setup
setup(
name="galaxy.plugin.api",
version="0.70",
description="GOG Galaxy Integrations Python API",
author='Galaxy team',
author_email='galaxy@gog.com',
packages=find_packages("src"),
package_dir={'': 'src'},
python_requires="~=3.13.0", # This package working with Python 3.13.x embedded in GOG Galaxy 2.0
install_requires=[
"aiohttp>=3.12.15",
"certifi>=2025.8.3",
"psutil>=5.6.6; sys_platform == 'darwin'"
]
)
setup()