Skip to main content

A Python library for working with PlayStation 2 memory card files.

Project description

ps2mc

A Python library for working with PlayStation 2 memory card files.

Installation

pip install ps2mc

Quick Start

Example 1: Use the high-level Browser wrapper

with Browser("my_memory_card.ps2") as browser:
    root_dir = browser.list_root_dir()
    browser.export("game_name", ".")

Example 2: Subclass Ps2mc for custom parsing

class MemcardReader(Ps2mc):
    def read_save_entries(self) -> list[Saka04SaveEntry]:
        save_entries: list[Saka04SaveEntry] = list()
        root_entries = [e for e in self.entries_in_root if e.is_exists()]
        for entry in [e for e in root_entries if e.name.startswith("BISLPM-65530Saka_G")]:
            sub_entries = self.lookup_entry_by_name(entry.name)
            for sub_entry in sub_entries:
                if sub_entry.is_file():
                    if sub_entry.name == entry.name:
                        main_save_entry = self.read_data_cluster(sub_entry)
                    if sub_entry.name == 'head.dat':
                        save_head_entry = self.read_data_cluster(sub_entry)
                    if sub_entry.name == 'icon.sys':
                        sys_icon_entry = self.read_data_cluster(sub_entry)
            save_entries.append(Saka04SaveEntry(entry.name, main_save_entry, save_head_entry, sys_icon_entry))
        return save_entries

Documentation

Reference

License

MIT License

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

ps2mc-0.1.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

ps2mc-0.1.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file ps2mc-0.1.1.tar.gz.

File metadata

  • Download URL: ps2mc-0.1.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for ps2mc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9de339a785e659c40094dfd639c6b15250c4520a2a29e1c05165210c113fbd99
MD5 6d54c2b8a339e3fcaf3360c0d7ef9635
BLAKE2b-256 c2af205732f83a52b3cbdc8fd55736f9ca43a807075710562b45423457d4eddc

See more details on using hashes here.

File details

Details for the file ps2mc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ps2mc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for ps2mc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9084b02b0810540e8479ef2d430da969606ff5eb465e92a6737941ea2e718097
MD5 6dc84941267af289553f87bb34d93a66
BLAKE2b-256 a47a1f7286a2230ff2ab4b4b0960ab81505c31fa0fb462e46f94eac1bb2c20e1

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