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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sse_bsa-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 00ddf879d2ee145bdd33bca6018990512c3159a67f23758f726a87de8c452a07
MD5 39dcfb4ba65bd3e8e0c300c4b4e59410
BLAKE2b-256 c718dcd802946ac66057486b25c07395089e59251a9ce94a7401a971e570ab9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sse_bsa-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e07004e185d58dab2624675e4340d6030de55a4d140503a9aa099585bf5a0888
MD5 f3038c491fd1c02cbb90364769e0a57a
BLAKE2b-256 08b236981cfb8690f510394f65b874be07017c0eba214ba1a10c3f13a66aad20

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