A Python package for managing, exporting, and organizing personal information, including contact, family, education, professional, and more, with beautiful export options.
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.
🔗 Project Homepage
For the latest updates, issues, and source code, visit the official GitHub repository:
https://github.com/prabaharanpython/personalinfo
📁 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
- Export data to YAML, TXT, Excel, or HTML formats
📦 Requirements
This package requires the following dependencies:
- Python's built-in
json,os, anddatetimemodules pyyaml(for YAML export)pandas(for Excel export)openpyxl(Excel engine for pandas)jinja2(for HTML export)
Install all requirements with:
pip install personalinfo pyyaml pandas openpyxl jinja2
🛠️ 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",
)
family = FamilyDetails(father="Shiva", 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': { ... }
# }
## 📤 Exporting Data
You can easily export a user's data to YAML, TXT, Excel, or HTML with a single line:
```python
saver.export_to_yaml("Peter") # ➡️ Creates Peter_info.yaml
saver.export_to_txt("Peter") # ➡️ Creates Peter_info.txt
saver.export_to_excel("Peter") # ➡️ Creates Peter_info.xlsx
saver.export_to_html("Peter") # ➡️ Creates Peter_info.html (requires Jinja2)
✨ Example Export Outputs
YAML Export (Peter_info.yaml)
Personal Information:
Full Name: Peter
Date of Birth: '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!
Blood Group: B+
Aadhar Number: 1234-5678-9012
Address: 123 Main St, New York, NY
Bio: Data scientist from India.
Family:
Father: Shiva
Mother:
Full Name: Lakshmi
Date of Birth: '1972-02-02'
...
Contact:
Phone Numbers:
- +91-9876543210
Email Addresses:
- peter@example.com
Native Place: Chennai
Languages Known:
- Tamil
- English
Communication Address: 123 Main St, Chennai
Vehicles:
- Vehicle Type: Car
Make: Toyota
Model: Camry
Year: 2020
...
Education:
- Degree: B.Tech
Institution: IIT Madras
Year Of Passing: 2017
...
Professional Experience:
- Designation: Software Engineer
Company: Google
Start Date: 2018-07-01
...
Bank Accounts:
- Bank Name: SBI
Account Number: 1234567890
...
TXT Export (Peter_info.txt)
=== Personal Information ===
Full Name: Peter
Date of Birth: 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!
Blood Group: B+
Aadhar Number: 1234-5678-9012
Address: 123 Main St, New York, NY
Bio: Data scientist from India.
=== Family ===
Father: Shiva
Mother:
Full Name: Lakshmi
Date of Birth: 1972-02-02
...
=== Contact ===
Phone Numbers: +91-9876543210
Email Addresses: peter@example.com
Native Place: Chennai
Languages Known: Tamil, English
Communication Address: 123 Main St, Chennai
=== Vehicles ===
Vehicle 1:
Vehicle Type: Car
Make: Toyota
Model: Camry
Year: 2020
...
=== Education ===
Education 1:
Degree: B.Tech
Institution: IIT Madras
Year Of Passing: 2017
...
=== Professional Experience ===
Professional Experience 1:
Designation: Software Engineer
Company: Google
Start Date: 2018-07-01
...
=== Bank Accounts ===
Bank Account 1:
Bank Name: SBI
Account Number: 1234567890
...
🌐 HTML Export
The HTML export uses a beautiful, modern template with sections, icons, and a download-to-PDF button. You can fully customize the template at src/personalinfo/template.html.
Note:
- The HTML export requires the
jinja2package. Install it with:pip install jinja2
- If you see a
jinja2.exceptions.UndefinedError: 'enumerate' is undefined, update your template as shown in the latest package version (seesrc/personalinfo/template.html).
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file personalinfo-0.1.20.tar.gz.
File metadata
- Download URL: personalinfo-0.1.20.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edfd3b036ec2ea25907174febd42d055dbefdd0be6caf30122e0484670a38fd6
|
|
| MD5 |
a9165df0ceaceb75e0c0ee04eaa1a9bc
|
|
| BLAKE2b-256 |
076ab473c4d083e5c9193d5b8d387f48023974eb9acdcc4e5f7dce5e1ff43d7f
|
Provenance
The following attestation bundles were made for personalinfo-0.1.20.tar.gz:
Publisher:
ci.yml on prabaharanpython/personalinfo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
personalinfo-0.1.20.tar.gz -
Subject digest:
edfd3b036ec2ea25907174febd42d055dbefdd0be6caf30122e0484670a38fd6 - Sigstore transparency entry: 259671120
- Sigstore integration time:
-
Permalink:
prabaharanpython/personalinfo@21210bdb4df57177d22c43820529a3971f2b372d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/prabaharanpython
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@21210bdb4df57177d22c43820529a3971f2b372d -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file personalinfo-0.1.20-py3-none-any.whl.
File metadata
- Download URL: personalinfo-0.1.20-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
720944da5f84a3aaa486baa915f4dfd65575fcf2b3b9b68aac2fd9e65b20c5e3
|
|
| MD5 |
6236a96e17fb4e401ee02250536c35a3
|
|
| BLAKE2b-256 |
6c88fc76762cbcb378fded0ddda409f8a73ec4836358b8c00a7286709dba8dc3
|
Provenance
The following attestation bundles were made for personalinfo-0.1.20-py3-none-any.whl:
Publisher:
ci.yml on prabaharanpython/personalinfo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
personalinfo-0.1.20-py3-none-any.whl -
Subject digest:
720944da5f84a3aaa486baa915f4dfd65575fcf2b3b9b68aac2fd9e65b20c5e3 - Sigstore transparency entry: 259671126
- Sigstore integration time:
-
Permalink:
prabaharanpython/personalinfo@21210bdb4df57177d22c43820529a3971f2b372d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/prabaharanpython
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@21210bdb4df57177d22c43820529a3971f2b372d -
Trigger Event:
workflow_run
-
Statement type: