Skip to main content

A sample package

Project description

PersonalInfoSaver

A comprehensive Python utility to save and retrieve all personal, family, professional, vehicle, education, bank, and contact information to/from a local JSON file.

📁 File: personal_info.json

This file is automatically created in the same directory to store the data in JSON format.

✅ Features

  • Save user information: name, date of birth (dob), email, height (cm), weight (kg), bio, blood group, aadhar number, address
  • Auto-calculates age from dob
  • Auto-calculates BMI from height and weight
  • Provides a BMI health description
  • Store detailed family information (father, mother, siblings, spouse, children)
  • Store detailed vehicle information (type, make, model, year, registration, insurance, mileage, engine/chassis, etc.)
  • Store detailed education information (schooling, college, degree, board, years, grades, specialization, location)
  • Store professional/career information (designation, company, dates, skills, responsibilities, achievements, salary, employment type)
  • Store bank details (bank name, account, IFSC, branch, account type, UPI, PAN, nominee, etc.)
  • Store contact and communication details (phones, emails, native, languages, addresses, social, guardian, emergency contacts)
  • Retrieve saved information by name
  • Automatically loads and updates the data file

📦 Requirements

No external libraries required. Uses Python's built-in json, os, and datetime modules.

🛠️ Usage

pip install personalinfo
from personalinfo import PersonalInfoSaver, FamilyDetails, VehicleDetails, EducationDetails, ProfessionalDetails, BankDetails, ContactDetails

# Create vehicle details
car = VehicleDetails(
    vehicle_type="Car",
    make="Toyota",
    model="Camry",
    year=2020,
    registration_number="TN01AB1234",
    color="White",
    insurance_number="INS123456789",
    insurance_expiry="2026-05-31",
    mileage=15000.5,
    engine_number="ENG987654321",
    chassis_number="CHS123456789"
)
bike = VehicleDetails(
    vehicle_type="Bike",
    make="Honda",
    model="CBR",
    year=2018,
    registration_number="TN01XY5678",
    color="Red",
    insurance_number="INS987654321",
    insurance_expiry="2025-12-31",
    mileage=22000.0,
    engine_number="ENG123456789",
    chassis_number="CHS987654321"
)

# Create education details
schooling = EducationDetails(
    degree="SSLC",
    institution="ABC Matriculation School",
    year_of_passing=2011,
    grade="92%",
    board="State Board",
    school_name="ABC Matriculation School",
    start_year=2001,
    end_year=2011,
    location="Chennai"
)
ug = EducationDetails(
    degree="B.Tech",
    institution="IIT Madras",
    year_of_passing=2017,
    grade="8.9 CGPA",
    specialization="Computer Science",
    start_year=2013,
    end_year=2017,
    location="Chennai"
)

# Create professional details
prof = ProfessionalDetails(
    designation="Software Engineer",
    company="Google",
    start_date="2018-07-01",
    end_date="2022-12-31",
    location="Bangalore",
    skills=["Python", "ML"],
    responsibilities=["Developed ML models"],
    achievements=["Employee of the Year 2020"],
    salary=2500000.0,
    employment_type="Full-time",
    currently_working=False
)

# Create bank details
bank = BankDetails(
    bank_name="SBI",
    account_number="1234567890",
    ifsc_code="SBIN0001234",
    branch="Chennai Main",
    account_type="Savings",
    upi_id="peter@sbi",
    pan_number="ABCDE1234F",
    nominee="Lakshmi"
)

# Create contact details
contact = ContactDetails(
    phone_numbers=["+91-9876543210"],
    email_addresses=["peter@example.com"],
    native_place="Chennai",
    languages_known=["Tamil", "English"],
    communication_address="123 Main St, Chennai",
    whatsapp_number="+91-9876543210"
)

# Create family details (father as string, mother as PersonalInfoSaver)
mother = PersonalInfoSaver()
mother.save_info(
    "Lakshmi", "1972-02-02", "lakshmi@example.com", 160, 60,
    bio="Homemaker.",
    blood_group="B+",
    aadhar_number="2222-3333-4444",
    address="456 Park Ave, New York, NY",
    vehicle_details=[car]
)
family = FamilyDetails(father="Nagappan", mother=mother)

# Create the saver object and save user information
saver = PersonalInfoSaver()
saver.save_info(
    "Peter", "1996-06-15", "peter@example.com", 180, 75,
    bio="Data scientist from India.",
    blood_group="B+",
    family_details=family.to_dict(),
    aadhar_number="1234-5678-9012",
    address="123 Main St, New York, NY",
    vehicle_details=[car, bike],
    education_details=[ug, schooling],
    professional_details=[prof],
    bank_details=[bank],
    contact_details=contact.to_dict()
)

# Retrieve user information
info = saver.get_info("Peter")
print(info)
# Output example:
# {
#   'dob': '1996-06-15',
#   'age': 29,
#   'email': 'peter@example.com',
#   'height_cm': 180,
#   'weight_kg': 75,
#   'bmi': 23.15,
#   'bmi_description': 'Normal weight: Keep up the good work!',
#   'bio': 'Data scientist from India.',
#   'blood_group': 'B+',
#   'family_details': { ... },
#   'aadhar_number': '1234-5678-9012',
#   'address': '123 Main St, New York, NY',
#   'vehicle_details': [ ... ],
#   'education_details': [ ... ],
#   'professional_details': [ ... ],
#   'bank_details': [ ... ],
#   'contact_details': { ... }
# }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

personalinfo-0.1.6.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

personalinfo-0.1.6-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file personalinfo-0.1.6.tar.gz.

File metadata

  • Download URL: personalinfo-0.1.6.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for personalinfo-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c0df3ef945cc948d530bf4d50b3eddf767e3adadedb0b4bfe94f60d2a81a0895
MD5 6c0fcb3fc9fa4f587597c7fa38319692
BLAKE2b-256 3b91688c53e74f89ad64a2f5213e7c84fa3b8d0693fe2da306268de1743d074b

See more details on using hashes here.

File details

Details for the file personalinfo-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: personalinfo-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for personalinfo-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e239722d2be73ecd7152dfb0eb2d5adf72a620c9af9712aad6ee53fcf743f0af
MD5 a20472c5327bb028523471af17b6dc99
BLAKE2b-256 e834ceca6516dad81c30537175ca0fe252b3c75b73b05479ee40ca987c3e798d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page