Remember The Milk API wrapper
Project description
Python wrapper for "Remember the Milk" API
- Asynchronous and synchronous APIs
- Subscription support
Usage of client
from rtmilk import APIError, CreateClient, CreateClientAsync
# These are the equivalent objects, created differently
client = CreateClient(API_KEY, SHARED_SECRET, TOKEN)
client2 = await CreateClientAsync(API_KEY, SHARED_SECRET, TOKEN)
try:
task = client.Add(name='name 1')
assert task.complete.value is False
task.tags.Set({'tag1', 'tag2'})
assert task.tags.value == {'tag1', 'tag2'}
task = await client.AddAsync(name='name 2')
await task.tags.SetAsync({'tag1', 'tag2'})
tasks = client2.Get('name:"name 1"')
assert tasks[0].tags.value == {'tag1', 'tag2'}
except APIError as e:
print(e)
Usage of API functions directly
from rtmilk import API, FailStat
api = API(API_KEY, SHARED_SECRET, TOKEN)
timeline = api.TimelinesCreate().timeline
result = api.TasksAdd(timeline, 'task name')
if isinstance(result, FailStat):
print(f'Error: {result}')
from rtmilk import APIAsync, FailStat
apiAsync = APIAsync(API_KEY, SHARED_SECRET, TOKEN)
timeline = await apiAsync.TimelinesCreate().timeline
result = await apiAsync.TasksAdd(timeline, 'task name')
if isinstance(result, FailStat):
print(f'Error: {result}')
Authorization
from rtmilk import AuthorizationSession
authenticationSession = AuthorizationSession(API_KEY, SHARED_SECRET, 'delete')
input(f'Go to {authenticationSession.url} and authorize. Then Press ENTER')
token = authenticationSession.Done()
print(f'Authorization token is {token}')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rtmilk-3.0.5.tar.gz
(19.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rtmilk-3.0.5-py3-none-any.whl
(19.1 kB
view details)
File details
Details for the file rtmilk-3.0.5.tar.gz.
File metadata
- Download URL: rtmilk-3.0.5.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21baa557ba82797c25fa53577fd69883576a8683fb8e4303bf081a3d5e111dc8
|
|
| MD5 |
ea3af0b5ce3c198dc0281fd42c765958
|
|
| BLAKE2b-256 |
3b2f7670725eaaa438bb129e4a16ae11ea9dd1c7d6975abef2be7088972472f9
|
File details
Details for the file rtmilk-3.0.5-py3-none-any.whl.
File metadata
- Download URL: rtmilk-3.0.5-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f09554ba2d1bcb7a45045c520fa6645ce85b44a254ee22a4993eab386ae1711d
|
|
| MD5 |
ae63afed69d7b268e5c24b623823f167
|
|
| BLAKE2b-256 |
d636a9ec68cdee1f3aa44a37a5bd8e3190817fb765b8e979bd72d3e4bb302ab2
|