Skip to content
Back to skills

Bag Bytes Workflows

ASecurity

"Use for Dask Bag, dask.bytes, text/byte IO, JSON-like records,

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

Works with

  • cli
  • api

Security analysis

A100/100

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

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill bag-bytes-workflows --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bag Bytes Workflows?

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

Security grade badge for Bag Bytes Workflows
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-bag-bytes-workflows/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-bag-bytes-workflows)

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: bag-bytes-workflows
description: "Use for Dask Bag, dask.bytes, text/byte IO, JSON-like records,
  Avro, fsspec storage, compression, foldby/frequencies, and small-file
  deterministic workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: BSD 3-Clause
---

# Dask Bag and Bytes Workflows

Use this sub-skill when an agent needs to build, debug, or explain Dask workflows around unordered Python objects, text lines, byte blocks, semi-structured records, and filesystem-backed small-file pipelines.

## Route Here For

- Creating bags with `dask.bag.from_sequence`, `read_text`, `read_avro`, `from_delayed`, `concat`, `map`, and `map_partitions`.
- Reading and writing local, cloud, compressed, text, byte, newline-delimited JSON, and Avro-like data with `dask.bag` or `dask.bytes`.
- Using bag reductions such as `frequencies`, `fold`, `foldby`, `distinct`, `topk`, and `count` without forcing dataframe shuffles too early.
- Converting bags to `dask.dataframe` with explicit `meta`, or to per-partition delayed values for custom outputs.
- Diagnosing partition sizing, delimiters, compression inference, `storage_options`, optional Avro dependencies, ordering surprises, and heterogeneous records.

## Route Elsewhere

- Use `dataframe-workflows` for dataframe-first analytics, joins, parquet/CSV dataframe IO, divisions, and dataframe groupby/shuffle tuning.
- Use `core-graphs-schedulers` for generic task graph, delayed, scheduler, `compute`, `persist`, and graph-optimization questions.
- Use `configuration-diagnostics-cli` for Dask configuration, CLI, diagnostics, dashboard, and environment-level reporting.

## Start With These References

- `references/api-reference.md` for public bag/bytes APIs and when to choose each one.
- `references/io-and-data-formats.md` for text, bytes, fsspec URLs, compression, Avro, and storage behavior.
- `references/workflows.md` for practical recipes, including malformed JSON rows and explicit dataframe metadata.
- `references/troubleshooting.md` for common failures and fixes.

## Bundled Smoke Check

Run `python scripts/bag_text_smoke.py --help` to inspect options. Run `python scripts/bag_text_smoke.py` to create a temporary newline-JSON fixture, parse it through Dask Bag, tolerate malformed rows, count records by status, convert to a dataframe with explicit `meta`, and clean up automatically.

## Core Operating Rules

- Keep bag pipelines lazy; do not call `compute()` or `persist()` while defining collection transformations unless the user explicitly wants a local result.
- Prefer `foldby` over `groupby` for per-key reductions because `groupby` performs a full shuffle.
- Treat bags as unordered collections. Sort only after computing or after converting to dataframe when deterministic presentation matters.
- Pass explicit `meta` to `Bag.to_dataframe` for heterogeneous records, empty first partitions, or production code where inference would be expensive or incorrect.
- Use `blocksize=None` for compressed text/bytes unless the compression format supports random access; chunked reads on typical gzip/bz2/xz streams fail or behave poorly.

Files in this skill

  • SKILL.md3.1 KB
  • references/api-reference.md6.8 KB
  • references/io-and-data-formats.md5.9 KB
  • references/troubleshooting.md5.6 KB
  • references/workflows.md5.4 KB
  • scripts/bag_text_smoke.py4.2 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.