diff --git a/README.md b/README.md index 809c0e1..edbe47b 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ Python wrapper for "Remember the Milk" [API](https://www.rememberthemilk.com/ser # Usage of client ```python -from rtmilk.client import CreateClient, CreateClientAsync -from rtmmilk.models import APIError +from rtmilk import APIError, CreateClient, CreateClientAsync # These are the equivalent objects, created differently client = CreateClient(API_KEY, SHARED_SECRET, TOKEN) @@ -28,8 +27,7 @@ except APIError as e: # Usage of API functions directly ```python -from rtmilk.api_sync import API -from rtmmilk.models import FailStat +from rtmilk import API, FailStat api = API(API_KEY, SHARED_SECRET, TOKEN) @@ -40,8 +38,7 @@ if isinstance(result, FailStat): ``` ```python -from rtmilk.api_async import APIAsync -from rtmmilk.models import FailStat +from rtmilk import APIAsync, FailStat apiAsync = APIAsync(API_KEY, SHARED_SECRET, TOKEN) @@ -53,7 +50,7 @@ if isinstance(result, FailStat): # Authorization ```python -from rtmilk.authorization import AuthorizationSession +from rtmilk import AuthorizationSession authenticationSession = AuthorizationSession(API_KEY, SHARED_SECRET, 'delete') input(f'Go to {authenticationSession.url} and authorize. Then Press ENTER') diff --git a/pyproject.toml b/pyproject.toml index 9047cb5..d521f29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ lint.select = ["ALL"] target-version = "py39" [tool.ruff.lint.extend-per-file-ignores] +"__init__.py" = ["F403"] "tests/*" = ["ANN201", "D103", "INP001", "PT006"] "_properties.py" = ["SLF001"] "client.py" = ["SLF001"] diff --git a/src/rtmilk/__init__.py b/src/rtmilk/__init__.py index 49a280d..f9dcb45 100644 --- a/src/rtmilk/__init__.py +++ b/src/rtmilk/__init__.py @@ -1,3 +1,11 @@ from logging import getLogger, NullHandler +from .api_async import * +from .api_sync import * +from .authorization import * +from .client import * +from .filter import * +from .mirror import * +from .models import * + getLogger(__name__).addHandler(NullHandler()) diff --git a/tests/conftest.py b/tests/conftest.py index 7a1c362..3daf011 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,9 +4,7 @@ from pytest import fixture -from rtmilk.api_sync import API -from rtmilk.api_async import APIAsync -from rtmilk.client import CreateClient +from rtmilk import API, APIAsync, CreateClient try: from dotenv import load_dotenv diff --git a/tests/generate_credentials.py b/tests/generate_credentials.py index 4a5e442..ee57829 100755 --- a/tests/generate_credentials.py +++ b/tests/generate_credentials.py @@ -3,7 +3,7 @@ from contextlib import suppress from os import environ -from rtmilk.authorization import AuthorizationSession +from rtmilk import AuthorizationSession try: from dotenv import load_dotenv diff --git a/tests/test_api_wrapper.py b/tests/test_api_wrapper.py index 506e73d..7dfa976 100644 --- a/tests/test_api_wrapper.py +++ b/tests/test_api_wrapper.py @@ -7,7 +7,7 @@ from pydantic import ValidationError from pytest import mark, raises -from rtmilk.models import AuthResponse, EchoResponse, FailStat, NotePayload, PriorityDirectionEnum, PriorityEnum, RTMList, RTMSmartList, Tags, TaskResponse, TaskSeries +from rtmilk import AuthResponse, EchoResponse, FailStat, NotePayload, PriorityDirectionEnum, PriorityEnum, RTMList, RTMSmartList, Tags, TaskResponse, TaskSeries from rtmilk._sansio import TasksGetList def test_validation(api, timeline): diff --git a/tests/test_filter.py b/tests/test_filter.py index be6015f..c75a202 100644 --- a/tests/test_filter.py +++ b/tests/test_filter.py @@ -1,7 +1,7 @@ from datetime import date from uuid import uuid4 -from rtmilk.filter import And, Due, NameIs, Or, Priority, PriorityEnum, Status +from rtmilk import And, Due, NameIs, Or, Priority, PriorityEnum, Status def testFilterString(): assert And(NameIs('the-name'), Status(True)).Text() == '(name:"the-name") AND (status:completed)' diff --git a/tests/test_mirror.py b/tests/test_mirror.py index 328d88a..6990a80 100644 --- a/tests/test_mirror.py +++ b/tests/test_mirror.py @@ -1,6 +1,6 @@ from datetime import datetime, timedelta -from rtmilk.mirror import Mirror, TaskData +from rtmilk import Mirror, TaskData def testMirror(mockClient): Mirror(mockClient, [], [TaskData('name')])