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

outdated

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

treasury_direct #

Build Status codecov pub package

A Dart library package to access the debt of the United States from the US Treasury site. This package can be used in a command line app or in a Flutter app.

Example #

import 'package:treasury_direct/treasury_direct.dart';
import 'package:treasury_direct/src/debt_entry.dart';

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

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

  print('Total row received: ${list.mostRecentList.length}');
  for (DebtEntry entry in list.mostRecentList) {
    print('${DebtEntry.dateFormatted(entry.effectiveDate)}: ${DebtEntry.currencyShortened(entry.totalDebt, false)}');
  }
}

Expected output:

Total possible rows: 6486
Total row received: 15
Nov 8, 2018: $21.73T
Nov 7, 2018: $21.69T
Nov 6, 2018: $21.69T
Nov 5, 2018: $21.68T
Nov 2, 2018: $21.68T
Nov 1, 2018: $21.68T
Oct 31, 2018: $21.70T
Oct 30, 2018: $21.70T
Oct 29, 2018: $21.70T
Oct 26, 2018: $21.69T
Oct 25, 2018: $21.70T
Oct 24, 2018: $21.67T
Oct 23, 2018: $21.68T
Oct 22, 2018: $21.67T
Oct 19, 2018: $21.67T

Debt to the Penny API Docs: #

https://fiscaldata.treasury.gov/datasets/debt-to-the-penny/

1
likes
0
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

License

unknown (license)

Dependencies

async, convert, http, intl

More

Packages that depend on treasury_direct