Skip to main content

A package format for document outlines and resources

Project description

Docpack

A package format for document outlines and resources. Docpack files (.docpack) are zip archives containing an outline JSON file and associated resource files.

Installation

pip install -e .

Usage

Command Line

# Create a docpack from an outline
docpack create --outline outline.json --output document.docpack

# Extract a docpack
docpack extract document.docpack --dir extracted/

# Validate a docpack
docpack validate document.docpack

# List docpack contents
docpack list document.docpack

Python API

from docpack import DocpackHandler
from pathlib import Path

# Create a docpack
outline_data = {"title": "My Document", "sections": [...]}
resource_files = [Path("file1.txt"), Path("file2.md")]
DocpackHandler.create_package(outline_data, resource_files, Path("output.docpack"))

# Extract a docpack
outline_data, resource_files = DocpackHandler.extract_package(
    Path("document.docpack"),
    Path("extract_dir")
)

Outline Format

The outline JSON should follow the document generator format with:

  • title: Document title
  • general_instruction: Overall instructions for document generation
  • resources: Array of resource objects with key, path, title, and description
  • sections: Array of section objects with title, prompt, sections (for nesting), and refs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docpack_file-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docpack_file-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file docpack_file-0.1.0.tar.gz.

File metadata

  • Download URL: docpack_file-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for docpack_file-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6bb9d6cbbdf0fd1d16a178bdaa455837d5540b99a5b8063203827640f03525f7
MD5 b88f7f26b0f1ca5cbf35bd8649b9e92b
BLAKE2b-256 76f76b1eaf2f83fb4851134e49a6913bb50ddc4d6a642c1c3304698577ae43bb

See more details on using hashes here.

File details

Details for the file docpack_file-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: docpack_file-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for docpack_file-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4308ec6c66485e23327b4a8120c84be7afefec8b58f1e372867ca7eaa9186344
MD5 ec27bcaf2eadc5cb0f66a5852c58c861
BLAKE2b-256 0be99666470124eab067a8fafccf8c2138d04054fd360bb1523516c2c18a935d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page