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.1.0.tar.gz (2.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.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sse_bsa-1.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for sse_bsa-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9f7329dd3894588687229cfa5e22023154e54a548f76797a384626ea2d588004
MD5 bad0ce523572951c033fca4b66c9eb2a
BLAKE2b-256 4fd06932badd71d68b45b36615a1accc29adee5d54381fae1c574a2d71136161

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sse_bsa-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for sse_bsa-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b433b06ac43cc51b6b519f3164c63732efd2ace0d05555cbdc73852521260755
MD5 f42e1a16b9168decdf3d51174ff3631d
BLAKE2b-256 32c00a9932c38391d6e887156fb3ded29efaf201e54d7c74e4c8ecc348553f5c

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