Skip to main content

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

Metadata

Release files for ps2mc 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ps2mc 0.1.1
File Size Uploaded
ps2mc-0.1.1.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ps2mc 0.1.1
File Interpreter ABI Platform
ps2mc-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / ps2mc-0.1.1.tar.gz

Download URL ps2mc-0.1.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9de339a785e659c40094dfd639c6b15250c4520a2a29e1c05165210c113fbd99
BLAKE2b-256 checksum
How to use checksums
c2af205732f83a52b3cbdc8fd55736f9ca43a807075710562b45423457d4eddc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / ps2mc-0.1.1-py3-none-any.whl

Download URL ps2mc-0.1.1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9084b02b0810540e8479ef2d430da969606ff5eb465e92a6737941ea2e718097
BLAKE2b-256 checksum
How to use checksums
a47a1f7286a2230ff2ab4b4b0960ab81505c31fa0fb462e46f94eac1bb2c20e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page