Lire en Français
Galsenify is a comprehensive library for Senegalese data, it offers a lot of information about country of Teranga.
- Current version ➡️ 1.2.0
- Data source: RGPH-5 2023 (5th General Census of Population and Housing)
via NPM
npm i galsenifyvia YARN
yarn add galsenifyvia PNPM
pnpm i galsenifyimport galsenify from "galsenify";
// or
const galsenify = require("galsenify");
// get all Senegal's regions
console.log(galsenify.regions());
// results
[
"Dakar",
"Diourbel",
"Fatick",
"Kaffrine",
"Kaolack",
"Kédougou",
"Kolda",
"Louga",
"Matam",
"Saint-Louis",
"Sédhiou",
"Tambacounda",
"Thiès",
"Ziguinchor",
];// Get all data about Senegal
galsenify.sn();
// { pays: "Sénégal", capital: "Dakar", habitants: 18126390, ... }
// Get all national languages
galsenify.languesNationales();
// ["Wolof", "Pular", "Sérère", "Diola", "Mandingue", "Soninké", "Bambara"]// Get all data about regions
galsenify.rg();
// Get all region names
galsenify.regions();
// Get all region codes
galsenify.codes();
// ["DK", "DB", "FK", "KA", "KL", "KE", "KD", "LG", "MT", "SL", "SE", "TC", "TH", "ZG"]
// Get departments by region name
galsenify.departments("Dakar");
// ["Dakar", "Pikine", "Guédiawaye", "Rufisque", "Keur Massar"]
// Get population by region name
galsenify.population("Dakar");
// 4004427
// Get area (km²) by region name
galsenify.superficie("Thiès");
// 6670// Get all department names
galsenify.allDepartments();
// Get arrondissements by department name
galsenify.arrondissements("Dakar");
// Get population by department name
galsenify.populationDepartment("Mbacké");
// 1359756
// Get area (km²) by department name
galsenify.superficieDepartment("Mbour");
// 1725// Get all telecom operators
galsenify.operateurs();
// Get mobile operators only
galsenify.operateursMobiles();
// [{ nom: "Orange", prefixes: ["77", "78"], ... }, ...]
// Find operator by prefix
galsenify.findOperateurByPrefix("77");
// { nom: "Orange", prefixes: ["77", "78"], type: "mobile", ... }
// Find operator by phone number
galsenify.findOperateurByNumber("771234567");
// { nom: "Orange", ... }
galsenify.findOperateurByNumber("76 123 45 67");
// { nom: "Free", ... }// Global search (regions, departments)
galsenify.search("Dakar");
// [{ type: "region", nom: "Dakar", data: {...} }, { type: "department", nom: "Dakar", data: {...} }, ...]
// Find region by code
galsenify.findByCode("DK");
// { nom: "Dakar", code: "DK", population: 4004427, ... }// Get total population (sum of all regions)
galsenify.totalPopulation();
// 18126390
// Get total area (sum of all regions)
galsenify.totalSuperficie();
// 196712
// Get population density by region (hab/km²)
galsenify.density("Dakar");
// 7322
// Get population density by department (hab/km²)
galsenify.densityDepartment("Mbacké");
// 567
// Get national density (hab/km²)
galsenify.nationalDensity();
// 92// Get regions sorted by population (descending)
galsenify.regionsByPopulation();
// [{ nom: "Dakar", ... }, { nom: "Thiès", ... }, ...]
// Get regions sorted by population (ascending)
galsenify.regionsByPopulation("asc");
// Get regions sorted by area
galsenify.regionsBySuperficie();
// Get regions sorted by density
galsenify.regionsByDensity();
// Get departments sorted by population
galsenify.departmentsByPopulation();
// Get departments by region code
galsenify.departmentsByRegion("DK");
// [{ nom: "Dakar", ... }, { nom: "Pikine", ... }, ...]// Get a random region
galsenify.randomRegion();
// { nom: "Kaolack", code: "KL", population: 1336719, ... }
// Get a random department
galsenify.randomDepartment();
// { nom: "Mbour", region: "Thiès", population: 935304, ... }| Category | Count | Source |
|---|---|---|
| Regions | 14 | RGPH-5 2023 |
| Departments | 46 | RGPH-5 2023 |
| Operators | 4 | 2024 |
Galsenify Demo is a demo project to show you how to use the Galsenify package in a Next.js project presented at #LiveKoorGalsenDEV event; you can see the live demo at Galsenify Live Demo.
If you find 🐞 or you have a 💡 about the evolution of this project, you can open an issue. I'm also available on X (Twitter).
Thanks to all contributors 👏🏽
You can also consult the Changelog to see the different changes and evolution between versions.
This package is released under the MIT Licence ✔
