Skip to content

A clean Python project template demonstrating how to persist, back up, and restore user and transaction data in SQLite. Features modular code, safe user logic, and practical database management for beginners and interns.

Notifications You must be signed in to change notification settings

NChoudhary614/python-sqlite-data-persistence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—„οΈ Data Persistence Project with Python & SQLite

A beginner-friendly Python project to store, backup πŸ—ƒοΈ, and restore ♻️ user and transaction data using SQLite. Perfect for demos, internships, and learning real-world development!


πŸ“¦ Table of Contents


✨ Features

  • πŸ‘€ Store user data and transactions with SQLite
  • πŸ›‘οΈ Prevent duplicatesβ€”unique emails enforced
  • ⚑ One-command backup and restore
  • 🧩 Modular folder structure and maintainable code
  • βœ”οΈ Runs on any OS with Python installed

πŸ—‚οΈ Project Structure

data_persistent_project/ β”œβ”€β”€ database/ β”‚ β”œβ”€β”€ init.py β”‚ β”œβ”€β”€ models.py β”‚ β”œβ”€β”€ database.py β”œβ”€β”€ backups/ β”œβ”€β”€ main.py β”œβ”€β”€ requirements.txt β”œβ”€β”€ README.md


πŸš€ Getting Started

1. Clone this Repository

git clone https://github.com/NChoudhary/data_persistent_project.git cd data_persistent_project

2. (Optional) Set up a Virtual Environment

python -m venv venv

On Windows venv\Scripts\activate

On Linux/macOS source venv/bin/activate

3. Run the Application

python main.py


🧠 How It Works

  • database/models.py β€” Table schemas for users & transactions πŸ“‘
  • database/database.py β€” All database functions, backup/restore πŸ—ƒοΈ
  • main.py β€” Main script with sample inserts and backups πŸ–₯️
  • backups/ β€” Automatically saved database backups ⏳

πŸ“ Example Output

User with email alice@example.com already exists. User with email bob@example.com already exists. [(1, 250.5, '2025-10-18'), (2, 99.99, '2025-10-18')] Backup created: backups/company_data_backup_YYYYMMDD_HHMMSS.db


🀝 Contributing

Pull requests are welcome! For major changes, open an issue first to discuss improvements.


πŸ“œ License

MIT


⭐ Star this repository if it helped you or you found it useful!

About

A clean Python project template demonstrating how to persist, back up, and restore user and transaction data in SQLite. Features modular code, safe user logic, and practical database management for beginners and interns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages