Name | rtmilk JSON |
Version |
3.0.3
JSON |
| download |
home_page | None |
Summary | Remember The Milk API wrapper |
upload_time | 2025-03-03 06:34:55 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
milk
remember
rememberthemilk
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[](https://codecov.io/gh/rkhwaja/rtmilk) [](https://badge.fury.io/py/rtmilk)
Python wrapper for "Remember the Milk" [API](https://www.rememberthemilk.com/services/api/)
- Asynchronous and synchronous APIs
- Subscription support
# Usage of client
```python
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
```python
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}')
```
```python
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
```python
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}')
```
Raw data
{
"_id": null,
"home_page": null,
"name": "rtmilk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Rehan Khwaja <rehan@khwaja.name>",
"keywords": "Milk, Remember, RememberTheMilk",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/5e/62/1bcc230f522b900d02b9340ca638818506e394585266b4b63873dc019d66/rtmilk-3.0.3.tar.gz",
"platform": null,
"description": "[](https://codecov.io/gh/rkhwaja/rtmilk) [](https://badge.fury.io/py/rtmilk)\n\nPython wrapper for \"Remember the Milk\" [API](https://www.rememberthemilk.com/services/api/)\n- Asynchronous and synchronous APIs\n- Subscription support\n\n# Usage of client\n```python\nfrom rtmilk import APIError, CreateClient, CreateClientAsync\n\n# These are the equivalent objects, created differently\nclient = CreateClient(API_KEY, SHARED_SECRET, TOKEN)\nclient2 = await CreateClientAsync(API_KEY, SHARED_SECRET, TOKEN)\n\ntry:\n task = client.Add(name='name 1')\n assert task.complete.value is False\n task.tags.Set({'tag1', 'tag2'})\n assert task.tags.value == {'tag1', 'tag2'}\n task = await client.AddAsync(name='name 2')\n await task.tags.SetAsync({'tag1', 'tag2'})\n tasks = client2.Get('name:\"name 1\"')\n assert tasks[0].tags.value == {'tag1', 'tag2'}\nexcept APIError as e:\n print(e)\n```\n\n# Usage of API functions directly\n```python\nfrom rtmilk import API, FailStat\n\napi = API(API_KEY, SHARED_SECRET, TOKEN)\n\ntimeline = api.TimelinesCreate().timeline\nresult = api.TasksAdd(timeline, 'task name')\nif isinstance(result, FailStat):\n print(f'Error: {result}')\n```\n\n```python\nfrom rtmilk import APIAsync, FailStat\n\napiAsync = APIAsync(API_KEY, SHARED_SECRET, TOKEN)\n\ntimeline = await apiAsync.TimelinesCreate().timeline\nresult = await apiAsync.TasksAdd(timeline, 'task name')\nif isinstance(result, FailStat):\n print(f'Error: {result}')\n```\n\n# Authorization\n```python\nfrom rtmilk import AuthorizationSession\n\nauthenticationSession = AuthorizationSession(API_KEY, SHARED_SECRET, 'delete')\ninput(f'Go to {authenticationSession.url} and authorize. Then Press ENTER')\ntoken = authenticationSession.Done()\nprint(f'Authorization token is {token}')\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Remember The Milk API wrapper",
"version": "3.0.3",
"project_urls": {
"Homepage": "https://github.com/rkhwaja/rtmilk"
},
"split_keywords": [
"milk",
" remember",
" rememberthemilk"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e5ababfb7655660deb0079f79b192b3055d56a7bdae33de3f867e7d7ed4ee8f8",
"md5": "eb684e8e2426d16f7abe09396e0212aa",
"sha256": "548d8593aa287efa91381d9961ddef9940d5b987986cbbba4be85587c3e3dd00"
},
"downloads": -1,
"filename": "rtmilk-3.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eb684e8e2426d16f7abe09396e0212aa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 18943,
"upload_time": "2025-03-03T06:34:53",
"upload_time_iso_8601": "2025-03-03T06:34:53.327282Z",
"url": "https://files.pythonhosted.org/packages/e5/ab/abfb7655660deb0079f79b192b3055d56a7bdae33de3f867e7d7ed4ee8f8/rtmilk-3.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5e621bcc230f522b900d02b9340ca638818506e394585266b4b63873dc019d66",
"md5": "58f764429c296c63dffee822fd9e3548",
"sha256": "d4a9450f963e39dc008d44068efc070339c768b9d91dd3e74d8ff389a78fdf8e"
},
"downloads": -1,
"filename": "rtmilk-3.0.3.tar.gz",
"has_sig": false,
"md5_digest": "58f764429c296c63dffee822fd9e3548",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 18510,
"upload_time": "2025-03-03T06:34:55",
"upload_time_iso_8601": "2025-03-03T06:34:55.113347Z",
"url": "https://files.pythonhosted.org/packages/5e/62/1bcc230f522b900d02b9340ca638818506e394585266b4b63873dc019d66/rtmilk-3.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-03 06:34:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rkhwaja",
"github_project": "rtmilk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rtmilk"
}