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-1.0.2.tar.gz
(14.3 kB
view details)
Built Distribution
rtmilk-1.0.2-py3-none-any.whl
(18.3 kB
view details)
File details
Details for the file rtmilk-1.0.2.tar.gz
.
File metadata
- Download URL: rtmilk-1.0.2.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a91daf468c9ee89d2f33fbea4bcdb2871a9f30596ef5da558ae32c8dedaa24ed |
|
MD5 | 4719741cd48a82f26c0bf105aa8f7801 |
|
BLAKE2b-256 | 7c5991be402810260ab7192bfea3a2ef7c9b453eef7f2a5bd328ecf116e01149 |
File details
Details for the file rtmilk-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: rtmilk-1.0.2-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec3e6c8bd3a68cff668e8ecf926cd8a063542f4ae4cd6c8b1ff122fc73bf8db |
|
MD5 | c0f2b10a956824f0bcad7392baaa5c1a |
|
BLAKE2b-256 | 9bf1ee5c26498dadc9e7f92902ce1722fc68080d41260adedbc560d231390c70 |