A simple Python library for fetching geographical information about Bangladesh.
Project description
I LOVE MY BANGLADESH
Package Name : bd-geoinfo
A simple yet powerful Python library for fetching comprehensive geographical information about Bangladesh.
Key Features :
-
🔍 Data Search: Easily find detailed information on divisions, districts, upazilas, unions, and postcodes.
-
🌐 Multilingual Support: Access data using both Bangla and English geographical names.
-
📊 Detailed Information: Get population, area, and other relevant data for each location.
-
💡 Interactive Terminal: Use a built-in terminal viewer to display your program's output in a stylish, live-like interface.
Installation :
Install this library from PyPI using pip:
pip install bd-geoinfo
Usage :
Using this library is straightforward. Here are a few examples to get you started.
🗺️ Accessing Geographical Data
from bd_geoinfo import Division, District, Upazila, Union, Postcode
Or
from bd_geoinfo import *
Get Information About Division
dhaka = Division("Dhaka")
print(f"Name (BN): {dhaka.get_name()}")
print(f"All Division name {dhaka.get_division_names()}")
Get Information About District
mymensingh = District("Mymensingh")
print(f"Name (EN): {mymensingh.get_name()}")
print(f"Division: {mymensingh.get_division()}")
Get Information About Upazila
amtali = Upazila("Amtali")
print(f"Is Upzila : {has_upazila()}")
Get Information About Union
burirchar = Union("Burirchar Union")
print(burirchar.get_upazila())
Get Information About Postcode
postcode = Postcode("8710")
print(f"Area Name: {postcode.get_name()}")
print(f"Upazila: {postcode.get_upazila()}")
🖥️ Interactive Terminal Viewer
Use these built-in functions to display your output more attractively. This is especially useful for visualizing data in a clean, terminal-like format.
from bd_geoinfo import Division, add_to_terminal, show_terminal, clear_from_terminal
# Clear the terminal output
clear_from_terminal()
# Add a welcome message
add_to_terminal("Welcome to the BD-GeoInfo Terminal!")
add_to_terminal("Fetching data for Sylhet Division...")
# Create a Division object
sylhet_division = Division("Sylhet")
# Add the division's data to the terminal
add_to_terminal(sylhet_division.get_division_data())
add_to_terminal("Data loaded successfully.")
# Display the terminal window
show_terminal()
📚 Functions by Class
| Class/Module | Function | Description |
|---|---|---|
| Division | get_name(bn=False) |
Gets the name of the division (returns Bangla name if bn=True). |
get_area(unit='km') |
Returns the total area of the division in sq. km (default) or sq. miles. | |
get_population() |
Returns the population of the division. | |
get_website() |
Returns the official website URL of the division. | |
get_festivals() |
Returns a list of major festivals. | |
get_cultural_heritage() |
Returns a list of cultural heritage items. | |
get_notes() |
Returns a descriptive note or extra information. | |
get_established_date() |
Returns the establishment date of the division. | |
get_division_data() |
Returns a dictionary with all data for the division. | |
get_division_names(bn=False) |
Returns a list of all division names. | |
get_districts() |
Returns a list of all districts within the division. | |
get_districts_count() |
Returns the total count of districts. | |
has_division() |
Checks if the division exists. | |
| District | get_name(bn=False) |
Gets the name of the district (returns Bangla name if bn=True). |
get_area(unit='km') |
Returns the total area of the district in sq. km (default) or sq. miles. | |
get_population() |
Returns the population of the district. | |
get_notes() |
Returns a descriptive note about the district. | |
get_festivals() |
Returns a list of festivals celebrated in the district. | |
get_cultural_heritage() |
Returns a list of cultural heritage elements. | |
get_division() |
Returns the division name of the district. | |
get_upazilas() |
Returns a list of all upazilas within the district. | |
get_upazilas_count() |
Returns the total count of upazilas. | |
has_district() |
Checks if the district exists. | |
| Upazila | get_name(bn=False) |
Gets the name of the upazila (returns Bangla name if bn=True). |
get_area(unit='km') |
Returns the total area of the upazila in sq. km (default) or sq. miles. | |
get_population() |
Returns the population of the upazila. | |
get_headquarter() |
Returns the headquarter name of the upazila. | |
get_unions() |
Returns a list of all unions within the upazila. | |
get_unions_count() |
Returns the total count of unions. | |
get_district() |
Returns the district name of the upazila. | |
get_division() |
Returns the division name of the upazila. | |
has_upazila() |
Checks if the upazila exists. | |
| Union | get_name(bn=False) |
Gets the name of the union (returns Bangla name if bn=True). |
get_upazila() |
Returns the upazila name of the union. | |
get_district() |
Returns the district name of the union. | |
get_division() |
Returns the division name of the union. | |
get_full_address(bn=False) |
Returns the complete address of the union (returns Bangla address if bn=True). |
|
get_all_unions() |
Returns a list of all unions. | |
has_union() |
Checks if the union exists. | |
| Postcode | get_name(bn=False) |
Gets the name of the area associated with the postcode (returns Bangla name if bn=True). |
get_postcode() |
Returns the postcode string. | |
get_upazila() |
Returns the upazila name for the postcode. | |
get_district() |
Returns the district name for the postcode. | |
get_division() |
Returns the division name for the postcode. | |
get_full_address(bn=False) |
Returns the full address corresponding to the postcode. | |
has_postcode() |
Checks if the postcode exists. | |
| Terminal Module | add_to_terminal(item) |
Adds a message, image, map, or data to the terminal output. |
clear_from_terminal() |
Clears all previously added terminal messages. | |
show_terminal() |
Opens a graphical window to display the terminal output. |
✨ Acknowledgements
A big thank you to the following people who helped make this project a reality by collecting data:
- Naim Islam: For providing your valuabel time.--Mnt(TPI)
- Monir: For providing your valuabel time.--RAC(TPI)
- Habib: For providing your valuabel time.--FOOD(TPI)
Contribution
Your contributions are highly valued! If you have any feature requests, bug reports, or code suggestions, please feel free to submit a Pull Request or open an Issue on the GitHub repository.
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 bd_geoinfo-0.0.3.tar.gz.
File metadata
- Download URL: bd_geoinfo-0.0.3.tar.gz
- Upload date:
- Size: 189.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
823cc1565df5e8f5da35a85451c410ecc9387769c05241cf0defcebcbfe7bdfe
|
|
| MD5 |
4891f31618cf0a7e4ad9635ce6c513c5
|
|
| BLAKE2b-256 |
83fc585514478d6b4123644ebee3de2f152250f1c192862cd11dd0599d5fcb8b
|
File details
Details for the file bd_geoinfo-0.0.3-py3-none-any.whl.
File metadata
- Download URL: bd_geoinfo-0.0.3-py3-none-any.whl
- Upload date:
- Size: 197.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81c3147ac17b1f7d4a294f387c19c3f2d01350933d7fc7a588d62e789c1df363
|
|
| MD5 |
5ae205a22278e1b17653dbbb44567ca8
|
|
| BLAKE2b-256 |
44cc1c80aa9e37da9f6e686aaefdd9e51a7d89246a42ab2ed92547f73d7313f4
|