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.0.tar.gz (108.3 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.0-py3-none-any.whl (93.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flipnote-0.2.0.tar.gz
  • Upload date:
  • Size: 108.3 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.0.tar.gz
Algorithm Hash digest
SHA256 c199a9120aa2fe00df9a09a2afaac14788282ce16f7fb1a748352b65ccfedc84
MD5 0e886d34135eaea18afb1d409ba5a65f
BLAKE2b-256 bb6739e381c1dcc7bca860c35d263d1e35f960853d7aed575e234d4b41fedbdf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flipnote-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 93.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85c99720a815ba551465fe3a9142e4bda4cd068c810b540c8e0143901acf1eae
MD5 0c588747073823f9bc396627e1c3fdca
BLAKE2b-256 af0c33190ce861c9f3e5594f7cb96b73da4c6923a5be9ec90c3bcd91ebe9615b

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