Skip to main content

print spss metadata

Project description

SPSS Metadata Printer ๐Ÿ“Š

Easy-to-use Python package for extracting, viewing, and exporting metadata from SPSS files with beautiful formatting.

โœจ Features

  • ๐Ÿ“‹ Pretty-print comprehensive SPSS metadata to console
  • ๐Ÿ’พ Export metadata summaries to text files automatically saved to Downloads
  • ๐Ÿ”„ Support for Pandas and Polars DataFrames
  • ๐Ÿ“Š Detailed variable information including labels, types, and value mappings
  • ๐ŸŽจ Beautiful table formatting with configurable width and display options

๐Ÿš€ Quick Start

Installation

pip install metaprinter

Basic Usage

import pyreadstat
from metaprinter import print_metadata, export_metadata

# Load your SPSS file
df, meta = pyreadstat.read_sav('data.sav')

# Display beautiful metadata summary
summary = print_metadata(df, meta)

# Export to Downloads/metadata_summary.txt
export_path = export_metadata(df, meta)

Output Preview:

============================================================
SPSS FILE METADATA
============================================================
File encoding   : 'UTF-8'
Number of cols  : 25
Number of rows  : 100
Table name      : 'Table'
File label      : 'Customer Satisfaction Survey'
Notes           : 'Notes'

VARIABLE METADATA
============================================================
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ column        โ”† dtype   โ”† column_n โ”† n_uniques โ”† n_categories โ”† column_label        โ”† value_labels        โ”‚
โ”‚ ---           โ”† ---     โ”† ---      โ”† ---       โ”† ---          โ”† ---                 โ”† ---                 โ”‚
โ”‚ str           โ”† str     โ”† i64      โ”† i64       โ”† i64          โ”† str                 โ”† str                 โ”‚
โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ก
โ”‚ respondent_id โ”† Int64   โ”† 1547     โ”† 1547      โ”† 0            โ”† Respondent ID       โ”†                     โ”‚
โ”‚ satisfaction  โ”† Int64   โ”† 1523     โ”† 5         โ”† 5            โ”† Satisfaction Level  โ”† {                   โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "1": "Very Low",  โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "2": "Low",       โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "3": "Neutral",   โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "4": "High",      โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "5": "Very High"  โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”† }                   โ”‚
โ”‚ age           โ”† Int64   โ”† 1534     โ”† 6         โ”† 6            โ”† Age Group Category  โ”† {                   โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "1": "18-25",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "2": "26-35",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "3": "36-45",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "4": "46-55",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "5": "56-65",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "6": "65+"        โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”† }                   โ”‚
โ”‚ ...           โ”† ...     โ”† ...      โ”† ...       โ”† ...          โ”† ...                 โ”† ...                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Advanced Configuration:

# Customize table width for narrow displays
print_metadata(df, meta, max_width=120)

# Control column truncation
print_metadata(df, meta, show_all_columns=False)

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

metaprinter-0.2.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

metaprinter-0.2.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metaprinter-0.2.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for metaprinter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fbd3bc2a2d92446b04dd576d518bb88713bf509293fb2de69c146b6d64965b64
MD5 01c67bb74ceea1950f1a9ead0554632d
BLAKE2b-256 beee4511b064cb97ad5d0e6e67bd35a26e654733794ad85f205dc4d35ff8da2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for metaprinter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afb61219ca469622b835a6ca8f6a822c51a812f7993fedcf94e253a98b0be7f3
MD5 0eddd4e6b85d64a7ba2be509c3b81e69
BLAKE2b-256 a354e5d201ed9a9d79b89483df2cd8db226e2de48bcb5af6e77d017d1920339d

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