Package: reclaim-sdk
Reclaim-SDK - Unofficial Python SDK for Reclaim.aiReclaim-SDK is an unofficial Python SDK for the Reclaim.ai API. It provides a simple and easy-to-use interface for managing tasks in Reclaim.ai. Please note that this SDK is not affiliated with Reclaim.ai in any way and was reverse-engineered from the Reclaim.ai web app. As a result, there may be bugs and the API may change at any time, and versioning is not possible.FeaturesCurrently, Reclaim-SDK only supports task management. However, as there might be an official SDK in the future, this SDK won't implement all features of the web app.InstallationTo install Reclaim-SDK, simply run the following command:pipinstallreclaim-sdkConfigurationYou can get an API key fromhere.There are 3 ways to configure the token:You can initiate theReclaimClientclass with the token as thetokenargument. AsReclaimClientis a singleton, you should initiate this class at the beginning of your script / program. It will be used for all subsequent calls.You can set the environment variableRECLAIM_TOKENto the token.You can store the token in a toml file named.reclaim.tomlin your home directory. It should look like this:[reclaim_ai]token=<YOUR_TOKEN>UsageAll CRUD operations are supported, but for now only tasks are implemented. For the linked task events only the update of start and end times are supported. Nevertheless the API is designed to be easily extendable, by adding new classes for other resources. All "heavy lifting" is done in theReclaimModelclass, which is the base class for all other models.Creating a taskfromreclaim_sdk.models.taskimportReclaimTaskfromdatetimeimportdatetime,timedelta# The objects can be used as context managers, so they will automatically# be saved to the API when exiting the context.withReclaimTask()astask:task.name="test_task_12345"# All durations are set in hourstask.duration=5task.min_work_duration=0.75task.max_work_duration=2# The start date is set to 3 days in the futuretask.start_date=datetime.now()+timedelta(days=3)# The due date is set to 5 days in the futuretask.due_date=datetime.now()+timedelta(days=5)# It is also possible to create an object without using a context manager.task=ReclaimTask()task.name="test_task_12345"task.duration=5task.min_work_duration=0.75task.max_work_duration=2task.start_date=datetime.now()+timedelta(days=3)task.due_date=datetime.now()+timedelta(days=5)# Then the object needs to be saved manually to the API.task.save()Updating and searching tasksfromreclaim_sdk.models.taskimportReclaimTask# By default the search method returns all tasks except archived ones# (marked as completed)tasks=ReclaimTask.search()# Setting all tasks to work tasksfortaskintasks:withtask:task.is_work_task=True# We can also search for tasks by name or other fields# (but they have to be exact matches)tasks=ReclaimTask.search(title="My task")# If we have the task ID we can get the task directlytask=ReclaimTask.get(12345)Deleting tasksfromreclaim_sdk.models.taskimportReclaimTask# Get the desired tasktask=ReclaimTask.get(12345)# Delete the tasktask.delete()Prioritizing tasksfromreclaim_sdk.models.taskimportReclaimTask# Get the desired taskstask=ReclaimTask.get(12345)# Prioritize one task on top of all the othertask.prioritize()# Prioritize the tasks by due date# (Sorts the tasks by due date and sets the priorities accordingly)ReclaimTask.prioritize_by_due()Change start and end date for task eventsfromreclaim_sdk.models.taskimportReclaimTask# Get the desired tasktask=ReclaimTask.get(12345)# Adding one hour to the end date of the first event# (so the event gets 1 hour longer)withtask.events[0]asevent:event.end=event.end+timedelta(hours=1)ContributingContributions are welcome. Please open an issue or a pull request. If you want to add a new resource, please have a look at theReclaimModelclass and theReclaimTaskclass. TheReclaimTaskclass is a good example of how to implement a new resource.LicenseMIT LicenseCopyright (c) 2022 Laurence LabuschPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.