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.1.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.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sse_bsa-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d3dfaa51ee23a70483a70e4a439ef6f3002bca545f0d743b3d91351880d9ae81
MD5 3644cd2016fc4bc216bd8112a97fe96d
BLAKE2b-256 d361e5c9760cf74648bbbaf10c30de3135443577e97f0eb1455660e7dfee32ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sse_bsa-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de94ece8feeaaa5d138e9420521e1411dfb3500e1fb206466b3224ae86c28f57
MD5 2d2b1cf2ef8776831e809ed53a020f50
BLAKE2b-256 1fb581bef323eb1d737b7b8fb2b0e05a63e6576fea988b94900c9ff99d25899e

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