Python Snippets

The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, dictionaries and date objects.

  • daterange

    Python, Date

    Creates a list of dates between start (inclusive) and end (not inclusive).

  • from_iso_date

    Python, Date

    Converts a date from its ISO-8601 representation.

  • to_iso_date

    Python, Date

    Converts a date to its ISO-8601 representation.

  • days_ago

    Python, Date

    Calculates the date of n days ago from today.

  • days_from_now

    Python, Date

    Calculates the date of n days from today.

  • months_diff

    Python, Date

    Calculates the month difference between two dates.

  • add_days

    Python, Date

    Calculates the date of n days from the given date.

  • days_diff

    Python, Date

    Calculates the day difference between two dates.

  • is_weekday

    Python, Date

    Checks if the given date is a weekday.

  • is_weekend

    Python, Date

    Checks if the given date is a weekend.