Metadata-Version: 2.3
Name: rtmilk
Version: 2.1.1
Summary: Remember The Milk API wrapper
Project-URL: Homepage, https://github.com/rkhwaja/rtmilk
Maintainer-email: Rehan Khwaja <rehan@khwaja.name>
License-File: LICENSE
Keywords: Milk,Remember,RememberTheMilk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Requires-Dist: aiohttp>=3.9
Requires-Dist: listdiff>=1.0.2
Requires-Dist: pydantic>=2.4.2
Requires-Dist: requests>=2.23.0
Requires-Dist: urllib3>=1.26; python_version >= '3.10'
Description-Content-Type: text/markdown

[![codecov](https://codecov.io/gh/rkhwaja/rtmilk/branch/master/graph/badge.svg?token=RaMYgorajr)](https://codecov.io/gh/rkhwaja/rtmilk) [![PyPI version](https://badge.fury.io/py/rtmilk.svg)](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.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
```python
from rtmilk.api_sync import API
from rtmmilk.models import 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.api_async import APIAsync
from rtmmilk.models import 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.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}')
```
