CompareHack - Single Digital Gateway 2019
🏆 Project distinguished with the Jury's Coup de Coeur award at the Single Digital Gateway Hackathon in Barcelona, an event organized by the European Commission in collaboration with Garage 48. Read more about it here.
Web searcher to help manufacturers and traders get the rules that apply to their products within the EU.
There are two types of product rules: EU (harmonized) and National (non-harmonized). Since the information is not unified it is difficult for people and businesses to search for the regulations of the products that they are dealing with. CompareHack allows to select any product and two countries and then searches:
- The information available at EU Trade Helpdesk to get the EU legislation.
- The notifications issued by the selected countries to the EU for the national regulations -
Spain
,France
andUnited Kingdom
at the moment. These notifications were provided by the EU Comission and can be found at resources/pdfs/.
In order to make queries relevant CompareHack applies NLP (natural language processing) through the nltk.
A live version of the end result is hosted at Heroku: comparehack.herokuapp.com.
-
Once in comparehack.herokuapp.com, fill every field:
- Product: any product you want.
- Country of destination:
Spain
,France
orUnited Kingdom
. - Additional country:
Spain
,France
orUnited Kingdom
.
-
Click Search to load the results. If the searched product has multiple definitions, a legal notice section will show up.
-
Below will be three blue buttons:
- The first -EU legislation- containing links of the EU Trade Helpdesk about the product requirements.
- The second -Country of destination- showing the PDF's of the notifications for the national regulations from the country of destination to the European Comission.
- The third -Additional country- showing the PDF's of the notifications for the national regulations from the additional country to the European Comission.
-
Under the buttons will be a form with an empty field:
- How has been your experience your far?: once your text is submitted, a list of all past opinions will be shown.
To install CompareHack in your system, make sure Python is installed.
- Clone/fetch/pull the repository to your system.
- It is recommended to run the application through a virtual environment. For example, virtualenv. In a Linux a terminal:
pip3 install virtualenv
virtualenv venv
source venv/bin/activate
- Install the requirements:
pip3 install -r requirements.txt
The code is proven to work with the following package versions:
flask-1.0.3
flask-bootstrap-3.3.7.1
pyyaml-5.1.1
nltk-3.4.3
- Run the application:
python3 app.py
- Open a web browser and go to http://localhost:5000.
Keep in mind that the project was developed at a hackathon in 24 hours. The priority was to get the MVP up and running, so -in benefit of time- some best practices may have not been followed. See Contributing to learn how you could add your bit.
Front-end:
Back-end:
Pull requests are welcomed. Feel free to add the functionalities you wish. There are so many things that could make this project better such as applying error handling, making it scalable to add more country legislations, providing a more deep Opinions section, etc.
This project is under the MIT License.