Logo Lanfrica

mohamed-sinani/all-in-one-dev-tools-tanzania

Domaine:

digital infrastructure

Type de record:

softwaretools
Créateur:
moh
Hôte:
# All-in-One DevKit A collection of utilities for phone validation, Tanzanian Shilling formatting, and Tanzania geographic data. ## Installation ```bash pip install all-in-one-devkit ``` Or install from source: ```bash git clone github.com cd all-in-one-devkit pip install -e . ``` ## Quick Start ```python from devkit import validate, format_tzs, get_districts, search_region ``` ## Phone Utilities ```python from devkit import validate, format, normalize, get_network, is_mobile, is_landline phone = "0712345678" validate(phone) # True format(phone) # "+255712345678" format(phone, country_code=False) # "0712345678" normalize(phone) # "712345678" get_network(phone) # "Vodacom" is_mobile(phone) # True is_landline(phone) # False ``` Supports formats: `0712345678`, `+255712345678`, `255712345678`, `+255 71 234 5678`. **Network detection:** | Prefix | Network | |--------|---------| | 65-69, 71 | Vodacom | | 72, 73, 78, 79 | Airtel | | 74, 75 | Tigo | | 76 | Halotel | | 77 | Zantel | ## Money Utilities ```python from devkit import format_tzs, parse_tzs, to_words format_tzs(1500000) # "TZS 1,500,000" format_tzs(1500.50, decimal_places=2) # "TZS 1,500.50" format_tzs(1500, show_symbol=False) # "1,500" parse_tzs("TZS 1,500") # Decimal("1500") parse_tzs("1000000") # Decimal("1000000") to_words(1500000) # "One Million Five Hundred Thousand TZS" ``` ## Tanzania Geographic Data ```python from devkit import ( REGIONS, DISTRICTS, WARDS, get_districts, get_wards, search_region, search_district, search_ward, get_all_region_names, ) # All 25 regions len(REGIONS) # 25 # Get districts for a region get_districts("01") # Districts in Arusha # Get wards for a district get_wards("0101") # Wards in Arusha City # Search by name search_region("dar") # [{"code": "02", "name": "Dar es Salaam"}] search_district(" …

Languages

Licenses