Skip to main content

RTM 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.client import Client
from rtmmilk.models import RTMError

# These are the equivalent objects, created differently
client = Client.Create(API_KEY, SHARED_SECRET, TOKEN)
client2 = await Client.CreateAsync(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 RTMError as e:
    print(e)

Usage of API functions directly

from rtmilk.api_sync import API
from rtmmilk.models import RTMError

api = API(API_KEY, SHARED_SECRET, TOKEN)

timeline = api.TimelinesCreate().timeline
try:
    api.TasksAdd(timeline, 'task name')
except RTMError as e:
    print(e)
from rtmilk.api_async import APIAsync
from rtmmilk.models import RTMError

apiAsync = APIAsync(API_KEY, SHARED_SECRET, TOKEN)

timeline = await apiAsync.TimelinesCreate().timeline
try:
    await apiAsync.TasksAdd(timeline, 'task name')
except RTMError as e:
    print(e)

Authorization

from rtmilk.authorization 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-1.0.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

rtmilk-1.0.1-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rtmilk-1.0.1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.0 Darwin/23.0.0

File hashes

Hashes for rtmilk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e00907f339eed388a31cd0fabf9fd18ce0ca221d35b6a6d1d59de7cd40a3977e
MD5 5ddf05d73a275622d661c3fc4fbd20ce
BLAKE2b-256 4d4285554f9c4495e6f2db17fe1f46d64a9886e2fbbbb6b0b91d18ebfcc0467c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rtmilk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.0 Darwin/23.0.0

File hashes

Hashes for rtmilk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c30c6c5677da5ed16834b982f81c557c8f07e8099c61ccf1f1f8d15b17858d77
MD5 e65aeba0fd86d4801eec5860554ccf6e
BLAKE2b-256 cffdcc012c36a2aab798dbd68a1a2a98b0262369661248c88870dd3ca5c2ab45

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