Skip to main content

A Python library to read and write BSA (archive) files for Skyrim Special Edition.

Project description

SSE-BSA

This is a Python library to read and write BSA (archive) files for Skyrim Special Edition.

See here for more information about the BSA file specification: https://en.uesp.net/wiki/Skyrim_Mod:Archive_File_Format

Installation

Run pip install sse-bsa to install the library and its dependencies in the current active environment.

Usage

Load an archive

>>> archive = BSAArchive(Path("my_archive.bsa"))

Get a list of all files in the archive

>>> archive.files
["interface/translations/test.txt", "textures/test/test.png"]

Search for files that match a specified pattern (glob)

>>> archive.glob("interface/translations/*.txt")
["interface/translations/test.txt"]

Extract a single file from the archive to a specified destination folder

(this maintains its folder structure)

>>> archive.extract_file("interface/translations/test.txt", Path("output"))

For eg. the extracted file would be located at output/interface/translations/test.txt.

Extract the entire content of the archive to a specified destination folder

(this also maintains the archive's folder structure)

>>> archive.extract(Path("output"))

The entire archive folder structure would be extracted to output.

Get an in-memory stream of a file without extracting it to disk

>>> archive.get_file_stream("interface/translations/test.txt").read()
b'This is a test'

Create a new archive with the content of a specified input folder

>>> BSAArchive.create_archive(Path("input"), Path("new_archive.bsa"))

The entire folder structure of input gets maintained when packing in the new_archive.bsa.

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

sse_bsa-1.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

sse_bsa-1.0.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file sse_bsa-1.0.0.tar.gz.

File metadata

  • Download URL: sse_bsa-1.0.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for sse_bsa-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f8c3bd3849d5c99f8c2e2c7f83443ab94a7690248ae75de0b22476e76f37f963
MD5 f1039dcba654e642a45b1b50afae9316
BLAKE2b-256 023c106a9e086e8bed28230186d38623c86cf6d3b2ffc795973f00c5442f9d7e

See more details on using hashes here.

File details

Details for the file sse_bsa-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sse_bsa-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for sse_bsa-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2000331ef346c6eab1700e0962a43a21143c35be415d23383080dbfcc2d20c1
MD5 36fc3ae44d23fc51f35a7b310d74c24a
BLAKE2b-256 4774186827a099c81701525b68a062ec52a5cd1062a89c416d7eb5416997fcee

See more details on using hashes here.

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