Easy.Tools.GoogleCalendarEvents 1.0.15

dotnet add package Easy.Tools.GoogleCalendarEvents --version 1.0.15
                    
NuGet\Install-Package Easy.Tools.GoogleCalendarEvents -Version 1.0.15
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Easy.Tools.GoogleCalendarEvents" Version="1.0.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Easy.Tools.GoogleCalendarEvents" Version="1.0.15" />
                    
Directory.Packages.props
<PackageReference Include="Easy.Tools.GoogleCalendarEvents" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Easy.Tools.GoogleCalendarEvents --version 1.0.15
                    
#r "nuget: Easy.Tools.GoogleCalendarEvents, 1.0.15"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Easy.Tools.GoogleCalendarEvents@1.0.15
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Easy.Tools.GoogleCalendarEvents&version=1.0.15
                    
Install as a Cake Addin
#tool nuget:?package=Easy.Tools.GoogleCalendarEvents&version=1.0.15
                    
Install as a Cake Tool

Build & Test Build & Release Build & Nuget Publish Release License NuGet

Easy.Tools.GoogleCalendarEvents

A lightweight, high-performance .NET library for accessing public events and holidays from Google Calendar. Designed to be dependency-free on modern .NET and compatible with legacy Frameworks.

Features

  • Zero-Dependency on Modern .NET: Uses System.Text.Json natively on .NET 6+.
  • Broad Compatibility: Supports .NET 6, .NET 7, .NET 8, .NET 9,.NET 10 .NET Standard 2.0/2.1, and .NET Framework 4.7.2+.
  • Simple API: Fetch events with a single asynchronous method call.
  • Strongly Typed: Full object model support for calendar events.
  • Resilient: Includes built-in token support for cancellation.

Installation

Install via NuGet Package Manager Console:

Install-Package Easy.Tools.GoogleCalendarEvents

Or via .NET CLI:

dotnet add package Easy.Tools.GoogleCalendarEvents

Prerequisites

To use this library, you need a Google API Key (no OAuth required for public calendars).

  1. Go to Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Navigate to APIs & Services > Credentials.
  4. Click Create Credentials β†’ API Key.
  5. Enable the Google Calendar API in the "Library" section.

Usage

1. Basic Console Application

using Easy.Tools.GoogleCalendarEvents;

// 1. Setup your credentials
var apiKey = "YOUR_GOOGLE_API_KEY";
var calendarId = "tr.turkish#holiday@group.v.calendar.google.com"; // Example: Turkey Holidays

// 2. Initialize the service
var service = new GoogleEventService(apiKey, calendarId);

try 
{
    // 3. Fetch events
    var events = await service.GetEventsAsync();

    Console.WriteLine($"Found {events.Count} events:");
    foreach (var item in events)
    {
        Console.WriteLine($"- {item.Summary} ({item.Start.Date})");
    }
}
catch (Exception ex)
{
    Console.WriteLine($"Error fetching events: {ex.Message}");
}

2. ASP.NET Core (Dependency Injection)

This library is designed to work seamlessly with HttpClientFactory.

In Program.cs:

using Easy.Tools.GoogleCalendarEvents;

var builder = WebApplication.CreateBuilder(args);

// Register HttpClient and the Service
builder.Services.AddHttpClient<GoogleEventService>(client => 
{
    // Optional: Configure global timeouts or headers here if needed
});

// Register as Singleton or Scoped depending on your needs
builder.Services.AddSingleton(sp => 
    new GoogleEventService(
        "YOUR_API_KEY", 
        "tr.turkish#holiday@group.v.calendar.google.com", 
        sp.GetRequiredService<HttpClient>()
    ));

var app = builder.Build();

You can use any public calendar ID. Here are some common ones for holidays:

Region Language Calendar ID
πŸ‡ΉπŸ‡· Turkey Turkish tr.turkish#holiday@group.v.calendar.google.com
πŸ‡ΉπŸ‡· Turkey English en.turkish.official#holiday@group.v.calendar.google.com
πŸ‡¦πŸ‡Ώ Azerbaijan English en-gb.az#holiday@group.v.calendar.google.com
πŸ‡ΊπŸ‡Έ USA English en.usa#holiday@group.v.calendar.google.com
πŸ‡©πŸ‡ͺ Germany German de.german#holiday@group.v.calendar.google.com

Tip: To find a Calendar ID, go to Google Calendar Settings > Add Calendar > Browse resources of interest, or look at the "Integrate calendar" section of any public calendar settings.


Contributing

Contributions and suggestions are welcome. Please open an issue or submit a pull request.


License

This project is licensed under the MIT License.


Β© 2025 Elmin Alirzayev / Easy Code Tools

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

  • .NETFramework 4.8

  • .NETStandard 2.0

  • .NETStandard 2.1

  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Easy.Tools.GoogleCalendarEvents:

Package Downloads
Easy.Tools.GoogleCalendarEvents.Holidays.Turkiye

A specialized .NET library to fetch official holidays and public events for Turkey (Türkiye) using Google Calendar API.

Easy.Tools.GoogleCalendarEvents.Holidays.Azerbaijan

A dedicated .NET library to fetch official holidays and public events for Azerbaijan using Google Calendar API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.15 204 2/1/2026
1.0.14 213 1/26/2026
1.0.13 100 1/23/2026
1.0.12 370 1/22/2026
1.0.11 332 8/12/2025
1.0.10 200 8/12/2025
1.0.8 545 8/8/2025
1.0.7 176 7/31/2025

-