@geoalgeria/poste 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yasser's Studio (https://yasser.studio)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # @geoalgeria/poste
2
+
3
+ Algeria **post offices** and **ATMs** with real postal codes, bilingual
4
+ (French / Arabic) names, geographic coordinates, and commune/wilaya linkage.
5
+
6
+ | Dataset | Count | Notes |
7
+ | --- | --- | --- |
8
+ | Post offices | **3,908** | each with its own postal code (`cp`) |
9
+ | ATMs | **2,026** | Algérie Poste GAB network |
10
+ | Distinct postal codes | **3,908** | one per office |
11
+
12
+ ## Source
13
+
14
+ Data is sourced from **Algérie Poste** via the public BaridiMap API
15
+ (<https://baridimap.poste.dz>):
16
+
17
+ - `GET https://baridimap-api.poste.dz/api/postoffices`
18
+ - `GET https://baridimap-api.poste.dz/api/atms`
19
+
20
+ Run `npm run fetch` (or `node scripts/fetch.mjs`) to regenerate every output
21
+ from the live API. The same run also mirrors the data into the sibling
22
+ `geoalgeria` package at `packages/dataset/data/poste/`, so the two never drift —
23
+ this package is the canonical source. Re-fetch periodically — Algérie Poste
24
+ updates offices and, eventually, the post-2025 wilaya reorganization (BaridiMap
25
+ currently still files offices under the 58-wilaya scheme, so new wilayas 59–69
26
+ appear under their mother wilaya).
27
+
28
+ ## Files
29
+
30
+ ```
31
+ data/
32
+ postoffices.json # 3908 offices (array)
33
+ atms.json # 2026 ATMs (array)
34
+ metadata.json # source, counts, generated_at
35
+ csv/postoffices.csv
36
+ csv/atms.csv
37
+ geojson/postoffices.geojson # Point features (offices with coordinates)
38
+ geojson/atms.geojson
39
+ ```
40
+
41
+ > GeoJSON files include only records that have coordinates — a handful of
42
+ > offices and ATMs report no `lat`/`lng` and are omitted from the GeoJSON
43
+ > outputs (but remain in the JSON/CSV). ATM records have no `commune_code`
44
+ > (the source API does not provide one).
45
+
46
+ ## Record shapes
47
+
48
+ **Post office**
49
+
50
+ ```json
51
+ {
52
+ "id": 1,
53
+ "name": "ADRAR RP",
54
+ "name_ar": "أدرار م ر",
55
+ "class": "CE",
56
+ "postal_code": "01000",
57
+ "postal_code_old": null,
58
+ "address": "ADRAR CENTRE RUE DES MARYTIM",
59
+ "commune_code": "0101",
60
+ "commune_fr": "ADRAR",
61
+ "commune_ar": "أدرار",
62
+ "wilaya_code": "01",
63
+ "wilaya_fr": "ADRAR",
64
+ "wilaya_ar": "أدرار",
65
+ "lat": 27.8708439,
66
+ "lng": -0.2871417
67
+ }
68
+ ```
69
+
70
+ `class` is the office category (`CE`, `R1`–`R4`, `HC`, `GA`). `commune_code`
71
+ is Algérie Poste's 4-digit commune code, which joins to GeoAlgeria's
72
+ `code_commune` field.
73
+
74
+ **ATM**
75
+
76
+ ```json
77
+ {
78
+ "id": "1165",
79
+ "name": "AOULEF",
80
+ "status": "1",
81
+ "postal_code": "01003",
82
+ "postal_code_old": null,
83
+ "address": null,
84
+ "commune_fr": "AOULEF",
85
+ "commune_ar": "أولف",
86
+ "wilaya_code": "01",
87
+ "wilaya_fr": "ADRAR",
88
+ "wilaya_ar": "أدرار",
89
+ "lat": 26.9728317,
90
+ "lng": 1.07709
91
+ }
92
+ ```
93
+
94
+ ## Usage
95
+
96
+ ```js
97
+ import poste from "@geoalgeria/poste";
98
+
99
+ const offices = poste.postOffices(); // 3908
100
+ const banks = poste.atms(); // 2026
101
+
102
+ // All post offices in a commune (joins GeoAlgeria code_commune -> commune_code)
103
+ const inCommune = offices.filter((o) => o.commune_code === "1731");
104
+ ```
105
+
106
+ Or load a specific format directly: `@geoalgeria/poste/data/geojson/atms.geojson`.
107
+
108
+ ## License & attribution
109
+
110
+ Code is MIT. The underlying data is © **Algérie Poste** and is redistributed
111
+ here for reference and to power [GeoAlgeria](https://geoalgeria.com). Verify
112
+ against Algérie Poste for authoritative, real-time information.