{"id":20520944,"url":"https://github.com/dmitrymyadzelets/italia","last_synced_at":"2026-05-29T12:31:39.158Z","repository":{"id":70114985,"uuid":"436998322","full_name":"DmitryMyadzelets/italia","owner":"DmitryMyadzelets","description":"CAP, comuni, città metropolitane, province e regioni - JSON. 2021","archived":false,"fork":false,"pushed_at":"2022-11-17T14:04:52.000Z","size":1193,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T00:26:01.169Z","etag":null,"topics":["cap","italia","italy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DmitryMyadzelets.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-10T14:00:32.000Z","updated_at":"2022-01-05T15:25:16.000Z","dependencies_parsed_at":"2023-06-18T14:26:26.845Z","dependency_job_id":null,"html_url":"https://github.com/DmitryMyadzelets/italia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DmitryMyadzelets/italia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryMyadzelets%2Fitalia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryMyadzelets%2Fitalia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryMyadzelets%2Fitalia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryMyadzelets%2Fitalia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DmitryMyadzelets","download_url":"https://codeload.github.com/DmitryMyadzelets/italia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DmitryMyadzelets%2Fitalia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33652979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cap","italia","italy"],"created_at":"2024-11-15T22:24:45.948Z","updated_at":"2026-05-29T12:31:39.140Z","avatar_url":"https://github.com/DmitryMyadzelets.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Italy - Administrative Structure\n[Italstat](https://www.istat.it/) - Unità amministrative territoriali: comuni, città metropolitane, province e regioni\n\nThe latest data from November 17, 2022.\n\n## Intro\nItaly is subdivided into regions. Each region is subdivided into provinces and\nmetropolises. Finaly, the later ones are subddivided into communes. I.e.:\n```\nItaly := { Regions }\nRegion := { Provinces and Metropolises }\nProvince or Metropolis := { Comunes  }\n```\n\nIn dicember 2021 the amount of entities is following:\n```\n|Regions| = 20\n|Provinces| = 93\n|Metropolises| = 14\n|Communes| = 7904\n```\n\nThe administrative structure is constantly evolving. This project aims to\ncreate tools to extract some usefull information in `JSON` format from the source data.\n\n## Tools\nAssume you have downloaded `zip` file, then extracted and (optionally) decoded `csv` file to\nthe `csv/data.csv` file. Then you can run the commands:\n* `node tools/convert` - Convert `csv/data.csv` file to `json/data.json`\n* `node tools/extract/italy \u003e json/italy.json` - Extract names of regions, provinces and comunes as JSON\n\n## Extracted data\n* `json/italy` - Tree-like structure of regions, provinces and comunes\n* `json/postcodes` - Postal codes (CAP)\n\nThe `json/italy` file includes ids for each administrative entity. The ids make\nsence when you organize data from different sources which may have different\nnames for same entities. We use cadastral code for the comunes, two-letter\nabbreviation for the provinces and origianal numeric codes for the regions as\nids.\n\nEdit the code, create your own tool and get data you need!\n\n## Data Sources\nThe original data were downloaded [from\nIstat](https://www.istat.it/it/archivio/6789) as a [zip file](https://www.istat.it/storage/codici-unita-amministrative/Elenco-codici-statistici-e-denominazioni-delle-unita-territoriali.zip). It contains `xls` and `csv` versions of the data. We use `csv` as a source. \n\nNotes about Istat:\n* The source file may have `cp1252` encoding. You can convert it to\n`utf8` on Linux: `iconv -f cp1252 -t utf8 source \u003e destination`.\n* There are strings containing the new line character `\\n`. Some programs delete it when export `xls` file to `csv`. It may affect the keys in JSON objects.\n\nThe postcodes are collected from different public sources, and merged to\na single file. The names of administrative entities in the file are equal to the ones used\nby Istat.\n\nOther data sources:\n* [Poste Italiane](https://www.poste.it/cap.html)\n* [nonsoloCAP](https://www.nonsolocap.it/)\n\n### What's in the data? \nThe `data.json` file contains all the data from the source. It's an one-dimensional array of objects as e.g.:\n```js\n{\n  \"Codice Regione\": \"01\",\n  \"Codice dell'Unità territoriale sovracomunale \\n(valida a fini statistici)\": \"201\",\n  \"Codice Provincia (Storico)(1)\": \"001\",\n  \"Progressivo del Comune (2)\": \"001\",\n  \"Codice Comune formato alfanumerico\": \"001001\",\n  \"Denominazione (Italiana e straniera)\": \"Agliè\",\n  \"Denominazione in italiano\": \"Agliè\",\n  \"Denominazione altra lingua\": \"\",\n  \"Codice Ripartizione Geografica\": \"1\",\n  \"Ripartizione geografica\": \"Nord-ovest\",\n  \"Denominazione Regione\": \"Piemonte\",\n  \"Denominazione dell'Unità territoriale sovracomunale \\n(valida a fini statistici)\": \"Torino\",\n  \"Tipologia di Unità territoriale sovracomunale\": \"3\",\n  \"Flag Comune capoluogo di provincia/città metropolitana/libero consorzio\": \"0\",\n  \"Sigla automobilistica\": \"TO\",\n  \"Codice Comune formato numerico\": \"1001\",\n  \"Codice Comune numerico con 110 province (dal 2010 al 2016)\": \"1001\",\n  \"Codice Comune numerico con 107 province (dal 2006 al 2009)\": \"1001\",\n  \"Codice Comune numerico con 103 province (dal 1995 al 2005)\": \"1001\",\n  \"Codice Catastale del comune\": \"A074\",\n  \"Codice NUTS1 2010\": \"ITC\",\n  \"Codice NUTS2 2010 (3)\": \"ITC1\",\n  \"Codice NUTS3 2010\": \"ITC11\",\n  \"Codice NUTS1 2021\": \"ITC\",\n  \"Codice NUTS2 2021 (3)\": \"ITC1\",\n  \"Codice NUTS3 2021\": \"ITC11\"\n}\n```\n\nNotes:\n* Some complicated names of regions are established in the [Constiution, article 116](https://www.senato.it/istituzione/la-costituzione/parte-ii/titolo-v/articolo-116).\n* Names of entities may vary even in official documents. So it's better to use\n  the codes assigned to them.\n* The \"Codice Istat\" i.e. \"Codice Comune\" changes when a comune passes from one\n  province to another, so it can't be used to compare data from different time periods.\n* The \"[Codice Catastale](https://it.wikipedia.org/wiki/Codice_catastale)\"\n  seems to be the most appropiate thing to be used as an unique id for the comunes. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitrymyadzelets%2Fitalia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitrymyadzelets%2Fitalia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitrymyadzelets%2Fitalia/lists"}