Skip to content

Commit 92acb53

Browse files
authored
Merge pull request #236 from blackne0n/add-italian-cap
Add italian-cap package
2 parents 60824db + eb8fb5a commit 92acb53

4 files changed

Lines changed: 9381 additions & 0 deletions

File tree

packages/italian-cap/0.1.0/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Alberto Giardino
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.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Italian ZIP Codes to City Names
2+
3+
An [espanso](https://espanso.org) package that expands an Italian postal code (CAP)
4+
into the code followed by its comune.
5+
6+
```
7+
:00184 → 00184 Roma
8+
:20121 → 20121 Milano
9+
```
10+
11+
The package ships **4657 triggers**, one per distinct CAP.
12+
13+
## Usage
14+
15+
Type a colon followed by the five-digit CAP `:00184` and espanso replaces it
16+
with `00184 Roma`.
17+
18+
## Data
19+
20+
Triggers are generated from the [ISTAT](https://www.istat.it/note-legali/)-derived list of
21+
Italian comuni with their CAP.
22+
23+
### One comune per CAP
24+
25+
The source data is a many-to-many mapping: a comune can hold several CAPs, and a
26+
CAP can cover several comuni. Espanso only ever fires the *first* match for a
27+
duplicated trigger, so a file containing every row would carry thousands of dead
28+
entries.
29+
30+
Each CAP therefore resolves to a single comune, chosen by:
31+
32+
1. the comune flagged as capoluogo, if one of the candidates is;
33+
2. otherwise the alphabetically first comune.
34+
35+
That collapses 8456 source rows into 4657 usable matches. If you need a specific
36+
one of the shared comuni instead, override it in your own `match/base.yml`.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: "italian-cap"
2+
title: "Italian ZIP Codes to City Names"
3+
description: Expands an Italian postal code (CAP) into the code followed by its comune. Type a colon plus the five-digit CAP, e.g. ":00184" becomes "00184 Roma". Ships 4657 triggers, one per distinct CAP.
4+
version: 0.1.0
5+
author: blackne0n
6+
tags: ["zip", "italian", "postal-codes"]
7+
homepage: "https://github.com/blackne0n/hub/tree/add-italian-cap"

0 commit comments

Comments
 (0)