Install & Compatibility
Where this runs
tested against v1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.016s · 63.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.016s · 64MB
62MB installed
● package 62MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DocumentGenerator
✓ from essential_generators import DocumentGenerator
✗ import essential_generators
DocumentGenerator()
The class is nested under the module; direct import is required.
MarkovTextGenerator
✓ from essential_generators import MarkovTextGenerator
Second generator class for text-specific generation.
CyclicGenerator
✓ from essential_generators import CyclicGenerator
Generates repeating patterns from a template list.
Quickstart example: create a DocumentGenerator, generate a single random document, a custom document from a template, and generate multiple documents.
from essential_generators import DocumentGenerator
gen = DocumentGenerator()
doc = gen.gen_document()
print(doc)
# Generate a custom document from a template
template = {
'name': '{{name.first_name}} {{name.last_name}}',
'email': '{{email}}',
'address': '{{address.street}}, {{address.city}}'
}
custom = gen.gen_document(template)
print(custom)
# Generate multiple documents quickly
docs = gen.gen_documents(5)
for d in docs:
print(d)
Errors
Common errors & fixes
ImportError: No module named essential_generators
The package name uses a hyphen while the module uses an underscore. Some users install the package but then try to import with a hyphen.
fixImport using underscore: 'from essential_generators import DocumentGenerator'
AttributeError: 'DocumentGenerator' object has no attribute 'gen_document'
The user created the generator with an invalid parameter (e.g., 'path' instead of 'template_dir') or the generator failed to initialize correctly.
fixInitialize with no arguments: gen = DocumentGenerator(). If you need a custom template directory, use gen = DocumentGenerator(template_dir='path').
Upgrade
Version history
1.0latest on PyPI · released Dec 17, 2020
Audit
Dependencies
pyyamloptionalUsed for template parsing (optional for JSON only)