Note
This library is unofficial and not supported by cist.nure.ua administration. It is developed and maintained by students and the Mindenit Team.
Important
A .NET library for interacting with NURE's schedule (cist.nure.ua). The library provides a convenient API for accessing information about schedules, teachers, groups, and university auditoriums.
The library is available via NuGet. You can install it using one of the following methods:
Using .NET CLI:
dotnet add package Nure.NET
Using Package Manager Console:
Install-Package Nure.NET
- Retrieve list of all university groups
- Retrieve list of teachers
- Retrieve list of auditoriums
- Get schedules for groups, teachers, and auditoriums
- Support for schedule filtering by time period
- Automatic CIST server availability detection
- Handling of incorrect JSON responses from API
using Nure.NET;
using Nure.NET.Types;
// Get all groups
List<Group>? groups = Cist.GetGroups();
foreach (var group in groups)
{
Console.WriteLine($"ID: {group.Id}, Name: {group.Name}");
}
// Get data in CIST format
string cistJson = Cist.GetGroups(true);
using Nure.NET;
using Nure.NET.Types;
// Get all teachers
List<Teacher>? teachers = Cist.GetTeachers();
foreach (var teacher in teachers)
{
Console.WriteLine($"ID: {teacher.Id}");
Console.WriteLine($"Full Name: {teacher.FullName}");
Console.WriteLine($"Short Name: {teacher.ShortName}");
}
using Nure.NET;
using Nure.NET.Types;
// Get all auditoriums
List<Auditory>? auditories = Cist.GetAuditories();
foreach (var auditory in auditories)
{
Console.WriteLine($"ID: {auditory.Id}, Name: {auditory.Name}");
}
using Nure.NET;
using Nure.NET.Types;
// Get group schedule
List<Event>? groupSchedule = Cist.GetEvents(
type: EventType.Group,
id: 10304333 // Group ID
);
// Get schedule for specific period
List<Event>? periodSchedule = Cist.GetEvents(
type: EventType.Group,
id: 10304333,
startTime: 1693170000, // Unix timestamp start period
endTime: 1694811599 // Unix timestamp end period
);
// Get teacher schedule
List<Event>? teacherSchedule = Cist.GetEvents(
type: EventType.Teacher,
id: teacherId
);
// Get auditory schedule
List<Event>? auditorySchedule = Cist.GetEvents(
type: EventType.Auditory,
id: auditoryId
);
// Processing the retrieved schedule
foreach (var event in groupSchedule)
{
Console.WriteLine($"Class #{event.NumberPair}");
Console.WriteLine($"Subject: {event.Subject?.Title}");
Console.WriteLine($"Type: {event.Type}");
Console.WriteLine($"Auditory: {event.Auditory}");
Console.WriteLine($"Start: {DateTimeOffset.FromUnixTimeSeconds((long)event.StartTime)}");
Console.WriteLine($"End: {DateTimeOffset.FromUnixTimeSeconds((long)event.EndTime)}");
// Teachers
foreach (var teacher in event.Teachers)
{
Console.WriteLine($"Teacher: {teacher.FullName}");
}
// Groups
foreach (var group in event.Groups)
{
Console.WriteLine($"Group: {group.Name}");
}
}
Represents one class in the schedule:
public class Event
{
public int? NumberPair { get; set; } // Class number
public Subject? Subject { get; set; } // Subject
public long? StartTime { get; set; } // Start time (Unix timestamp)
public long? EndTime { get; set; } // End time (Unix timestamp)
public string? Auditory { get; set; } // Auditory
public string? Type { get; set; } // Class type (Lc, Pr, Lb, etc.)
public List<Teacher>? Teachers { get; set; } // List of teachers
public List<Group>? Groups { get; set; } // List of groups
}
Subject information:
public class Subject
{
public int? Id { get; set; } // Subject ID
public string? Title { get; set; } // Full name
public string? Brief { get; set; } // Short name
}
Entity types for schedule retrieval:
public enum EventType
{
Group = 1, // Group schedule
Teacher = 2, // Teacher schedule
Auditory = 3 // Auditory schedule
}
The library uses exception mechanism for error handling. All methods can throw an Exception
with detailed problem description. It's recommended to wrap method calls in try-catch blocks:
try
{
var groups = Cist.GetGroups();
// Process data
}
catch (Exception e)
{
Console.WriteLine($"Error while getting groups: {e.Message}");
}
All main methods have overloads that return data in CIST format:
// Get groups in CIST format
string cistGroupsJson = Cist.GetGroups(true);
// Get teachers in CIST format
string cistTeachersJson = Cist.GetTeachers(true);
// Get auditoriums in CIST format
string cistAuditoriesJson = Cist.GetAuditories(true);
The library automatically checks the availability of CIST servers (cist.nure.ua and cist2.nure.ua) and uses the one that responds faster.
We welcome contributions to the library! If you found a bug or have ideas for improvements, please:
- Fork the repository
- Create a branch for your changes
- Make the necessary changes
- Create a pull request with description of changes
This project is distributed under the GNU GPL v3 license. See the LICENSE file for more details.