Also note that the databse is currently not being updated on a daily basis, so the data might not be up-to-date.
Download a zip file containing the whole repository and store it into a folder on your PC. You should preferably use a virtual environment.You will need to create a config_data.py
file in main folder with the following variables:
secret_key
- Your secret key, for examplesecret_key = "my-secret-password"
db_address
- The local address of the database. I recommend using the following, if you want to run the application locallydb_address = 'sqlite:///justice.db'
See requirements.txt
for required packages.
Run python justice_build.py
which will download all the source files, create an SQLite database and parse the downloaded data into the database. Note that after the downloaded data are uncompressed, they are around 13 GB and the database file has around 3.6 GB. It takes approximately 1 hour to download the data and build the database.
Once the database is built, run python main.py
and open http://127.0.0.1:5000
You will be greeted with a search form that is described below.
The form allows you to search for companies registered in the Commercial Register by the following properties:
- Company name
- Identification number
- Municipality
- Street name
- Court register section (oddíl)
- Court register file No. (vložka)
- Legal form
- Court of registration
- Active insolvency record
- Date of registration
In the fields where you fill-in input data, you can also select one of the following options:
- Your input can be anywere in the result. For example, if you input Trade as a company name, the application will find and return both SILOMAN Trade a.s. and Trade Bridge a.s.
- The result must start with your input. For example, if you input Trade as a company name, the application will find and reutrn only Trade Bridge a.s., but not SILOMAN Trade a.s.
- The result and your input must match. For example, if you input Trade as a company name, the application will neither SILOMAN Trade a.s. nor Trade Bridge a.s.
In addition, you can also select one of the following options:
- Your input must match the company data that are up-to-date. For example, if you input Trade as a company name, a company that used to be names Global Trade, a.s., but had since been renamed, will not be found.
- Your input may match the company data that are no longer up-to-date. For example, if you input Trade as a company name, a company that used to be names Global Trade, a.s., but had since been renamed, will be found.
The form allows you to search for natural persons registered in the Commercial Register as members of executive bodies, members of supervisory boards, prokurists, shareholders in a limited liability companies, sole shareholders in a joint stock companies. The form allows you to search by the following properties:
- First name
- Surname
- Date of birth
In the fields where you fill-in input data, you can also select one of the following options:
- Your input can be anywere in the result. For example, if you input Nová as a surname, the application will find and return both Novák and Kuhnová
- The result must start with your input. For example, if you input Nová as a surname, the application will find and reutrn only Novák, but not Kuhnová
- The result and your input must match. For example, if you input Nová as a surname, the application will neither Novák nor Kuhnová
In addition, you can also select whether the application shall return only the persons who are still active in the company or whether it shall reutrn also those that are no longer active.
You will be greeted with the following search form:The form allows you to search for legal persons registered in the Commercial Register as members of executive bodies, members of supervisory boards, shareholders in a limited liability companies, sole shareholders in a joint stock companies. The form allows you to search by the following properties:
- Company name
- Identification No. (for Czech companies)
- Foreign registration No. (for foreign copmpanies) --- this is yet to be implemented
In the fields where you fill-in input data, you can also select one of the following options:
- Your input can be anywere in the result. For example, if you input Trade as a company name, the application will find and return both SILOMAN Trade a.s. and Trade Bridge a.s.
- The result must start with your input. For example, if you input Trade as a company name, the application will find and reutrn only Trade Bridge a.s., but not SILOMAN Trade a.s.
- The result and your input must match. For example, if you input Trade as a company name, the application will neither SILOMAN Trade a.s. nor Trade Bridge a.s.
In addition, you can also select whether the application shall return only the legal persons who are still active in the company or whether it shall reutrn also those that are no longer active.
Once you hit the search button, you the results will be displayed to you. Several examples are displayed below.A stadard result when you search by company properties.
If a company has an active insolvency record, it will be highlighted in red and the relevant insovlency notes will be added.
A standard result when you search for a natural person active in a company. It firstly displays the natural person's identification details and then the identification details of the company in which such person is or was active.
A standard result when you search for a legal person active in a company. It firstly displays the legal person's identification details and then the identification details of the company in which such person is or was active.
The application also allows you to display detailed data about each company in two forms:- Historical extract, showing all data, including those that are no longer relevant
- Current extract, showing only the up-to-date data
A historical extract can look something like this. The data that are no longer up-to-date are underlined.
A current extract looks like this.
You can also explore some interesting information about the data stored in the Commercial register. You can find, for example, a list of the oldest existing companies or addresses at which the most companies have their registered office. Go and check it yourselves :) This is an early prototype not yet suitable for production deployment as there are multiple issues that need to be resolved. The main issues are as follows:- Czech diacritics are not processed properly and based on my initial research, I suspect that this is due to SQLite limitations.
- Not all information available in the open data sets are stored in the application database.
- The underlying code should be refactored to remove excessive duplications.
- I should unify the naming of functions and variables. Now, it is a mixtrue of Czech and English language, partly because it uses some Czech legal terms and the same variables that are used in the source open data.