Skip to main content

A Python library for Flipnote Studio (3D) files

Project description

flipnote.py

Python library for parsing Nintendo Flipnote Studio animations.

Supports PPM (Flipnote Studio, DSi) and KWZ (Flipnote Studio 3D) formats.

Accelerated by libugomemo when build dependencies are available, otherwise falls back to pure Python+numpy.

Installation

pip install flipnote

The install automatically compiles libugomemo (bundled C library) for ~15-40x faster frame and audio decoding. If the build dependencies aren't available, it falls back to pure Python.

Build dependencies for C acceleration

A C compiler (clang or gcc) and development headers for OpenSSL, GMP, and zlib. If these aren't present, the install still succeeds and everything works -- just slower.

Debian/Ubuntu:

sudo apt install libssl-dev libgmp-dev zlib1g-dev

Fedora/RHEL:

sudo dnf install openssl-devel gmp-devel zlib-devel

Arch:

sudo pacman -S openssl gmp zlib

macOS (Homebrew):

brew install openssl gmp zlib

Usage

from flipnote.ppm import Parser as PPM
from flipnote.kwz import Parser as KWZ

# Parse a PPM file
ppm = PPM.open("animation.ppm")
print(f"{ppm.frame_count} frames by {ppm.current_author_name}")

# Decode a frame to RGB numpy array (192, 256, 3)
frame = ppm.decode_frame(0)

# Decode an audio track to int16 numpy array
audio = ppm.decode_audio_track(0)  # 0=BGM, 1-3=SE

# Parse a KWZ file
kwz = KWZ.open("animation.kwz")
print(f"{kwz.frame_count} frames by {kwz.current_author_name}")

# Decode a frame to RGB numpy array (240, 320, 3)
frame = kwz.decode_frame(0)

# Decode audio (variable-width ADPCM)
audio = kwz.decode_audio_track(0)

Schema utilities

from flipnote.schema import verifyPPMFSID, convertKWZFSIDToPPM

verifyPPMFSID("59A643D0A30FD688")  # True
convertKWZFSIDToPPM("00A45FDC21928E8CC700")  # "C78C8E9221DC5FA4"

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

flipnote-0.2.1.tar.gz (108.4 kB view details)

Uploaded Source

Built Distribution

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

flipnote-0.2.1-py3-none-any.whl (93.6 kB view details)

Uploaded Python 3

File details

Details for the file flipnote-0.2.1.tar.gz.

File metadata

  • Download URL: flipnote-0.2.1.tar.gz
  • Upload date:
  • Size: 108.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for flipnote-0.2.1.tar.gz
Algorithm Hash digest
SHA256 45a18347b35c3d3f904cc38cf8babdbaf7a964a223435aed1a7febe2c854985e
MD5 a89476946ba94a90a5e5348bd415ebd1
BLAKE2b-256 59993f4b5cd9dd46a99ef48d70a60172e9bf75a0126671909419d558848e02c1

See more details on using hashes here.

File details

Details for the file flipnote-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: flipnote-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 93.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for flipnote-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 134f77922f7c4a6ab00d84f23cec4dfa7e2e2b9c3aef4df466146671ec34f3ad
MD5 04f7334419e5a1f7eca6030959b7d86f
BLAKE2b-256 e75e30fa08834422159ae75d09b0aefe995bf42c1a491c25d7587d4c6f256cea

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