0.0
The project is in a healthy, maintained state
Document conversion library for Ruby — convert between Markdown, HTML, CSV, JSON, and YAML formats. Uses Ruby stdlib (csv, json, yaml), zero external dependencies.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

peasy-document

Gem Version License: MIT GitHub stars

Ruby client for the PeasyFormats API -- convert between Markdown, JSON, YAML, CSV, and other document formats with tools for format identification, MIME type lookup, and structured data transformation. Zero dependencies beyond Ruby stdlib (Net::HTTP, JSON, URI).

Built from PeasyFormats, a comprehensive document conversion toolkit offering free online tools for transforming between structured data formats. The glossary covers document formats from lightweight Markdown to structured JSON and YAML, while guides explain format conversion strategies and encoding best practices.

Try the interactive tools at peasyformats.com -- Markdown to HTML, YAML/JSON Converter, Format Identifier, and more.

peasy-document demo -- Markdown, JSON, YAML, and CSV conversion tools in Ruby terminal

Table of Contents

  • Install
  • Quick Start
  • What You Can Do
    • Document Conversion Tools
    • Browse Document Format Reference
    • Search and Discovery
  • API Client
    • Available Methods
  • Learn More About Document Formats
  • Also Available
  • Peasy Developer Tools
  • License

Install

gem install peasy-document

Or add to your Gemfile:

gem "peasy-document"

Quick Start

require "peasy_document"

client = PeasyDocument::Client.new

# List available document tools
tools = client.list_tools
tools["results"].each do |tool|
  puts "#{tool["name"]}: #{tool["description"]}"
end

What You Can Do

Document Conversion Tools

Document format conversion is a core workflow for developers, data engineers, and content authors. Converting Markdown to HTML powers static site generators and documentation systems. Transforming JSON to YAML (and vice versa) is essential for configuration management across Kubernetes, Docker Compose, and CI/CD pipelines. CSV-to-JSON conversion bridges the gap between spreadsheet data and web APIs.

Tool Description Use Case
Markdown to HTML Convert Markdown syntax to semantic HTML Static sites, documentation pipelines
YAML/JSON Converter Bidirectional YAML and JSON transformation Kubernetes configs, API payloads
Format Identifier Detect file format from content or extension File upload validation, data pipelines
require "peasy_document"

client = PeasyDocument::Client.new

# Fetch the Markdown to HTML conversion tool
tool = client.get_tool("markdown-to-html")
puts "Tool: #{tool["name"]}"           # Markdown to HTML converter
puts "Category: #{tool["category"]}"   # Document conversion category

# List supported document formats and their MIME types
formats = client.list_formats
formats["results"].each do |fmt|
  puts "#{fmt["name"]} (#{fmt["extension"]}): #{fmt["mime_type"]}"
end

Learn more: Markdown to HTML Tool · YAML/JSON Converter · File Format Conversion Guide

Browse Document Format Reference

The document format glossary provides clear definitions for structured data formats, markup languages, and serialization standards. Understanding the differences between JSON and YAML syntax, when CSV is preferable to JSON for tabular data, and how Markdown flavors (CommonMark, GFM) differ helps developers choose the right format for each use case.

Glossary Term Description
Markdown Lightweight markup language for creating formatted text with plain-text syntax
CSV Comma-separated values format for tabular data interchange
JSON JavaScript Object Notation for structured data serialization
YAML Human-readable data serialization format used in configuration files
# Browse document format glossary terms programmatically
glossary = client.list_glossary(search: "csv")
glossary["results"].each do |term|
  puts "#{term["term"]}: #{term["definition"]}" # Document format definition
end

# Read in-depth guides on format conversion strategies
guides = client.list_guides(category: "document")
guides["results"].each do |guide|
  puts "#{guide["title"]} (#{guide["audience_level"]})" # Guide title and difficulty
end

Learn more: Markdown Glossary · JSON Glossary · How to Convert Markdown to Other Formats

Search and Discovery

The unified search endpoint queries across all document tools, glossary terms, guides, and supported file formats simultaneously. This is useful for building scripts, documentation search, or automation that needs to discover conversion capabilities.

# Search across all document tools, glossary, and guides
results = client.search("markdown")
puts "Found #{results["results"]["tools"].length} tools"
puts "Found #{results["results"]["glossary"].length} glossary terms"

Learn more: CSV Glossary · YAML Glossary · All Document Guides

API Client

The client wraps the PeasyFormats REST API using only Ruby standard library -- no external dependencies.

require "peasy_document"

client = PeasyDocument::Client.new
# Or with a custom base URL:
# client = PeasyDocument::Client.new(base_url: "https://custom.example.com")

# List tools with pagination and filters
tools = client.list_tools(page: 1, limit: 10, search: "markdown")

# Get a specific tool by slug
tool = client.get_tool("markdown-to-html")
puts "#{tool["name"]}: #{tool["description"]}"

# Search across all content
results = client.search("markdown")
puts "Found #{results["results"]["tools"].length} tools"

# Browse the glossary
glossary = client.list_glossary(search: "csv")
glossary["results"].each do |term|
  puts "#{term["term"]}: #{term["definition"]}"
end

# Discover guides
guides = client.list_guides(category: "document")
guides["results"].each do |guide|
  puts "#{guide["title"]} (#{guide["audience_level"]})"
end

# List file format conversions
conversions = client.list_conversions(source: "json")

# Get format details
format = client.get_format("json")
puts "#{format["name"]} (#{format["extension"]}): #{format["mime_type"]}"

Available Methods

Method Description
list_tools List tools (paginated, filterable)
get_tool(slug) Get tool by slug
list_categories List tool categories
list_formats List file formats
get_format(slug) Get format by slug
list_conversions List format conversions
list_glossary List glossary terms
get_glossary_term(slug) Get glossary term
list_guides List guides
get_guide(slug) Get guide by slug
list_use_cases List use cases
search(query) Search across all content
list_sites List Peasy sites
openapi_spec Get OpenAPI specification

All list methods accept keyword arguments: page:, limit:, category:, search:.

Full API documentation at peasyformats.com/developers/. OpenAPI 3.1.0 spec: peasyformats.com/api/openapi.json.

Learn More About Document Formats

Also Available

Language Package Install
Python peasy-document pip install "peasy-document[all]"
TypeScript peasy-document npm install peasy-document
Go peasy-document-go go get github.com/peasytools/peasy-document-go
Rust peasy-document cargo add peasy-document

Peasy Developer Tools

Part of the Peasy Tools open-source developer ecosystem.

Package PyPI npm RubyGems Description
peasy-pdf PyPI npm Gem PDF merge, split, rotate, compress -- peasypdf.com
peasy-image PyPI npm Gem Image resize, crop, convert, compress -- peasyimage.com
peasy-audio PyPI npm Gem Audio trim, merge, convert, normalize -- peasyaudio.com
peasy-video PyPI npm Gem Video trim, resize, thumbnails, GIF -- peasyvideo.com
peasy-css PyPI npm Gem CSS minify, format, analyze -- peasycss.com
peasy-compress PyPI npm Gem ZIP, TAR, gzip compression -- peasytools.com
peasy-document PyPI npm Gem Markdown, HTML, CSV, JSON conversion -- peasyformats.com
peasytext PyPI npm Gem Text case conversion, slugify, word count -- peasytext.com

Embed Widget

Embed PeasyDocument widgets on any website with peasy-document-embed:

<script src="https://cdn.jsdelivr.net/npm/peasy-document-embed@1/dist/embed.min.js"></script>
<div data-peasydocument="entity" data-slug="example"></div>

Zero dependencies · Shadow DOM · 4 themes (light/dark/sepia/auto) · Widget docs

License

MIT