Skip to main content

Featrix Model Card - Python Package

Python package for rendering Featrix Model Card JSON to HTML or plain text.

HTML rendering delegates to the canonical JavaScript renderer loaded from CDN, ensuring the Python output always matches the JS version.

Text rendering is a standalone Python implementation for terminal/log output.

Installation

pip install featrix-modelcard

Usage

HTML Renderer

The HTML renderer generates a standalone page that loads model-card.js from the Featrix CDN. The JavaScript renderer handles all layout, styling, and interactivity.

from featrix_modelcard import render_html, render_html_to_file

# Load model card JSON
import json
with open('model_card.json', 'r') as f:
    model_card = json.load(f)

# Render to file
render_html_to_file(model_card, 'output.html')

# Render to string
html = render_html(model_card)

# With 3D sphere visualization
html = render_html(model_card, show_sphere=True)

# With explicit session ID for sphere
html = render_html(model_card, show_sphere=True, session_id='my-session-id')

# Override CDN URL (e.g. for local development)
html = render_html(model_card, cdn_url='http://localhost:8080/model-card.js')

Text Renderer

from featrix_modelcard import render_brief_text, render_detailed_text, print_text

# Brief summary
print_text(model_card, detailed=False)

# Detailed output
print_text(model_card, detailed=True)

# Get as strings
brief = render_brief_text(model_card)
detailed = render_detailed_text(model_card)

API Reference

HTML Functions

  • render_html(model_card_json, *, show_sphere=False, session_id=None, cdn_url=None) -> str
  • render_html_to_file(model_card_json, output_path, *, show_sphere=False, session_id=None, cdn_url=None) -> str
  • print_html(model_card_json, file=None, **kwargs) -> str

Text Functions

  • render_brief_text(model_card_json) -> str
  • render_detailed_text(model_card_json) -> str
  • render_text_to_file(model_card_json, output_path, detailed=True) -> str
  • print_text(model_card_json, detailed=True, file=None) -> str

Architecture

The HTML renderer is a thin wrapper that embeds your model card JSON into a page that loads the canonical FeatrixModelCard JavaScript renderer from the CDN. This means:

  • Python HTML output is always in sync with the JS version
  • No rendering logic to maintain in Python
  • All styling, interactivity, and features come from the JS renderer
  • Zero external Python dependencies

The text renderer is a standalone Python implementation for use in terminals, logs, and non-browser contexts.

Release files for featrix-modelcard 1.17.4

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

Source distribution (sdist)

Source distribution for featrix-modelcard 1.17.4
File Size Uploaded
featrix_modelcard-1.17.4.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for featrix-modelcard 1.17.4
File Interpreter ABI Platform
featrix_modelcard-1.17.4-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / featrix_modelcard-1.17.4.tar.gz

Download URL featrix_modelcard-1.17.4.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
31e371b5070a5b0df7b41593e73a5e71b6ac18efa5443a0186bd0b0d5b4fa853
BLAKE2b-256 checksum
How to use checksums
0c2f1a9ab012fa43d6de5f49b74497933677b3bd145a5e23e57c33d551544d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release files / featrix_modelcard-1.17.4-py3-none-any.whl

Download URL featrix_modelcard-1.17.4-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc814ed79c6d8886f57ba9452cb595f8e4d63eee36dbe3e3b4db27f43e14620a
BLAKE2b-256 checksum
How to use checksums
04ba8488cc1ddc2370a95bde155818a2761c8e46aa47b8466e4429e33637caec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.17.4 This release

2 release files

1.17.3

2 release files

1.17.2

2 release files

1.17.1

2 release files

1.17

2 release files

1.16

2 release files

1.15

2 release files

1.12

2 release files

1.10

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