Skip to main content

Remember The Milk API wrapper

Project description

codecov PyPI version

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


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.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

rtmilk-3.0.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file rtmilk-3.0.0.tar.gz.

File metadata

  • Download URL: rtmilk-3.0.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.20

File hashes

Hashes for rtmilk-3.0.0.tar.gz
Algorithm Hash digest
SHA256 4f96e346903054f9aad3cba29db2d0ce6721adb2266a38eeb0a0e8ae3737fc15
MD5 9fa9be0c18fcac8c117fb4984539401a
BLAKE2b-256 7523ca5f7eca3bb85f87f7fade2e5ed4eea959b71d4b10676f1eabac3c7a6e2b

See more details on using hashes here.

File details

Details for the file rtmilk-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: rtmilk-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.20

File hashes

Hashes for rtmilk-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bfee1748976de02ffafee6d5dfa47247cb057d47f7db415089e90aa39108d33
MD5 51e2d60368fae5982b03f149b476ab49
BLAKE2b-256 812008699d235fcff1701c4159cb6418085b22b660dd6865407732b0e43d6739

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page