Template-based generation
Generate different personalized experiences using reusable website templates.
EmotionWeb is a Python package for generating personalized surprise websites from reusable templates. Provide the occasion, recipient, message, images and captions — then let the generator create the website.
EmotionWeb brings together software development and personalized digital experiences.
Instead of manually rebuilding a similar website every time you want to create a personalized experience, you can provide the required information to EmotionWeb and generate a website from a reusable template.
Engineering on the surface. Emotion at the core.
This documentation explains the package from installation and first use to the public API, template system and internal generation flow.
EmotionWeb is an open-source Python library designed to automate the generation of personalized event and surprise websites.
The developer supplies information such as a recipient name, message, occasion type, images and captions. EmotionWeb processes that data through its website-generation system and applies the selected template.
Personalized websites often contain the same basic development work repeatedly:
EmotionWeb attempts to make this repetitive process reusable through templates and programmatic generation.
Generate different personalized experiences using reusable website templates.
Personal information such as names and messages can be supplied through the Python API.
Multiple image paths can be supplied to a generated website.
Captions can accompany the supplied image collection.
The package can be used directly from
a Python program through the
Surprise API.
The website generation engine uses Django's template system as part of the generated web application.
EmotionWeb is distributed as a Python package. Install it using pip.
pip install emotionweb
After installation, Python can import the
package and expose the Surprise
class.
from emotionweb import Surprise
The package currently requires Python 3.10 or newer.
The basic workflow is simple: import
Surprise, provide the required
information, then call generate().
from emotionweb import Surprise
s = Surprise(
type="birthday",
name="Aniket Vishwakarma",
message="chal aaja ghumne chalte h",
images=[
r"C:\Users\DELL\Desktop\EmotionWeb\webengine\static\uploads\img7.jpeg",
r"C:\Users\DELL\Desktop\EmotionWeb\webengine\static\uploads\img8.jpeg",
r"C:\Users\DELL\Desktop\EmotionWeb\webengine\static\uploads\img6.jpeg",
r"C:\Users\DELL\Desktop\EmotionWeb\webengine\static\u uploads\img5.jpeg",
],
caption=[
"The solo travel that teaches me everything ❤️",
"This travel shows a different path of Bihar ❤️",
"And this one is closest to heart because its my Varanasi yaar ❤️",
"Very best view ❤️",
]
)
s.generate()
Surprise from
EmotionWeb.
Surprise object is created
with the personalized data.
type determines
the occasion/template path used by the
package.
generate() starts the website
generation process.
The primary public interface is the
Surprise class.
| Parameter | Expected value | Purpose |
|---|---|---|
| type | string | Selects the occasion/template type. |
| name | string | Name or recipient information used by the generated website. |
| message | string | Personalized message supplied to the selected template. |
| images | list | Image paths supplied to the generator. |
| caption | list | Captions supplied alongside the image collection. |
The type value selects the
occasion/template used for generation.
type="birthday"
The name parameter contains the
recipient or primary personalized name.
name="Aniket Vishwakarma"
The message contains the
personalized text that is passed to the
selected template.
Images are provided as a Python list containing file paths.
Captions are also supplied as a list. The selected template can use these values while rendering the generated website.
Keep image and caption collections logically aligned when a template expects one caption for each image.
EmotionWeb is built around reusable occasion templates. The currently documented occasion types are:
A personalized birthday experience driven by the supplied recipient data, message, images and captions.
A romantic personalized experience using the same generation interface.
A letter-oriented personalized experience.
An anniversary-focused personalized website generated from supplied data.
A personalized apology-oriented experience.
A farewell-focused personalized website.
A Teacher's Day experience using personalized content.
EmotionWeb is designed to accommodate additional themes and templates as the package evolves.
This list represents the currently documented types. New EmotionWeb themes should be added here when they become part of the actual package.
EmotionWeb accepts image paths through the
images parameter.
images=[
r"C:\path\to\photo1.jpeg",
r"C:\path\to\photo2.jpeg",
r"C:\path\to\photo3.jpeg",
]
Captions are provided through the
caption list.
caption=[
"First memory ❤️",
"One of my favourite moments ❤️",
"A day I will always remember ❤️",
]
When using Windows paths in Python, raw strings
such as r"C:\path\file.jpg" are
useful because backslashes do not need to be
escaped individually.
At a high level, the package takes developer input, prepares the information required by the website, selects a template and generates the resulting web project.
The package's generator layer acts as the central processing point for the website generation workflow. It receives the supplied information and coordinates the generation process.
Django is part of the web engine used by EmotionWeb. Its template system provides the mechanism for inserting dynamic values into HTML templates.
A template can contain dynamic Django
expressions such as
and can iterate over collections such as
images or captions.
EmotionWeb uses a package and web-engine structure to keep Python generation logic separate from website resources.
emotionweb/
├── generator.py
├── webengine/
│ ├── ...
│ └── static/
│ └── uploads/
└── ...
The exact repository structure can evolve between package versions. The repository should therefore be treated as the final authority when documenting individual internal files.
Templates define the visual and structural experience produced for an occasion.
The important distinction is that the content is dynamic, while the template provides the website structure and presentation.
EmotionWeb separates personalized data from the website template so that the same generation interface can be used with different content.
name="Your Name"
message="Your personalized message"
type="birthday"
Images and captions can similarly be replaced with your own collections.
Advanced users can work with the package's template and web-engine architecture to understand or extend generated experiences.
A developer who wants to introduce a new website experience needs to understand the relationship between the occasion type, generator logic and Django template.
A new template generally requires more than simply creating an HTML file. The generator needs a way to recognize the corresponding occasion type and route the data to the intended template.
Inspect the current package source before modifying internal routing or template selection. Internal filenames and paths can change between releases.
If Python cannot import EmotionWeb, verify that the package is installed in the Python environment being used to execute the program.
Check the Python and pip installation being used by your terminal and ensure the package installation completes successfully.
Check that every supplied image path points to the intended file and that the file exists.
Verify that captions are supplied as a list and that the selected template actually uses the caption data.
Check the exact value supplied to
type. It must correspond to a
supported template type in the installed
EmotionWeb version.
When troubleshooting, first verify the Python input, then the selected type, then the generated project and finally the browser output.
No for basic usage. The main public interface
is the Python Surprise class.
Django becomes more relevant when working with
the underlying generated web engine or
templates.
Yes. The images parameter accepts
a list of image paths.
Yes. Captions are supplied through the
caption list.
The architecture is intended to be extensible, and additional templates can be introduced as the project evolves.
Yes. The package is designed to receive information through Python and generate the corresponding personalized website.
from emotionweb import Surprise
s = Surprise(
type="birthday",
name="Aniket Vishwakarma",
message="chal aaja ghumne chalte h",
images=[],
caption=[]
)
s.generate()