#todo #list #remember #command-line #task #applications #milk

bin+lib rememberthemilk

Client library for the Remember The Milk todo list service

6 releases (3 breaking)

0.4.1 Jan 13, 2024
0.4.0 Jan 6, 2024
0.3.0 Dec 31, 2023
0.2.0 Dec 31, 2023
0.1.0 Apr 24, 2020

#2337 in Command line utilities

33 downloads per month

MIT license

93KB
2K SLoC

rememberthemilk-rs

Rust crate for the Remember The Milk API.

This includes a library implementing the implementing the main API methods and a command-line utility to make use of it. It is currently very incomplete, but can do the basics of listing and adding tasks.

I expect the functionality to fill out over time as I want or need them, and my priorities are influenced by polite feature or pull requests.

Contributing

Bug reports, feature requests, general queries, and pull requests welcome. The CI runs cargo test, cargo fmt and cargo clippy, but these are not a prerequisite for me accepting a PR - in general if the PR is otherwise good I'm happy to just fix those up myself before merging.

For any larger changes, I suggest discussing in an issue first to check it's in the right direction before wasting time.


lib.rs:

Interface to the remember the milk to-do app via the REST API.

This crate is unofficial and not not supported by remember the milk. To use it, you will need a free for non-commercial use API key, which is not included with the crate.

Before doing anything else, you need to get an [API] object which needs your API key and secret, and authenticate with the API - this means both your application key and the user's account.

// Create the API object
let mut rtm_api = API::new("my key".to_string(), "my secret".to_string());
// Begin authentication using your API key
let auth = rtm_api.start_auth(Perms::Read).await?;
// auth.url is a URL which the user should visit to authorise the application
// using their rememberthemilk.com account.  The user needs to visit this URL
// and sign in before continuing below.
if rtm_api.check_auth(&auth).await? {
   // Successful authentication!  Can continue to use the API now.
}

If the authentication is successful, the API object will have an authentication token which can be re-used later. See to_config and from_config which can be used to save the token and API keys (so they should be stored somewhere relatively secure).

The rest of the API can then be used:

let tasks = api.get_all_tasks().await?;
for list in tasks.list {
   if let Some(v) = list.taskseries {
       for ts in v {
           println!("  {}", ts.name);
       }
   }
}

Dependencies

~12–28MB
~419K SLoC