← Projects

Academic project, done in a pair · MSc in Data Science (UOC)

Building a fleet dataset from two public registers

Result
A dataset with the technical and administrative data of 27,364 Spanish vessels, collected from two official websites and published on Zenodo. It is the basis of the later fleet analysis.
Authorship
Shared work with Lucas Zamora Vera: research, code, report and video signed by both.
Project facts and contents

Facts

Type
Assignment 1 of “Data typology and life cycle”, MSc in Data Science (UOC)
Authors
Julio Úbeda Quesada and Lucas Zamora Vera
Sources
European Commission fleet register · Spanish Ministry of Agriculture, Fisheries and Food vessel register
Result
185,354 EU register events · 27,364 Spanish vessels with 16 fields
Tools
Python · Selenium · Requests · BeautifulSoup · pandas
Code
GitHub

What data were needed

To study how the Spanish fleet has changed, we needed each vessel’s length, tonnage, engine power, hull material, home port, register status and fishing category. That information is public, but it is looked up one vessel at a time on the Spanish register website, which requires the vessel’s EU identifier (CFR).

How they were collected

  1. EU register (Selenium)

    An automated browser opens the EU fleet search, selects “EU” and “All Vessels”, runs the search and walks through every results page with the “next” button. Each table row is saved: 185,354 registration, removal or modification events, with flag country, CFR, reference length and power.

  2. List of Spanish vessels

    Vessels under the Spanish flag are filtered from the EU register to get the list of unique CFRs.

  3. Spanish register (Requests and BeautifulSoup)

    For each CFR the ministry search is queried, the vessel record is opened and its label-value pairs are read. The result is saved as one row per vessel.

According to the main script, a full run takes about eight hours: four for the EU register and four for the Spanish records.

How they were structured

Resulting files
FileOne row isMain fields
datos_buques_EU.csvOne EU register eventFlag, type, CFR, event code and date, name, tonnage, length, power
datos_buques_ESP.csvOne Spanish vesselCFR, name, registration, entry date, status, length, tonnage, power, hull, home port, census category

The CFR links both files. The Spanish register fields were saved as they appear on the website, with units inside the text; turning them into numbers and categories was the work of the next assignment.

Problems during extraction

  • Dynamic content. Elements of the EU website were not available when the page loaded; WebDriverWait was used to wait until they were visible or clickable before interacting.
  • Pagination. Walking through the results depends on detecting when the “next” button becomes disabled, and on scrolling to it before clicking.
  • Results-per-page selector. Switching to 100 results per page worked in the notebook but not in the script, so that part was left commented out in the code.
  • Vessels without a record. Some CFRs returned no record in the Spanish register; the script logs them separately instead of stopping.
  • Load on the servers. According to the report, requests were spaced out and limited, and only public information without personal data was accessed.

Its role in the fleet analysis

This project collects the data; the fleet analysis cleans, explores and models them. The analysis repository’s README states that its data folder contains the file produced here, datos_buques_ESP.csv, as input.

Authorship and licence

Shared work

  • Background research, writing, code and video: Julio Úbeda Quesada and Lucas Zamora Vera, according to the report’s contributions table.
  • Data owners: the Spanish Ministry of Agriculture, Fisheries and Food and the European Commission, who must be credited when reusing the data.

Dataset licence

  • The dataset was published under a Creative Commons attribution, non-commercial, share-alike licence, according to the repository README and report.

← Back to home

Ask about my work

Checking the service…

Write any question about my background, projects, education or publications. Answers are based only on the content of this site and link to their sources.

To get started

0 of 500 charactersAnswers generated by a language model from this site. The conversation is not stored.