terminal
Pacify
Docs
Documentation — Core v1.2.0

Pacify Reference

Complete documentation for all source files in the Pacify CLI tool. Covers the data layer, login/storage module, email automation, and the full interactive menu system.

check_circle Python 3.10+ mail SMTP / Gmail table_chart PrettyTable window Windows
database Data.py

Dictionary-based local storage. Holds all user/object records as a Python list of dicts.

manage_accounts Login_page.py

Interactive data entry & file persistence. Collects objects and writes them to Data.py.

terminal main.py

Entry point. Contains all CLI functions: find, edit, email-all, email-specific, and the menu loop.


Installation #

Get started by cloning the repository from GitHub.

1. Install Dependencies

terminal
# Install required Python packages
pip install prettytable

# smtplib and email are part of the Python standard library
# No extra install needed for those

2. Project Structure

file tree
pacify/
├── main.py # Entry point — run this
├── Data.py # Data store (auto-managed)
├── Login_page.py # Login / data entry module
└── Background.py # ASCII art / branding assets
warning All files must be in the same directory. Pacify uses relative imports, so running main.py from a different folder will cause ModuleNotFoundError.

Quick Start #

Get Pacify running in under 2 minutes.

1
Run the main script
terminal
python main.py

On first run, Pacify detects empty data and prompts you to add objects.

2
Enter your data objects
interactive prompt
You have zero data on. You have to login to store data ⚠️

How many object are there?: 2
Enter the name of object 0: Alice
Enter the ID of object 0: ID_001
Enter the email of object0: alice@example.com
3
Use the interactive menu

On subsequent runs, Pacify shows your total record count and the main options table. Type a number to execute an action.

lightbulb After adding or editing data, always restart the script. Pacify reads Data.py at startup and doesn't hot-reload.

database

Data.py #

Storage Layer

The flat-file data store. This file is the single source of truth for all object records and is read + written by both Login_page.py and main.py.

Data Schema

Data.py
User_data_1 = [
    {
        'Name': 'Bob',
        'ID': '88',
        'E-mail': 'bob@example.com'
    },
    # … more records appended here automatically
]

Field Reference

FieldTypeRequiredDescription
'Name'strRequiredFull name of the object/user.
'ID'strRequiredUnique identifier. Used as the primary lookup key for find, edit, and email operations. Can be any string.
'E-mail'strRequiredValid email address. Used as the To field when sending emails. Note the hyphen in the key name.
warning Do not manually edit Data.py while Pacify is running. The script loads this file once at startup — runtime edits will not be reflected until restart.

manage_accounts

Login_page.py #

Data Entry Module

Defines the Login_Section class, which handles interactive data entry and persists records to Data.py.

Class: Login_Section

method ASK_AND_STORE(self)
expand_more

Prompts the user to enter N objects interactively. Each object requires a name, ID, and email. After all entries, the entire User_data_1 list (including pre-existing records) is written back to Data.py.

Login_page.py — ASK_AND_STORE
def ASK_AND_STORE(self):
    self.students = int(input("How many object are there?: "))
    for i in range(self.students):
        self.name = input(f"Enter the name of object {i}: ")
        self.id = input(f"Enter the ID of object {i}: ")
        self.email = input(f"Enter the email of object{i}: ")
        Data.User_data_1.append({...})
        # Writes updated list to Data.py after each entry
Behaviour Notes
  • Writes Data.py after every object, so partial data is never lost mid-run.
  • Appends to the in-memory User_data_1 list first, then persists the whole list.
  • Requires a restart after saving for changes to be picked up by other functions.
destructive CLEAR_DATA(self)
expand_more

Overwrites Data.py with an empty list. This is irreversible — all stored records will be permanently deleted.

Login_page.py — CLEAR_DATA
def CLEAR_DATA(self):
    with open("Data.py", "w") as file:
        file.write("User_data_1 = []")
    print("Your data removed successfully! Restart your software again.")
warning This is mapped to Option 1 in the main menu. There is no confirmation prompt — selecting option 1 immediately wipes all data.

terminal

main.py #

Entry Point

The primary script. Imports all modules, checks data state, and runs the interactive menu loop. Contains four core functions for data lookup, editing, and email dispatch.

Startup Flow

1
Import modulesData, smtplib, Login_page, Background, prettytable
2
Print ASCII bannerRenders the Pacify logo from Background.py in green
3
Check data lengthlen(Data.User_data_1) — 0 triggers first-run login, >0 opens menu
4
Run interactive while-loopContinuously shows menu until a terminal action is selected

search Find_the_object() #

Searches User_data_1 for a record matching a given ID and prints it as a formatted table.

main.py
def Find_the_object():
    Programm = True
    while Programm:
        user_input = input("Type the ID of the object: ")
        for object in Data.User_data_1:
            if object['ID'] == user_input:
                # Builds PrettyTable and prints result
                Object_found = True
Menu Option
5
Loop Behaviour
Retries on no match. Exits on success.
Output
PrettyTable with ID, Name, Email columns.

edit Edit_details() #

Finds a record by ID, shows its current values, and lets the user overwrite Name, ID, and Email. Persists changes to Data.py immediately using pformat.

main.py — Edit flow
# Step 1: Look up by ID
user_id = input("Enter the Id of the person you want to edit: ")

# Step 2: Confirm via Y/N prompt
user_id = input("Did you want to edit this object? (Y/N): ").lower()

# Step 3: Accept new values and mutate in-memory dict
person['Name'] = user_name
person['ID'] = user_id
person['E-mail'] = user_email

# Step 4: Persist using pformat (preserves dict structure)
with open("Data.py", "w") as file:
    file.write("User_data_1 = ")
    file.write(pformat(Data.User_data_1))
info Edit is the only menu action that keeps programm_running = True, allowing you to edit multiple records in one session without restarting.

mail Email_all_obeject() #

Sends an identical email to every record in User_data_1 via Gmail SMTP. Uses TLS on port 587.

warning
Gmail App Password Required You must use a Google App Password, not your regular Gmail password. Regular passwords will fail with a 535 auth error. Generate one at Google Account → Security → App Passwords.
main.py — SMTP setup
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls() # Upgrade to TLS
server.login(Email, app_password) # Gmail + App Password

for user_sender in Data.User_data_1:
    msg = EmailMessage()
    msg["To"] = user_sender["E-mail"]
    server.send_message(msg)
    print(f"Email sent to ID: {user_sender['ID']}")
server.quit()

Inputs Collected

PromptVariableNotes
Enter your Gmail-IDEmailUsed as the From address
Enter your long message heremessagePlain text body — no HTML support
Enter subject of your emailSubjectEmail subject line
(App password — not prompted, hardcoded)password⚠️ Replace placeholder in source with your App Password

forward_to_inbox Email_specific_object() #

Targets a single record by ID and sends it a custom email. Prompts for confirmation before sending.

main.py — specific email
user_id = input("Enter the user ID which you want to E-mail: ")

for datum in Data.User_data_1:
    if datum['ID'] == user_id:
        ask_user = input("Did you want to email this object? (Y/N): ")
        if ask_user == "y":
            # Collect sender details and dispatch
warning There is a logic bug in the current version: the else branch prints "I didn't find the object" for every non-matching record in the loop before the match is found. This can be fixed by removing the else: break and relying on the Object_found flag.

CLI Options #

The interactive menu displayed after startup. Type the corresponding number and press Enter to execute.

1
Remove All Data
Calls Login.CLEAR_DATA(). Wipes Data.py completely. Irreversible.
2
Email All Objects
Calls Email_all_obeject(). Sends one email to every record. Requires Gmail + App Password.
3
Email Specific Object by ID
Calls Email_specific_object(). Prompts for an ID, shows the record, then sends on confirmation.
4
Edit Record Details
Calls Edit_details(). Find by ID, confirm, then update Name, ID, and Email. Persists to Data.py immediately.
5
Find Object by ID
Calls Find_the_object(). Loops until a matching ID is found or the user force-quits (Ctrl+C).

Error Handling #

Common errors you may encounter and how to resolve them.

SMTP Error
smtplib.socket.gaierror
Network is unreachable, or the email address is malformed. Check your internet connection and verify the Gmail address is correct. Caught by the except block in both email functions.
Auth Error
535 Authentication Failed
Using a regular Google password instead of an App Password, or 2FA is not enabled on your account. Go to Google Account → Security → App Passwords to generate one.
Import Error
ModuleNotFoundError: No module named 'Background'
All source files must be in the same directory. Also ensure Background.py exports both pacify and Login_logo variables.
Data Issue
KeyError: 'Email' vs 'E-mail'
Login_page.py appends records with the key 'Email' but main.py reads using 'E-mail'. The file writer normalizes this correctly — ensure you always use the CLI to add records, never edit Data.py manually with the wrong key.

terminal
Pacify
© 2026 Pacify Open Source Project · Apache 2.0 License · Built for performance.