bd-geoinfo 0.0.3
A simple Python library for fetching geographical information about Bangladesh.
Requires Python: >=3.6



# I LOVE MY BANGLADESH

---

<img src="bn.png" alt="Logo" style="width:100%; height:auto;background-color:black;">

---

# Package Name : bd-geoinfo

---
[![PyPI version](https://badge.fury.io/py/bd-geoinfo.svg)](https://pypi.org/project/bd-geoinfo/) [![Python Version](https://img.shields.io/badge/Python-3.6%2B-blue)](https://www.python.org/) [![Developer Facebook](https://img.shields.io/badge/Facebook-magenta)](https://www.facebook.com/zyxasaduzzaman) [![Developer Facebook](https://img.shields.io/badge/LinkedIn-orange)](https://www.linkedin.com/in/asaduzzaman-asad-801a80323/)

**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:**

```bash
pip install bd-geoinfo

```

## Usage :

**Using this library is straightforward. Here are a few examples to get you started.**

#### 🗺️ Accessing Geographical Data

```bash

from bd_geoinfo import Division, District, Upazila, Union, Postcode

```

##### Or


```bash

from bd_geoinfo import *

```

---

**Get Information About Division**

```bash

dhaka = Division("Dhaka")
print(f"Name (BN): {dhaka.get_name()}")
print(f"All Division name {dhaka.get_division_names()}")


```

---

**Get Information About District**

```bash

mymensingh = District("Mymensingh")
print(f"Name (EN): {mymensingh.get_name()}")
print(f"Division: {mymensingh.get_division()}")

```

---

**Get Information About Upazila**

```bash

amtali = Upazila("Amtali")
print(f"Is Upzila : {has_upazila()}")

```

---

**Get Information About Union**

```bash

burirchar = Union("Burirchar Union")
print(burirchar.get_upazila())

```

---

**Get Information About Postcode**

```bash

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.**

```bash
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.**