They collected for everyone "Habrom" the reference book "By whom it was issued ..." for passports. Download to health
From a couple of months ago, we experimented: will it be possible to collect a suitable directory of units issuing Russian passports at Habr ? The thing is useful: many people need this data, there is no canonical source, and the existing ones are very so-so.
And you know, everything worked out. The usable directory is ready, you can download and use. We also made tips that speed up the entry of units into forms.
"Naked" CSV - in the public domain
The compiled and cleaned reference we posted on GitHub. Inside, everything is simple, CSV with two fields:
- department code;
- unit name.
Lies here github.com/hflabs/fms-unit/releases/latest .
There are also ready-made tips for input forms (moreover, free)
We gathered units to make a ready-made service - tips for input forms. And here they are ready.
“Tips” DaData.ru can be integrated into the site, CRM or CMS and be considered a caring fellow: the user just needs to enter the unit code, and the name will fill the service.
Everyone seems to hate filling out the unit name. We tried to alleviate the suffering of people.
Also, "Tips" pull the region and type of unit out of code, sometimes conveniently. Here is a brief specification of the answer.
Title | Description |
---|---|
value | Single line value (as shown in the prompt list) |
data.code | Unit Code |
data.name | The name of the unit in the instrumental case ("who issued it?") |
data.region_code | Region code |
data.type | Type of unit:
|
Details are at dadata.ru/suggestions/outward/fms_unit/ .
"Habr" helped a lot with data
The first question of those who hear about the project: "Really, through Habr, have you collected it?" Not only "Habr" helped, but the contribution of the hawkers is great and extensive. We are grateful and a little surprised: the first time we turned to the community, and immediately such a result.
Initially, we had some developments. But, firstly, far from a complete reference. Secondly, I wanted to check how adequate the data is for real passports.
Many sent units from their passports through the collection form when we threw a cry. They sent one and five to ten records each. Heroes who are not too lazy to drive all this with their hands - respect.
Three people offered in a personal database of respectable size. Friendly and free.
Those who are worried about security: all directories were sent anonymously, not a byte of personal data.
Such gifts significantly moved things forward. As a result, after three weeks we collected the volume from which it is not a shame to make a product suitable for industrial use.
The path to success - “A bunch of raw data + 300 regekspov + a little pitonochki”
Thus, the raw data in the hands of produktovoda "dadati» nalgeon . He described further dances with a quote from the headline. All that we have collected has gone through a series of wonderful transformations.
To start, normalized the names of units. Here I had to fervently work with a file. For example, in the “live” passports, the numbers of the territorial units are indicated with “No.”: “TP No. 1 in G. Khimki ...”. The same is in the majority of the collected directories, except for one - it contains all numbers without a "No": "TP 1 in G. Khimki ...". I had to embed.
The years collapsed. In several directories, the names of units are “blurred” by year, even when they do not change with time. We combined these records, tying them to a period: in the example above, out of four records, we got one with dates “2007-2010”.
500-168,ОТДЕЛЕНИЕМ УФМС РОССИИ ПО МОСКОВСКОЙ ОБЛ. В Г. ТРОИЦКЕ,2007
500-168,ОТДЕЛЕНИЕМ УФМС РОССИИ ПО МОСКОВСКОЙ ОБЛ. В Г. ТРОИЦКЕ,2008
500-168,ОТДЕЛЕНИЕМ УФМС РОССИИ ПО МОСКОВСКОЙ ОБЛ. В Г. ТРОИЦКЕ,2009
500-168,ОТДЕЛЕНИЕМ УФМС РОССИИ ПО МОСКОВСКОЙ ОБЛ. В Г. ТРОИЦКЕ,2010
We collected another reference book - “2018+”. In 2018, a coup occurred - now the name of the “supreme” department of the Ministry of Internal Affairs in the region is not written in the passports. Therefore, in a document issued in the Krasnoyarsk Territory, regardless of the code, they indicate “GU of the Ministry of Internal Affairs of Russia across the Krasnoyarsk Territory”.
We took all the collected codes, divided by regions and generated the same names for them in the style of 2018. The names were taken from the collected directories, something had to be searched on the Internet. It turned out something like that. The years were removed. It turned out that there was a perfect mess in the directories: somewhere, there are years, somewhere not. It remains either everywhere to remove the years for a more complete reference, or to leave only units over the years for the sake of it is not clear what. Chose a more complete reference. Integrated Directories
240-001,ГУ МВД РОССИИ ПО КРАСНОЯРСКОМУ КРАЮ,2018
240-002,ГУ МВД РОССИИ ПО КРАСНОЯРСКОМУ КРАЮ,2018
240-003,ГУ МВД РОССИИ ПО КРАСНОЯРСКОМУ КРАЮ,2018
, data in ecstasy merged together. They rubbed the result thoroughly with a rag, combed it and reminded it: for example, “RA”, where necessary, was turned into the “Republic of Altai” and a dozen more such changes were made.
And now, the guide is ready. Use it, you did it for yourself (in fact, you did it for yourself :).
A couple of subtleties for corrosive
There are many entries in the directory with the same unit codes. This is due to the fact that in different years in the passports the spelling of the same unit was different. We combined similar options, but left very different ones: let the user choose how he has it in the document.
It may turn out that your passport and directory are written a little differently. Without minimal normalization, each unit would have such a bunch of similar options that you could find the right one. Therefore, we reduced the “DEPARTMENT OF INTERNAL AFFAIRS” to “ATC”, “CITIES” and “GOR.” - to “G.”, “DEPARTMENT OF PASSPORT AND VISA SERVICE” - to “OVPS”, etc.
If you start to type the name, "Tips" will also contribute
But! No law or by-law requires that the name of the unit in the documents letter by letter coincide with the option in the passport. Abbreviations and omissions are allowed. The main thing is that the other details are approximately similar and the same: the series, number, date, unit code.
Errors can be reported to us dadata.ru/fix/fms . Indicate the code and name of the problem record, and write in the comment what is wrong. Correct and lay out an updated guide for everyone. Or send pool requests to GitHub.
Naturally, you can correct CSV with your hands if you have a bare manual without "Tips". But it is not clear how everything will stall if you ever take the next version of the directory from us.
In general, use your health:
If you share the article, help people who are looking for a directory of units from passports. Suffering sufferers, they will be grateful.