An open source JSON schema for defining breathwork exercises in a standardized format.
The Breathwork Schema provides a universal, open source JSON schema for defining breathwork exercises. Our mission is to create a standard that empowers developers, practitioners, and applications to share and build upon a common foundation.
This schema allows different apps and devices to share and use the same breathwork exercises seamlessly, providing a stable foundation for developers to build new tools and experiences.
- Universal Format: Compatible with any programming language and platform
- Comprehensive: Covers timing, instructions, benefits, categorization, and media
- Extensible: Designed with future growth in mind
- Validated: JSON Schema validation ensures data integrity
- Open Source: CC0 1.0 Universal license - public domain
Create a file with the .breath extension:
{
"id": "4-7-8-breathing",
"name": "4-7-8 Breathing",
"description": "A powerful calming technique that helps reduce anxiety and improve sleep quality.",
"instructions": "Breathe in through your nose for 4 seconds, hold your breath for 7 seconds, and exhale completely through your mouth for 8 seconds. Repeat for the desired number of cycles.",
"timings": {
"in": 4,
"hold": 7,
"out": 8
},
"cycles": 4,
"recommendedDuration": "5-10 minutes",
"benefits": [
"Reduces Stress",
"Improves Sleep Quality",
"Manages Cravings",
"Controls Anger Responses"
],
"category": "Relaxation",
"difficulty": "Beginner",
"tags": ["anxiety", "sleep", "calm"],
"media": {
"image": "4-7-8-breathing.png",
"audioGuide": "4-7-8-breathing.mp3"
},
"metadata": {
"author": "Dr. Andrew Weil",
"source": "Traditional Pranayama",
"dateCreated": "2024-01-15",
"version": "1.0.0"
}
}You can validate your breathwork files against the schema using any JSON Schema validator:
# Using ajv-cli
npm install -g ajv-cli
ajv validate -s schema.json -d your-exercise.breath
# Using Python
pip install jsonschema
python -c "
import json
from jsonschema import validate
with open('schema.json') as f: schema = json.load(f)
with open('your-exercise.breath') as f: data = json.load(f)
validate(data, schema)
print('Valid!')
"| Property | Type | Description |
|---|---|---|
id |
string | Unique identifier (lowercase, dashes only) |
name |
string | Human-readable exercise name |
description |
string | Brief summary of the exercise |
instructions |
string | Step-by-step guide |
timings |
object | Breath timing parameters |
cycles |
integer | Default number of breath cycles |
| Property | Type | Required | Description |
|---|---|---|---|
in |
integer | ✓ | Inhalation duration (seconds) |
out |
integer | ✓ | Exhalation duration (seconds) |
hold |
integer | Hold after inhalation (seconds) | |
holdAfterOut |
integer | Hold after exhalation (seconds) |
| Property | Type | Description |
|---|---|---|
recommendedDuration |
string | Suggested practice time |
benefits |
array | List of exercise benefits |
category |
string | Exercise category (see categories below) |
tags |
array | Additional search tags |
difficulty |
string | Beginner, Intermediate, or Advanced |
media |
object | Associated media files |
metadata |
object | Additional information |
Relaxation- Calming and stress-reducing exercisesEnergizing- Invigorating and awakening practicesFocus- Concentration and mental claritySleep- Practices for better sleepStress Relief- Anxiety and tension reductionMeditation- Mindfulness and spiritual practicesRecovery- Post-exercise or healingPerformance- Athletic or mental performanceAnxiety Management- Specific anxiety techniquesOther- Miscellaneous or specialized practices
Files using this schema should use the .breath extension to clearly indicate they contain breathwork exercise data.
import fs from 'fs';
import Ajv from 'ajv';
// Load schema and exercise
const schema = JSON.parse(fs.readFileSync('schema.json', 'utf8'));
const exercise = JSON.parse(fs.readFileSync('4-7-8-breathing.breath', 'utf8'));
// Validate
const ajv = new Ajv();
const validate = ajv.compile(schema);
const valid = validate(exercise);
if (!valid) {
console.log(validate.errors);
}import json
from jsonschema import validate, ValidationError
# Load schema and exercise
with open('schema.json') as f:
schema = json.load(f)
with open('4-7-8-breathing.breath') as f:
exercise = json.load(f)
# Validate
try:
validate(exercise, schema)
print("Exercise is valid!")
except ValidationError as e:
print(f"Validation error: {e.message}")We welcome contributions to improve and extend the Breathwork Schema! Here's how you can help:
- Suggest Schema Improvements: Open an issue to discuss new properties or modifications
- Add Example Exercises: Create example
.breathfiles for different techniques - Improve Documentation: Help make the schema more accessible
- Report Issues: Found a problem? Let us know!
- Fork the repository
- Clone your fork
- Make your changes
- Test with example files
- Submit a pull request
- Follow semantic versioning for schema changes
- Ensure backward compatibility when possible
- Include examples for new properties
- Update documentation for changes
- Test thoroughly before submitting
This schema follows Semantic Versioning:
- Major version (x.0.0): Breaking changes to existing properties
- Minor version (0.x.0): New optional properties or categories
- Patch version (0.0.x): Bug fixes, documentation, or clarifications
Current version: 0.1.0
This work is licensed under CC0 1.0 Universal - effectively public domain. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
- Issues: Report bugs or request features
- Discussions: Join the conversation
- Examples: See the
examples/directory for sample exercises
- Libre Breath - Website and documentation