NeisClient class
Reads school data from the NEIS open API (open.neis.go.kr).
An API key is optional: NEIS answers a limited number of requests without one, which is enough to try things out. Register a key for regular use.
final neis = NeisClient();
final schools = await neis.schools(name: '서울고등학교');
final meals = await neis.meals(schools.first, date: DateTime.now());
neis.close();
Constructors
- NeisClient({String? apiKey, Client? client, Uri? endpoint, Duration timeout = const Duration(seconds: 10), int pageSize = 100})
- Creates a client.
Properties
- apiKey → String?
-
NEIS API key, or
nullto call without one.final - endpoint → Uri
-
Base address of the NEIS services.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- pageSize → int
-
Rows per request, at most 1000.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
Time limit for each request.
final
Methods
-
academies(
{required String officeCode, String? name, String? district, String? realm, String? level, String? courseName, String? registrationNumber, int maxPages = 5}) → Future< List< NeisAcademy> > - Searches 학원 and 교습소 registered with one office of education.
-
call(
NeisService service, Map< String, Object?> params, {int? rows, int maxPages = 5}) → Future<List< NeisRow> > - Calls any NEIS service by name and returns its rows.
-
classes(
NeisSchool school, {String? year, String? grade, int maxPages = 5}) → Future< List< NeisClass> > - Reads the classes of a school for a school year.
-
classrooms(
NeisSchool school, {String? year, String? semester, String? grade, String? departmentName, int maxPages = 5}) → Future< List< NeisClassroom> > - Reads the classrooms a school's timetable is taught in.
-
close(
) → void - Closes the HTTP client this instance created. An injected client is left open for its owner.
-
majors(
{NeisSchool? school, String? officeCode, String? trackName, String? dayNightName, int maxPages = 5}) → Future< List< NeisMajor> > -
Reads the departments (학과) of a school, or of a whole office of
education when
schoolis omitted. -
meals(
NeisSchool school, {DateTime? date, DateTime? from, DateTime? to, int maxPages = 5}) → Future< List< NeisMeal> > -
Reads school meals for one day, or for a range when
fromandtoare given. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rawRows(
String service, Map< String, Object?> params, {int? rows, int maxPages = 5}) → Future<List< Map< >String, Object?> > - Calls any NEIS service and returns its rows.
-
schedule(
NeisSchool school, {DateTime? date, DateTime? from, DateTime? to, String? year, int maxPages = 5}) → Future< List< NeisScheduleEvent> > - Reads the school calendar for a day or a range.
-
schools(
{String? name, String? officeCode, String? schoolCode, String? region, int maxPages = 5}) → Future< List< NeisSchool> > - Searches schools by name, region, or office of education.
-
timetable(
NeisSchool school, {DateTime? date, DateTime? from, DateTime? to, String? grade, String? className, String? year, String? semester, NeisSchoolKind? kind, bool archived = false, int maxPages = 5}) → Future< List< NeisLesson> > - Reads a class timetable.
-
toString(
) → String -
A string representation of this object.
inherited
-
tracks(
{NeisSchool? school, String? officeCode, String? dayNightName, int maxPages = 5}) → Future< List< NeisTrack> > -
Reads the tracks (계열) of a school, or of a whole office of education
when
schoolis omitted.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited