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
<PackageReference Include="Easy.Tools.GoogleCalendarEvents" Version="1.0.15" />
<PackageVersion Include="Easy.Tools.GoogleCalendarEvents" Version="1.0.15" />
<PackageReference Include="Easy.Tools.GoogleCalendarEvents" />
paket add Easy.Tools.GoogleCalendarEvents --version 1.0.15
#r "nuget: Easy.Tools.GoogleCalendarEvents, 1.0.15"
#:package Easy.Tools.GoogleCalendarEvents@1.0.15
#addin nuget:?package=Easy.Tools.GoogleCalendarEvents&version=1.0.15
#tool nuget:?package=Easy.Tools.GoogleCalendarEvents&version=1.0.15
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.Jsonnatively 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).
- Go to Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to APIs & Services > Credentials.
- Click Create Credentials β API Key.
- 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();
Popular Holiday Calendar IDs
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 | Versions 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. |
-
.NETFramework 4.7.2
- Newtonsoft.Json (>= 13.0.4)
-
.NETFramework 4.8
- Newtonsoft.Json (>= 13.0.4)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.4)
-
.NETStandard 2.1
- System.Text.Json (>= 10.0.2)
-
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.
-