sdmx 1.0.0 copy "sdmx: ^1.0.0" to clipboard
sdmx: ^1.0.0 copied to clipboard

Fetch, parse and filter through SDMX records

example/sdmx_example.dart

import 'package:sdmx/sdmx.dart';

void main() async {
  final server = SDMXServer(
    'https://releaseeuaestat.fcsc.gov.ae/rest/data',
    locales: ['en', 'ar'],
  );
  final model = await server.fetchRecord(
    'FCSA,DF_POP,2.6.0/...A...?startPeriod=2017&dimensionAtObservation=AllDimensions',
  );
  final entries = model.toEntries();
  print(model.extractDimensionOptionsAsNames());
  print(entries.length);
  print(entries);
  print(
    entries.where(
      (entry) {
        final tp = int.parse(entry.propertiesAsIds['TIME_PERIOD']!);
        return tp < 2023;
      },
    ).toList(),
  );
  print(
    entries.where(
      (entry) {
        final tp = int.parse(entry.propertiesAsIds['TIME_PERIOD']!);
        return tp >= 2023;
      },
    ).toList(),
  );
  print(
    entries
        .firstWhere(
          (entry) => entry.anyPropertyInIdFormMatches({
            'TIME_PERIOD': ['2018'],
          }),
        )
        .propertiesAsNames
        .keys
        .first
        .forLanguage('ar'),
  );
}
1
likes
140
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

Fetch, parse and filter through SDMX records

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on sdmx