Frappe Cloud
Marketplace
Search for an app
Frappe
Products
Insights
Publisher
Supported versions
Categories
E-Commerce
About
A comprehensive Frappe application containing complete Indian postal data including pincodes, areas, cities, districts, and states. This app provides easy access to Indian geographical and postal information for integration with your Frappe/ERPNext applications.
cd /path/to/your/bench
bench get-app https://github.com/shridarpatil/postal_db
bench --site your-site-name install-app postal_db
bench --site your-site-name migrate
bench restart
git clone https://github.com/shridarpatil/postal_db.git
cd postal_db
bench get-app /path/to/postal_db
bench --site your-site-name install-app postal_db
import frappe
# Get location by pincode
location = frappe.get_doc("Location", {"pincode": "95221"})
print(f"Area: {location.area}, City: {location.city}")
# Search locations by city
locations = frappe.get_all("Location",
filters={"city": "Bilaspur"},
fields=["pincode", "area", "district", "state"]
)
# Get all locations in a state
hp_locations = frappe.get_all("Location",
filters={"state": "Himachal Pradesh"},
fields=["*"]
)
# Get all locations
GET /api/resource/Location
# Get specific location
GET /api/resource/Location/{location-name}
# Filter by pincode
GET /api/resource/Location?filters=[["pincode","=","95221"]]
# Filter by city
GET /api/resource/Location?filters=[["city","=","Bilaspur"]]
# Filter by state
GET /api/resource/Location?filters=[["state","=","Himachal Pradesh"]]
import frappe
def validate_pincode(pincode):
"""Validate if pincode exists in postal database"""
if frappe.db.exists("Location", {"pincode": pincode}):
return True
return False
def get_location_details(pincode):
"""Get complete location details by pincode"""
location = frappe.db.get_value("Location",
{"pincode": pincode},
["area", "city", "district", "state"],
as_dict=True
)
return location
// Client-side script for auto-filling address
frappe.ui.form.on('Your DocType', {
pincode: function(frm) {
if (frm.doc.pincode && frm.doc.pincode.length === 6) {
frappe.call({
method: 'frappe.client.get_list',
args: {
doctype: 'Location',
filters: {
pincode: frm.doc.pincode
},
fields: ['area', 'city', 'district', 'state']
},
callback: function(r) {
if (r.message && r.message.length > 0) {
let location = r.message[0];
frm.set_value('city', location.city);
frm.set_value('district', location.district);
frm.set_value('state', location.state);
}
}
});
}
}
});
The database contains over 150,000+ postal locations across India. Here are some sample records:
{
"area": "Bilaspur",
"city": "Bilaspur",
"district": "Bilaspur",
"pincode": "95221",
"state": "Himachal Pradesh"
}
{
"area": "Connaught Place",
"city": "New Delhi",
"district": "Central Delhi",
"pincode": "110001",
"state": "Delhi"
}
{
"area": "Fort",
"city": "Mumbai",
"district": "Mumbai",
"pincode": "400001",
"state": "Maharashtra"
}
{
"area": "Brigade Road",
"city": "Bangalore",
"district": "Bangalore Urban",
"pincode": "560025",
"state": "Karnataka"
}
Field | Type | Description |
---|---|---|
name | Data | Auto-generated unique identifier |
pincode | Data | 6-digit postal code |
area | Data | Local area/locality name |
city | Data | City name |
district | Data | District name |
state | Data | State name |
The postal data is sourced from official Indian Postal Department records and regularly updated to ensure accuracy.
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)For support and questions: - Create an issue on GitHub
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This app contains postal data for educational and development purposes. Please verify critical postal information with official sources for production use.
User Reviews
No reviews yet, be the first to review.
0 rating
More apps from
Explore more apps