contract-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Contract Generator

合同生成器

Generate professional legal contracts and agreements from templates with variable substitution, formatting, and validation.
从模板生成专业法律合同和协议,支持变量替换、格式设置和验证。

Purpose

用途

Contract generation for:
  • Employment agreements and NDAs
  • Service contracts and SOWs
  • Sales and purchase agreements
  • Lease and rental contracts
  • Partnership and operating agreements
合同生成适用于:
  • 雇佣协议和保密协议(NDA)
  • 服务合同和工作说明书(SOW)
  • 销售与采购协议
  • 租赁协议
  • 合伙与运营协议

Features

功能特性

  • Template System: Pre-built contract templates
  • Variable Substitution: Replace placeholders with actual values
  • Conditional Sections: Include/exclude based on variables
  • Formatting: Professional DOCX output
  • Validation: Check for missing required fields
  • Batch Generation: Create multiple contracts from CSV
  • 模板系统:预构建的合同模板
  • 变量替换:用实际值替换占位符
  • 条件章节:根据变量决定章节的包含/排除
  • 格式设置:生成专业的DOCX格式输出
  • 验证功能:检查必填字段是否缺失
  • 批量生成:从CSV文件生成多份合同

Quick Start

快速开始

python
from contract_generator import ContractGenerator
python
from contract_generator import ContractGenerator

Generate from template

从模板生成

generator = ContractGenerator() generator.load_template('templates/nda.docx') generator.set_variables({ 'party1_name': 'Acme Corp', 'party2_name': 'John Smith', 'effective_date': '2024-03-14', 'jurisdiction': 'California' }) generator.save('nda_acme_smith.docx')
undefined
generator = ContractGenerator() generator.load_template('templates/nda.docx') generator.set_variables({ 'party1_name': 'Acme Corp', 'effective_date': '2024-03-14', 'jurisdiction': 'California' }) generator.save('nda_acme_smith.docx')
undefined

CLI Usage

CLI 使用方法

bash
undefined
bash
undefined

Generate single contract

生成单个合同

python contract_generator.py --template nda.docx --vars vars.json --output contract.docx
python contract_generator.py --template nda.docx --vars vars.json --output contract.docx

Batch generate from CSV

从CSV批量生成

python contract_generator.py --template nda.docx --csv parties.csv --output-dir contracts/
undefined
python contract_generator.py --template nda.docx --csv parties.csv --output-dir contracts/
undefined

Limitations

局限性

  • Templates must be in DOCX format
  • Not a substitute for legal review
  • Does not provide legal advice
  • Complex conditional logic may require custom templates
  • 模板必须为DOCX格式
  • 不能替代法律审查
  • 不提供法律咨询
  • 复杂的条件逻辑可能需要自定义模板