Remember The Milk API wrapper
Project description
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
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-3.0.8.tar.gz
(19.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rtmilk-3.0.8-py3-none-any.whl
(19.1 kB
view details)
File details
Details for the file rtmilk-3.0.8.tar.gz.
File metadata
- Download URL: rtmilk-3.0.8.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b973cb77e98c27f0853cec0be1fa19e2c70462eb7eff230e6c3fc03fc6751cf1
|
|
| MD5 |
143082f5b09951c868a5062b7f645adc
|
|
| BLAKE2b-256 |
e2a6e2737284b476f5abb5d880f6a03501761b9c349c07013fe7badeb87a33f2
|
File details
Details for the file rtmilk-3.0.8-py3-none-any.whl.
File metadata
- Download URL: rtmilk-3.0.8-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87bc381ea7c38f6ac17f0d53e905dc2b1e2cca8adef5be83638430aafda37c9f
|
|
| MD5 |
c21a4d8847b17142262a650243a74e1a
|
|
| BLAKE2b-256 |
7c7ddf4f12dab6e533d1cb76f0f7e0f491fed3b6dba7f204bb033d2082efc8ac
|