Skip to main content

This package offers editor tools helping users write Steam guides and reviews. Support Steam information queries, image editing tools, and BBCode text processing tools.

Project description

Steam Editor Tools: Help You Write Guides and Reviews

Banner

GitHub release (latest SemVer) GitHub all releases GitHub PyPI - Downloads

GitHub Actions (Build) GitHub Actions (Release)

This package offers editor tools helping users write Steam guides and reviews.

This package supports:

  • Steam information queries
  • Image editing tools
  • BBCode text processing tools

Users can write their documents with Markdown, use this package to process the images in the document, and convert the document to the Steam BBCode format.

1. Install

Intall the latest released version of this package by using the PyPI source:

python -m pip install steam-editor-tools

2. Usage

The following minimal example shows a simple customization, where we convert a Markdown file into Steam BBCode, and print each header during the conversion.

import os
import steam_editor_tools as stet


class CustomizedRenderer(stet.BBCodeRenderer):
    def render_heading(self, node: stet.bbcode.nodes.HeadingNode) -> str:
        print(self.render_children(node.children))
        super().render_heading(node)
        return super().render_heading(node)


def convert(file_path: str) -> None:
    out_file_path = os.path.splitext(file_path)[0].strip() + ".bbcode"
    doc = stet.DocumentParser().parse_file(file_path)
    with open(out_file_path, "w", encoding="utf-8") as fobj:
        fobj.write(CustomizedRenderer().render(doc))


convert("example.md")

Currently, we support the following features:

2.1. Steam information query

Functionality Description
Search app by name Given the partial name of an app (game), search for its information, including the ID. Support fuzzy searching.
Get app details by ID Given the app ID, fetch the full details, including the name, description, price, about page, and other information.
Download images Use methods such as get_header_image() to get the header image, background image, and official screenshots on the store page.

2.2. Image editing tools

Functionality Description
Image stack A code-based image editor, allowing users to stack multiple layers of images, texts, or LaTeX equations with styles.
Image anchor Inspired by LaTeX's TikZ package, this package allows users to place images on the same canvas by using their relative positions.
Image optimization Users only need to specify the quality and the saving format. The package can choose the best way to optimize the saved image size.
Image modifications Basic image modification tools such as image resizing, cropping and blurring.
Thumbnail Provide an option to create Steam-compatible thumbnails. This feature is useful when users need to upload screenshots by themselves.
Batch processing Walk through a folder, apply a customized image processing function to each image, and save the results with thumbnails in another folder.

Actually, the title banner of this Readme file is created by the image editing tools. See the examples.

[!NOTE] You need to have a locally installed LaTeX released version like TeXLive to use the equation features.

2.3. BBCode text processing tools

Functionality Description
Structured data All conversions are divided into two steps: Other formats -> Document stucture -> Steam BBCode. The intermediate Document strcture is supported by pydantic.
HTML to BBCode Recursively parse an HTML file, and convert it into Document or Steam BBCode.
Markdown to BBCode Use markdown-it to convert a Markdown file to HTML, then convert the HTML to Document or BBCode.
Fetch a Steam guide Given the URL of a Steam guide, convert it into Document or BBcode.

3. Why using this package

  1. Compared to other BBCode conversion packages such as html2bbcode and html2phpbbcode, our package strictly follows the current Steam BBCode format. Different forums may have different BBCode standards.
  2. Compared to ihroteka-converter, we fully support every format provided by Steam. Unlike that regular-expression-based conversion, the BBCode reconstruction in this package is based on a recursive analysis of the HTML structure. Therefore, our package will not omit any text as long as it appears in the original document.
  3. We offer flexibility of customization. Users can inject any rendering step of this package by simply overriding the methods of steam_editor_tools.bbcode.BBCodeRenderer. For example, we can customize a BBCodeRenderer to create a title image for each header.
  4. We offer convenient approaches for integrating the store page information into the output data. For example, users can easily convert a store page to BBCode if needed.

4. Examples

Currently, we offer the following examples in ./examples folder:

Example Description
markdown_to_bbcode A minimal example converting Markdown to BBCode.
save_description_of_a_game Save the "about the game" section of a Steam app as an HTML file.
download_screenshots Download all official screenshots of a game and create thumbnails of them.
download_a_guide Fetch a Steam guide and save it as a BBCode file.
create_a_title_figure Customize a figure-based title. Such title images can be inserted into the Steam guide.
create_logo Render the title bar of this readme file.

The following two guides are written with the help of this tool. Check them for viewing the details:

Guide Link
此后,勇者学会了后验概率 :link:
《海猫鸣泣之时·出题篇》解(伪) :link:

5. Documentation

[!CAUTION] This documentation is a work in progress. It should be ready when the package is tested to be stable.

Check the documentation to find more details about the examples and APIs.

https://cainmagi.github.io/steam-editor-tools/

6. Contributing

See CONTRIBUTING.md :book:

7. Changelog

See Changelog.md :book:

8. Future plan

  • HTML/Markdown to BBCode
  • Multi-layer image synthesis
  • Query Steam app ID by name
  • Get Steam app details by ID
  • Screenshot formatting
  • System/User font file detection
  • Image overlay with alpha channel
  • Image layer properties
  • Improved image anchor interfaces
  • More Steam queries based on public APIs

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

steam_editor_tools-0.1.0.tar.gz (383.8 kB view details)

Uploaded Source

Built Distribution

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

steam_editor_tools-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file steam_editor_tools-0.1.0.tar.gz.

File metadata

  • Download URL: steam_editor_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 383.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for steam_editor_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 196fb9b23366a2488cf704a18e44a7c5f1a79725cf012601447aa76c2ef091d1
MD5 3bcf6a60697b23899d5115c3aaa567a4
BLAKE2b-256 6d906d3c6434a1d5b704fd1502004e02eeff7a074b6b43eaf70060f84d4b3a69

See more details on using hashes here.

Provenance

The following attestation bundles were made for steam_editor_tools-0.1.0.tar.gz:

Publisher: python-publish.yml on cainmagi/steam-editor-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file steam_editor_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for steam_editor_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbe830742319853e643c73dcecac70ea45bedb8e0eeecf782c3c1f4e7c117c20
MD5 b4f27416428427a9b28de70f0d0a36d8
BLAKE2b-256 b83e59ee8c375fb111dacc04f769e1e557d1abac0d9ee865cd2ba9d4fc48a680

See more details on using hashes here.

Provenance

The following attestation bundles were made for steam_editor_tools-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on cainmagi/steam-editor-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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