Skip to main content

sfsutils

A KSP SFS savefile parser

Install

pip install sfsutils

Usage

Example:

import sfsutils
data = sfsutils.parse_savefile("saves/persistent.sfs")
# edit data
sfsutils.writeout_savefile(data, destination_file="saves/edited.sfs")

All documentation is in the docstrings of each function.

Available functions are (see docstrings for more info):

  • parse_savefile - Parses an SFS file from stream or file
  • writeout_savefile - Writes out the parsed data back into the SFS format

Notes

The parsing order of this library is deterministic, but note that this guarantee is provided by Python dictionaries sorting keys by the order of insertion (this is the case since Python 3.6).

There is a Cython implementation of this module. With the Cython implementation, parsing is about 4x as fast, and serialisation is about 2x as fast. The Cython backend will automatically be built and selected if Cython is installed along with a working C compiler at the time when this library is installed. If Cython is not available or the build otherwise fails, the pure Python backend will be installed instead.

The backend in use can be checked with sfsutils.BACKEND (possible values: "Python", "Cython").

License

GPLV3

Metadata

Release files for sfsutils 1.1.1

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

Source distribution (sdist)

Source distribution for sfsutils 1.1.1
File Size Uploaded Provenance Actions
sfsutils-1.1.1.tar.gz 18.1 kB Without provenance Details for sfsutils-1.1.1.tar.gz

Release files / sfsutils-1.1.1.tar.gz

Download URL sfsutils-1.1.1.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
367b962822a247a39757231075ff6cae54cd8abbfe2c54d1c78a5d751769c9bd
BLAKE2b-256 checksum
How to use checksums
8accecc867474da9ccfad942f0ecf6088e69ae5ad17613da572de892e1f76575
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Security for sfsutils 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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