Skip to main content

pyspray

CLI interface to streamline the process of making TF2 sprays.

Installation

In order to use pyspray, you must have python installed on your system.

pyspray can be installed via pip with py -m pip install pyspray or python -m pip install pyspray via the command line, depending on your platform. For simplicity, all commands will be given using py (which is the default alias on some Windows systems).

Usage And CLI Help

pyspray should be run as a module using py -m pyspray <args>. In order to see a list of available commands, run py -m pyspray --help.

To get further information about any of these commands, run py -m pyspray <command_name> --help.

Commands and Basic Usage Examples

Before creating any sprays, pyspray needs to know where your Team Fortress 2 directory is. These files can be found by right clicking on Team Fortress 2 in your Steam games menu, mousing over the Manage tab, and then clicking Browse Local Files.

Once you have the file path of the Team Fortress 2 directory, run py -m pyspray set-directory <file_path>. IMPORTANT: Windows has some issues with filepaths with spaces in them! It is important to enclose <file_path> with double quotes.

Good:

py -m pyspray set-directory "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2"

WILL NOT WORK:

py -m pyspray set-directory C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2

Static Sprays

A static spray is simply a single image. To create one, run py -m pyspray static <filepath_or_url_of_image> --name <name_of_spray>. The name can be omitted, but the autogenerated names are simply the timestamps of creation, and are easy to mix up.

Faded Sprays

A faded spray is a spray that changes as you move closer or further away from it. To create a faded spray, run py -m pyspray fade <url_or_filepath_of_image> <url_or_filepath_of_image>... --name <name_of_spray>. The images should be listed such that the first image is the one you want shown from furthest away, and the last image is the one you want shown from nearest.

Animated Sprays

An animated spray is a spray that moves, and can be made from filetypes like gifs, webms, and mp4s. To create an animated spray, run py -m pyspray anim <path_or_url_to_animated_file> --name <name_of_spray>. Note that this works best with short animations, as sprays have a filesize limit of 512 KB.

Spray previews:

With animated sprays in particular, it is sometimes difficult to tell what options to use to make a spray with sufficient resolution that loops well. To make this easier, the --dry and --show flags can be used to preview a spray without the trouble of testing it out in game. The --dry flag prevents any spray files from being written to your tf2 directory, and the --show flag shows a preview of the spray. These options can be used for all types of sprays.

Metadata

Release files for pyspray 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyspray 0.0.12
File Size Uploaded
pyspray-0.0.12.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyspray 0.0.12
File Interpreter ABI Platform
pyspray-0.0.12-py3-none-any.whl Python 3 none any Details

Total release size: 32.9 kB

Release files / pyspray-0.0.12.tar.gz

Download URL pyspray-0.0.12.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9a6ec352c8069ccfb45b8259b301c4444284874c8dd3043e0b86422d0472d8ed
BLAKE2b-256 checksum
How to use checksums
68b953a7281528b1d0f4e37a858ac27eae070407b9eff7418cf89c68c3de21c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / pyspray-0.0.12-py3-none-any.whl

Download URL pyspray-0.0.12-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0b3fa3476306ccf9d3050c8d317656fb2c2e027fac6eb11283261c42d9ebfca
BLAKE2b-256 checksum
How to use checksums
8f56885dfd3f949e36c8e8555b04a201d672f245e7ac09e808c31dc0ac8e14b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page