OpenAPI clients for Swedish National Agency for Education (Skolverket) Open API. Current clients are:
unitsfor School units (skolenheter) and Organizers (huvudmän) information.statisticsfor statistics like national test outcome, quota for students per teacher, certified teachers and planned education events.
Note that the statistics part is not yet implemented due to problems of generating code from the specification.
To use in your project, add to your dependencies section in gleam.toml:
snafe = { git = "https://github.com/karlsson/snafe", ref="main" }import gleam/httpc
import gleam/option.{None}
import gleam/result
import snafe/units
import snafe/units/operations
/// An example of the project in use
pub fn main() -> Nil {
let request =
units.base_request("")
|> operations.get_school_unit_request("68326694", None)
use response <- result.try(units.handle_errors(httpc.send_bits(request)))
echo units.handle_errors(operations.get_school_unit_response(response))
}Further documentation can be found at https://hexdocs.pm/snafe in the future.
git clone https://github.com/karlsson/snafe.git
cd snafe
gleam run -m snafe/gen_units # Generate units schema and operations.
gleam run -m snafe/gen_statistics # Generate statistics schema and operations. Both operations will download the OpenAPI specifications from Skolverket's site and store them in the priv directory. The APIs are documented at Skolverket's site.