Skip to content

ccErrors/passport-days

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Passport Stamps Parser

This project processes a list of passport stamps and converts them into periods of stay in different countries.

Input Data Format

The input consists of a list of lines in the following format:

IN RUS 08.03.18
OUT RUS 06.03.18
IN RUS 06.03.18
OUT RUS 24.03.18
...

Where:

  • IN — entry into a country.
  • OUT — exit from a country.
  • Country code (RUS, MNE, BIH, etc.).
  • Date in the format DD.MM.YY.

Comments (e.g., ## PAGE 9) may be present, and exit stamps may be missing.

Output Data Format

After processing the stamps, the program generates periods of stay in each country:

BIH from 15.08.2023 to 19.08.2023, total days: 5
SRB from 19.08.2023 to 26.08.2023, total days: 8
BIH from 26.08.2023 to 29.08.2023, total days: 4
SRB from 29.08.2023 to 18.10.2023, total days: 51
Error: 32 days between 18.10.2023 and 18.11.2023
MNE from 18.11.2023 to 26.11.2023, total days: 9
SRB from 26.11.2023 to 14.12.2023, total days: 19
TRC from 14.12.2023 to 22.12.2023, total days: 9

Features

  • Processes stamps in any order.
  • Handles missing entry/exit stamps.
  • Ignores comments and non-stamp lines.
  • Detects missing periods and warns about data gaps.

How to Use

  1. Prepare a text file with a list of passport stamps.
  2. Run the program.
  3. Get a list of stay intervals in different countries.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages