Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtimed v1.0.0 #22

Open
c0rydoras opened this issue Nov 14, 2023 · 0 comments
Open

libtimed v1.0.0 #22

c0rydoras opened this issue Nov 14, 2023 · 0 comments
Assignees
Milestone

Comments

@c0rydoras
Copy link
Collaborator

c0rydoras commented Nov 14, 2023

Libtimed v1.0.0

This release will include many breaking features and will while in development live on the v1 branch

Features

Add dataclasses / pydantic models (#14)

Instead of:

print(timed.reports.get()[0]["relationships"]["task"]["data"]["id"])

It should be usable something like this:

>>> reports = timed.reports.get()
>>> some_report = reports[0]
>>> type(some_report)
<class 'libtimed.Report'>
>>> task = some_report.task
>>> type(task)
<class 'libtimed.Task'>
>>> print(task.id)
1234

To retain backwards compatibility allow using old API with __dict__

Breaking Changes

transforms.Time should return datetime.time (#23)

def __init__(self, return_datetime: bool = False):
# return_datetime will be removed at some point
# it defaults to True to maintain backwards compatibility
self.return_datetime = return_datetime

Time transform should return a datetime.time instead of a datetime.datetime(1900, 1, 1, time.hours, time.minutes, time.seconds). (see #17)

@c0rydoras c0rydoras self-assigned this Nov 14, 2023
@c0rydoras c0rydoras added this to the libtimed v1 milestone Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant