Skip to content
Back to skills

Features Formats

ASecurity

"Define, validate, cast, decode, and troubleshoot Hugging Face

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
datapython

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill features-formats --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Features Formats?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Features Formats
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-features-formats/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-features-formats)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: features-formats
description: "Define, validate, cast, decode, and troubleshoot Hugging Face
  Datasets feature schemas and supported file formats."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Features and Formats

Use this sub-skill when a task is about dataset schemas, feature dtypes, label encodings, nested structures, media/document/3D decoding, local file format support, or errors caused by feature inference and casting.

## Route the Work

- Read `references/schema-and-features.md` to design or repair `Features` objects, choose between `Value`, `ClassLabel`, `List`, `Sequence`, `LargeList`, `Array2D`-`Array5D`, `Translation`, `TranslationVariableLanguages`, `Json`, and use `cast`/`cast_column` safely.
- Read `references/format-loaders.md` to choose a loader or feature for CSV/JSON/Parquet/text/table formats, folder-based media datasets, and optional media decoders such as `Audio`, `Image`, `Video`, `Pdf`, `Nifti`, and `Mesh`.
- Read `references/troubleshooting.md` when schemas fail to cast, labels encode incorrectly, JSON has mixed/null values, media decoding imports fail, folder metadata does not align, or format inference chooses the wrong builder.
- Run `scripts/feature_schema_smoke.py --help` when you need a local, self-contained schema validation helper. Use `--case object-detection` or `--case messages` for examples that catch nested list/object mismatches without requiring media extras.

## Quick Decisions

- Prefer explicit `features=Features(...)` at load time when raw files contain nullable, mixed, nested, or ambiguous values; prefer `dataset.cast(...)` when the table is already loaded and only the declared schema needs changing.
- Use `dataset.cast_column("column", Feature(...))` for one column, especially path/bytes columns that should become `Audio`, `Image`, `Video`, `Pdf`, `Nifti`, or `Mesh`.
- Use `decode=False` for minimal environments, metadata inspection, remote/archive path validation, or workflows that only need path/bytes; enable decoding only after installing the required optional dependency.
- Route data loading mechanics, split patterns, streaming, and Hub/local path questions to `../loading-local-hub/SKILL.md`; route `map`, transforms, formatting for Torch/NumPy/Pandas, and streaming iteration to `../processing-streaming/SKILL.md`; route push-to-Hub, dataset cards, cache cleanup, and CLI publishing to `../sharing-cli-cache/SKILL.md`.

## Safe Minimal Patterns

```python
from datasets import Dataset, Features, Value, ClassLabel, List

features = Features({
    "text": Value("string"),
    "label": ClassLabel(names=["negative", "positive"]),
    "tokens": List(Value("string")),
})
ds = Dataset.from_dict({"text": ["ok"], "label": ["positive"], "tokens": [["o", "k"]]}, features=features)
```

```python
from datasets import Dataset, Audio

ds = Dataset.from_dict({"audio": ["sample.wav"]})
ds = ds.cast_column("audio", Audio(sampling_rate=16_000, decode=False))
```

Files in this skill

  • SKILL.md2.9 KB
  • references/format-loaders.md7.3 KB
  • references/schema-and-features.md7.4 KB
  • references/troubleshooting.md6.6 KB
  • scripts/feature_schema_smoke.py5.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.