treasury_direct 3.1.1 copy "treasury_direct: ^3.1.1" to clipboard
treasury_direct: ^3.1.1 copied to clipboard

A Dart library package to access the debt of the United States from the US Treasury Direct site.

example/example.dart

import 'package:treasury_direct/treasury_direct.dart';

void main() async {
  final td = TreasuryDirect();
  final list = await td.downloadDebtFeedAsync(pagesize: 10000);

  print('Total possible rows: ${list.totalRows}');

  if (list.mostRecentList != null) {
    print('Total row received: ${list.mostRecentList!.length}');
    for (final entry in list.mostRecentList!) {
      print(
          '${DebtEntry.dateFormatted(entry.effectiveDate ?? '')}: ${DebtEntry.currencyShortened(entry.totalDebt ?? 0, false)}');
    }
  }
}
1
likes
140
pub points
0%
popularity

Publisher

verified publisherlarryaasen.com

A Dart library package to access the debt of the United States from the US Treasury Direct site.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

async, convert, http, intl

More

Packages that depend on treasury_direct