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 titlegeneral_instruction: Overall instructions for document generationresources: Array of resource objects withkey,path,title, anddescriptionsections: Array of section objects withtitle,prompt,sections(for nesting), andrefs
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bb9d6cbbdf0fd1d16a178bdaa455837d5540b99a5b8063203827640f03525f7
|
|
| MD5 |
b88f7f26b0f1ca5cbf35bd8649b9e92b
|
|
| BLAKE2b-256 |
76f76b1eaf2f83fb4851134e49a6913bb50ddc4d6a642c1c3304698577ae43bb
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4308ec6c66485e23327b4a8120c84be7afefec8b58f1e372867ca7eaa9186344
|
|
| MD5 |
ec27bcaf2eadc5cb0f66a5852c58c861
|
|
| BLAKE2b-256 |
0be99666470124eab067a8fafccf8c2138d04054fd360bb1523516c2c18a935d
|