| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
pseudoc is a tool for generating placeholder documents to support testing and development workflows. Similar to how Lorem Ipsum provides placeholder text and picsum.photos provides placeholder images, pseudoc generates various types of fake documents to aid in development and testing scenarios.
Pre-compiled binaries for all major platforms are available on the GitHub Releases page. Download the appropriate binary for your system, add it somewhere appropriate, e.g. a directory in your PATH, and you're ready to go.
If you have Go installed, you can build pseudoc from source:
git clone https://github.com/engineervix/pseudoc.git
cd pseudoc
go build -o bin/pseudoc ./cmd/pseudocpseudoc can be used as a command-line tool or as an HTTP server.
The CLI is perfect for scripting and local document generation.
USAGE: pseudoc [command] [options] COMMANDS: pdf Generate PDF document docx, word Generate Word document xlsx, spreadsheet, sheet Generate Excel spreadsheet random Generate random document type serve, server Start HTTP API server version, -v, --version Show version information help, -h, --help Show this help message OPTIONS: --count N Number of documents to generate (default: 1) --output-dir DIR Directory to store output files (default: current directory) --filename NAME Base filename (default: auto-generated with timestamp) --seed VALUE Set random seed for reproducible output --quiet Suppress output for scripting --dry-run Preview what would be generated without creating files FORMAT-SPECIFIC OPTIONS: --pages N For PDF/DOCX: Number of pages (default: 1) --sheets N For XLSX: Number of sheets (default: 1)
Generate a single PDF:
pseudoc pdfGenerate 5 Word documents with 3 pages each:
pseudoc docx --count 5 --pages 3Generate an Excel file with a custom filename and 4 sheets:
pseudoc xlsx --filename my-data --sheets 4Generate 10 random documents in a specific directory:
pseudoc random --count 10 --output-dir ./test-filesGenerate reproducible documents with a seed:
pseudoc random --seed 42 --count 5Start the server to generate documents via HTTP requests. This is useful for various kinds of integrations.
pseudoc serveBy default, the server starts on localhost:8080 in development mode. You can customize the host, port, and environment:
pseudoc serve --host 0.0.0.0 --port 3000 --env productionThe server provides interactive API documentation via Swagger UI at /docs. This includes:
Visit http://localhost:8080/docs when the server is running to explore the full API documentation.
Generate a 3-page PDF using a GET request:
curl "http://localhost:8080/api/v1/generate/pdf?pages=3" -o document.pdfGenerate a random document with a specific seed:
curl "http://localhost:8080/api/v1/generate/random?seed=42" -o random-docGenerate a 5-page DOCX using a POST request:
curl -X POST "http://localhost:8080/api/v1/generate" \
-H "Content-Type: application/json" \
-d '{"type":"docx","pages":5,"seed":123}' \
-o document.docxWhen using the GET /api/v1/generate/random endpoint, the server will generate a document of a randomly selected type directly. Both GET and POST requests include the X-Pseudoc-Generated-Type response header to indicate which document type was generated.
# Generate a random document - the type will be determined by the server
curl "http://localhost:8080/api/v1/generate/random?seed=42" -o random-docUse the -L -J -O flags to automatically save the file with the server-provided filename and extension:
# The server provides the correct filename via Content-Disposition header
curl -L -J -O "http://localhost:8080/api/v1/generate/random?seed=42"You can check the generated document type from the response header:
curl -I "http://localhost:8080/api/v1/generate/random?seed=42"
# Look for: X-Pseudoc-Generated-Type: pdfThe server supports various configuration options for production deployment:
Example with custom configuration:
# Enable metrics endpoint
pseudoc serve --metrics
# Custom rate limiting and CORS
pseudoc serve --rate-limit 120 --cors-allowed-origins "https://example.com,https://app.example.com"
# Production setup with custom timeout and logging
pseudoc serve --env production --timeout 60s --log-level warnThis project uses just as a command runner. See the justfile for available commands.
just buildjust testjust run -- pdf --count 2just docs| Back | FazBrowse Home | New Git URL |