Download the PHP package nicholasricci/anagrafiche-anpr-istat without Composer
On this page you can find all versions of the php package nicholasricci/anagrafiche-anpr-istat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nicholasricci/anagrafiche-anpr-istat
More information about nicholasricci/anagrafiche-anpr-istat
Files in nicholasricci/anagrafiche-anpr-istat
Package anagrafiche-anpr-istat
Short Description Serialized data of ANPRR and ISTAT
License CC-BY-4.0
Informations about the package anagrafiche-anpr-istat
nicholasricci/anagrafiche-anpr-istat
Official Italian Belfiore code list (cadastral code) which represents a comune.
Update
To update the database, you have to clone the project and install the
dev-dependencies
. Then, the console will be available to download and dump
the normalized datasets:
and you are golden.
Usage
Installation
PHP
Serialized data
You can get the up to date serialized database of comunes and
foreign regions in CSV, JSON, XML and YAML inside the dist/
folder in any
language.
API
PHP
There is a nicholasricci\AnagraficheANPRISTAT\Collection\ComuneCollection
and a
nicholasricci\AnagraficheANPRISTAT\BelfioreCode\Collection\RegionCollection
to get an ArrayCollection
filled with both databases. This enables you to directly iterate through them
like an array, or even perform queries of columns.
Querying
You can fetch a comune by its registry_code
(also know as cadastral code or
belfiore code).
This would get you a new collection with the matching registry codes. As you can see there is a comune called "ABANO" discontinued in 1924-11-13, and an active comune called "ABANO TERME":
You may want to find an active comune by his registry_code
. To archieve this,
just play with the
Doctrine Collections docs
and it will grab for you your desired criteria:
Ordering
Ordering can be done too through Doctrine Collections. Please refer to their docs to see the available API:
Attribution
Forked by devnix/belfiore-code,