Skip to main content

A simple Python library for fetching geographical information about Bangladesh.

Project description

I LOVE MY BANGLADESH


Logo

Package Name : bd-geoinfo


PyPI version Python Version Developer Facebook Developer Facebook

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


Download files

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

Source Distribution

bd_geoinfo-0.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

bd_geoinfo-0.0.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file bd_geoinfo-0.0.1.tar.gz.

File metadata

  • Download URL: bd_geoinfo-0.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for bd_geoinfo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3c2cee4f30c541cfe29e09937e3cb542a02aa3f98aaa1012d9f178e835774918
MD5 5008fbe978ccd1cbcd56d56635ad6df9
BLAKE2b-256 5849a5e5f88c614ba8a82e009aa3b96c87a21c19c2f80366ac42bb3356b73884

See more details on using hashes here.

File details

Details for the file bd_geoinfo-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: bd_geoinfo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for bd_geoinfo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 262a7f14dc03763a1bc57e8b9d7b168e9da26fbe0d302769ce630493070a4635
MD5 50a113b054d692e13adf777c49e8cabc
BLAKE2b-256 9e6e708c3d9e297429a44672a33e826c3358c5cc0f322500668dc1dda4b80f69

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