Skip to main content

A tool to calculate how many days an individual has been in Schengen countries out of a specified 180-day period

Project description

Schengulator

Documentation Status PyPI version

Schengulator is a tool to calculate how many days an individual has been in Schengen countries out of a specified 180-day period.

The Schengen Visa Rule

The schengulator determines the number of days spent and remaining based on the 90/180-day Schengen Visa Rule, where an individual can stay in Schengen countries for 90 days out of an 180 day time period. The 180-day window is defined as:

"The 180-day period keeps rolling. Therefore, anytime you wish to enter the Schengen, you just have to count backwards the last 180 days, and see if you have been present in the Schengen for more than 90 days throughout that period" (as stated here)

Therefore, schengulator calculates the days spent in the Schengen area based on the 180 days prior to a user-defined date.

For more on the Schengen Visa Rule, see these links:

There are many Schengen stay calculators available online or as apps. The purpose of schengulator is to create a workflow that is transparent (i.e. you can see the workings) and non-repetitive (i.e. you don't have to log each and every one of your trips to the Schengen area every time you need to use the tool).

Quickstart

To get started, install schengulator using pip.

pip install schengulator

Check that the package works by opening a python console and importing it.

python3
import schengulator

There are a number of examples in the scripts provided in the examples directory of the schengulator Github repository to test the installation and see how it works.

from schengulator.schengulator import SchengenStay, /
     checkStay, checkDaysLeft, staysFromCSV

# Example 1. Check Schengen stays from specific date 
# using SchengenStay obj

# Initialise Schengen evaluation from 01/05/2022
ss = SchengenStay('2022-05-01')

# Add all stays
ss.addStay('2021-07-01', '2021-07-15')      # Greece
ss.addStay('2021-09-03', '2021-09-08')      # Netherlands
ss.addStay('2021-09-20', '2021-09-25')      # Belgium
ss.addStay('2021-12-20', '2022-01-03')      # Belgium
ss.addStay('2022-04-18', '2022-05-01')      # Italy

# Check number of days spent in Schengen on 01/05/2022
flag = ss.checkDays()
if flag==True:
    print('All okay!')
    
 
    
# Example 2. Check Schengen stays for all dates in 
# proposed future stay

# Create list of all stays
trips = [['2021-07-01','2021-07-15'],     # Greece
        ['2021-09-03', '2021-09-08'],     # Netherlands
        ['2021-09-20', '2021-09-25'],     # Belgium
        ['2021-12-20', '2022-01-03'],     # Belgium
        ['2022-04-18', '2022-05-01']]     # Italy

# Check if new stay is within Schengen 90-day limits
checkStay(['2022-04-18', '2022-05-01'], trips[:-1])

# See how many days left in Schengen after proposed trip
checkDaysLeft(trips)



# Example 3. Check Schengen stays from CSV file

# Import stays from csv file
infile = 'examples/example_stays.csv'
csv_trips = staysFromCSV(infile)

# Check if new trip is within Schengen 90-day limits
new_trip = ['2022-01-05', '2022-01-20']
checkStay(new_trip, csv_trips)

# Check how many days left in Schengen after new trip
csv_trips.append(new_trip)
checkDaysLeft(csv_trips, d=new_trip[1]) 

Acknowledgements

This tool was inspired by these related python repositories:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schengulator-1.0.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

schengulator-1.0.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file schengulator-1.0.0.tar.gz.

File metadata

  • Download URL: schengulator-1.0.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for schengulator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1ac231622b27fa2180093afebb2fa5125b1153afebb4814649fc58b71968727c
MD5 f6266997304b00c089fb1aa4c001bad3
BLAKE2b-256 e613e24fa952d02df8488db022ce79188f5a13a46165774b15cb8ec88dc3d9d8

See more details on using hashes here.

File details

Details for the file schengulator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: schengulator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for schengulator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdd02e7e8c0b511e578cd759b8e3a6408233fdab094a4a61a558e772f755b7d1
MD5 d8956a45f7f0c2eb124fa375aea3506b
BLAKE2b-256 4516717976261b678b2be9ceb039e45115a9c5ae6fe5dacabb31c4d57b74803d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page