RTM API wrapper
Project description
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
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-0.3.1.tar.gz
(13.5 kB
view details)
Built Distribution
rtmilk-0.3.1-py3-none-any.whl
(17.2 kB
view details)
File details
Details for the file rtmilk-0.3.1.tar.gz
.
File metadata
- Download URL: rtmilk-0.3.1.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 714394bac18b212ced1772ba36ed9c47c5951ee737c320d4834c0df088ed4b17 |
|
MD5 | 71c70454690bc867aca44f0082001303 |
|
BLAKE2b-256 | 33b5e2a55c286cddfbb9d184f7cf9432afe875c5bfc995bfa288cb162720153b |
File details
Details for the file rtmilk-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: rtmilk-0.3.1-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d149561bcc895db6aef0ba933261c6814bf9e80f04c7a6b077d36fa0a5ca04a |
|
MD5 | fad1878a7bf93e59b8e2a87f8d6db011 |
|
BLAKE2b-256 | 662b8fdc5d3f5088850a719642ac5ad1948d1f3b57f0a3dab5110bd6bf1ce69c |