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
Release history Release notifications | RSS feed
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.1.3.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaprinter-0.1.3.tar.gz.
File metadata
- Download URL: metaprinter-0.1.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a071666123e0c6a9f745416bfc674b0dd95e14d697082cb9d2ae392858fca86
|
|
| MD5 |
8a4235026824f7561e788efaa13396c8
|
|
| BLAKE2b-256 |
9e2bd19665096180a0692f410f55cec187a1d784bd0e36538e1a3b1654fbfa3b
|
File details
Details for the file metaprinter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: metaprinter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
382fad37763f555af93985133e4196ff93603f86a4a8444ff76ff2ea3cf05f2f
|
|
| MD5 |
48ee76514e001f5bd694166aea38c7dc
|
|
| BLAKE2b-256 |
5d5e2881803bb594575ed92f62926c3a8922274b0bfe5cf73c41130bb33afde2
|