Skip to main content

RTM API wrapper

Project description

codecov PyPI version

Python wrapper for "Remember the Milk" API

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.Set({'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-0.2.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

rtmilk-0.2.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rtmilk-0.2.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Darwin/21.6.0

File hashes

Hashes for rtmilk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 58c98fb3555ff3b68fbd26f0e15309fc4bd03e82a4b462de2d81166d6854d2d4
MD5 b101a655d1a5af0e2f947464ed41902c
BLAKE2b-256 1f4775cbb66174d7540f4b50d01af3db9b8067a2f9e2ee4d1ff701688fe3ba82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rtmilk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.11.2 Darwin/21.6.0

File hashes

Hashes for rtmilk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 979a1d9fc41610b90076e00ce3396bab49c0b536b1b20c1a89d53180c19d9b7c
MD5 03e5f72c020b228519c943a26414b352
BLAKE2b-256 5dad1e980ac75264367b7a02c1abd74bf1cd0bb84e20fc171f955aab6cf0a6a1

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