From 008ab951ec1d0dbc5422fde6daa79b7a8d740122 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 5 Mar 2022 11:21:38 +0330 Subject: [PATCH 01/16] ignore vscode --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5d70719..b41aa53 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,6 @@ venv.bak/ # mypy .mypy_cache/ + +# VScode +.vscode/ From 72945736bdad3e327e110108f83aafd77797ff0d Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 5 Mar 2022 11:22:25 +0330 Subject: [PATCH 02/16] init user history and add __call__ method --- zk/attendance.py | 3 +++ zk/base.py | 27 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/zk/attendance.py b/zk/attendance.py index 3ffd9d7..4d397d4 100644 --- a/zk/attendance.py +++ b/zk/attendance.py @@ -12,3 +12,6 @@ def __str__(self): def __repr__(self): return ': {} : {} ({}, {})'.format(self.user_id, self.timestamp,self.status, self.punch) + + def __call__(self): + return (self.user_id, self.timestamp, self.status, self.punch) \ No newline at end of file diff --git a/zk/base.py b/zk/base.py index e4aa247..011c37e 100644 --- a/zk/base.py +++ b/zk/base.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- import sys +import codecs + from datetime import datetime from socket import AF_INET, SOCK_DGRAM, SOCK_STREAM, socket, timeout from struct import pack, unpack -import codecs +from itertools import groupby from . import const from .attendance import Attendance @@ -1574,6 +1576,29 @@ def read_with_buffer(self, command, fct=0 ,ext=0): if self.verbose: print ("_read w/chunk %i bytes" % start) return b''.join(data), start + def get_user_history( + self, user: list[str] = [], date_to_date: tuple = None + ) -> dict: + attendances = self.get_attendance() + history = {} + + def key_func(k): + return k()[0] + + if (user, date_to_date) == ([], None): + _attendances = sorted(attendances, key=key_func) + print(_attendances[5]()) + for k, g in groupby(_attendances, key_func): + '''Group by Attendance ID''' + history[f'Attendance {k}'] = list(g) + for i, _ in enumerate(history[f'Attendance {k}']): + '''Select only date time from the tupple.''' + history[f'Attendance {k}'][i] = _attendances[i]()[1] + else: + raise NotImplementedError() + + return history + def get_attendance(self): """ return attendance record From daf8d1480351835c6137e97fa80439a3c6eeb71e Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 5 Mar 2022 11:29:40 +0330 Subject: [PATCH 03/16] add status and punch to the user history as well --- zk/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zk/base.py b/zk/base.py index 011c37e..4798c35 100644 --- a/zk/base.py +++ b/zk/base.py @@ -1592,8 +1592,8 @@ def key_func(k): '''Group by Attendance ID''' history[f'Attendance {k}'] = list(g) for i, _ in enumerate(history[f'Attendance {k}']): - '''Select only date time from the tupple.''' - history[f'Attendance {k}'][i] = _attendances[i]()[1] + '''Select datetime, status, and punch from the tupple.''' + history[f'Attendance {k}'][i] = _attendances[i]()[1:] else: raise NotImplementedError() From d0d09ef2151f7eef5c535c07aa6c27c116063775 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 5 Mar 2022 14:03:45 +0330 Subject: [PATCH 04/16] limit user history by mentioning their ID --- zk/base.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/zk/base.py b/zk/base.py index 4798c35..15d9ead 100644 --- a/zk/base.py +++ b/zk/base.py @@ -6,6 +6,7 @@ from socket import AF_INET, SOCK_DGRAM, SOCK_STREAM, socket, timeout from struct import pack, unpack from itertools import groupby +from typing import Union from . import const from .attendance import Attendance @@ -1577,7 +1578,7 @@ def read_with_buffer(self, command, fct=0 ,ext=0): return b''.join(data), start def get_user_history( - self, user: list[str] = [], date_to_date: tuple = None + self, users: list[Union[str, int]] = [], date_to_date: tuple = None ) -> dict: attendances = self.get_attendance() history = {} @@ -1585,15 +1586,18 @@ def get_user_history( def key_func(k): return k()[0] - if (user, date_to_date) == ([], None): + if date_to_date == None: _attendances = sorted(attendances, key=key_func) - print(_attendances[5]()) for k, g in groupby(_attendances, key_func): '''Group by Attendance ID''' - history[f'Attendance {k}'] = list(g) - for i, _ in enumerate(history[f'Attendance {k}']): - '''Select datetime, status, and punch from the tupple.''' - history[f'Attendance {k}'][i] = _attendances[i]()[1:] + + if k in list(map(str, users)) or users == []: + '''Select the corespond users by their IDs''' + + history[f'Attendance {k}'] = list(g) + for i, _ in enumerate(history[f'Attendance {k}']): + '''Select datetime, status, and punch from the tupple.''' + history[f'Attendance {k}'][i] = _attendances[i]()[1:] else: raise NotImplementedError() From 2554bf0c517b721a1d72c166f93e7eee975d81e8 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 5 Mar 2022 16:10:16 +0330 Subject: [PATCH 05/16] fix sorting user history --- zk/base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/zk/base.py b/zk/base.py index 15d9ead..6c09c66 100644 --- a/zk/base.py +++ b/zk/base.py @@ -1582,28 +1582,31 @@ def get_user_history( ) -> dict: attendances = self.get_attendance() history = {} - + def key_func(k): + """Returns the UID of each Attendances as a key.""" return k()[0] if date_to_date == None: _attendances = sorted(attendances, key=key_func) + j = 0 for k, g in groupby(_attendances, key_func): '''Group by Attendance ID''' if k in list(map(str, users)) or users == []: - '''Select the corespond users by their IDs''' + '''Select the corresponding users by their IDs''' history[f'Attendance {k}'] = list(g) for i, _ in enumerate(history[f'Attendance {k}']): '''Select datetime, status, and punch from the tupple.''' - history[f'Attendance {k}'][i] = _attendances[i]()[1:] + history[f'Attendance {k}'][i] = _attendances[i + j]()[1:] + j += i + 1 else: raise NotImplementedError() return history - def get_attendance(self): + def get_attendance(self, date_to_date: tuple = None): """ return attendance record From fff6f71fa2750d919b30c1ab1069e6c73626c493 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sun, 6 Mar 2022 12:09:38 +0330 Subject: [PATCH 06/16] add sorted attendance and method doc string --- zk/base.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/zk/base.py b/zk/base.py index 6c09c66..908cd2d 100644 --- a/zk/base.py +++ b/zk/base.py @@ -1578,8 +1578,14 @@ def read_with_buffer(self, command, fct=0 ,ext=0): return b''.join(data), start def get_user_history( - self, users: list[Union[str, int]] = [], date_to_date: tuple = None - ) -> dict: + self, users: list[Union[str, int]] = [], date_to_date: tuple = None + ) -> dict: + """ + Returns the history of attendances which is grouped by their uid. + :param users: List of users by uid or name. + :param date_to_date: + :return: Grouped by attendances records + """ attendances = self.get_attendance() history = {} @@ -1672,6 +1678,15 @@ def get_attendance(self, date_to_date: tuple = None): attendance_data = attendance_data[40:] return attendances + def get_sorted_attendance(self, by_date: bool = False) -> list: + """ + Sorting attendances record wheather by date or uid. + :param by_date: If it is True, means sorting by date. Else it will be sorted by + uid. + :return: Sorted records. + """ + return sorted(self.get_attendance(), key=lambda x: x()[int(by_date)]) + def clear_attendance(self): """ clear all attendance record From 5d919f4b4226bc9c14064309b1e8d80c008b5b59 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sun, 6 Mar 2022 16:31:53 +0330 Subject: [PATCH 07/16] add property methods for each attendance's property --- zk/attendance.py | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/zk/attendance.py b/zk/attendance.py index 4d397d4..821258b 100644 --- a/zk/attendance.py +++ b/zk/attendance.py @@ -2,16 +2,34 @@ class Attendance(object): def __init__(self, user_id, timestamp, status, punch=0, uid=0): self.uid = uid # not really used any more - self.user_id = user_id - self.timestamp = timestamp - self.status = status - self.punch = punch + self._user_id = user_id + self._timestamp = timestamp + self._status = status + self._punch = punch def __str__(self): - return ': {} : {} ({}, {})'.format(self.user_id, self.timestamp, self.status, self.punch) + return ': {} : {} ({}, {})'.format(self._user_id, self._timestamp, + self._status, self._punch) def __repr__(self): - return ': {} : {} ({}, {})'.format(self.user_id, self.timestamp,self.status, self.punch) + return ': {} : {} ({}, {})'.format(self._user_id, self._timestamp, + self._status, self._punch) def __call__(self): - return (self.user_id, self.timestamp, self.status, self.punch) \ No newline at end of file + return self._user_id, self._timestamp, self._status, self._punch + + @property + def user_id(self): + return self._user_id + + @property + def timestamp(self): + return self._timestamp + + @property + def status(self): + return self._status + + @property + def punch(self): + return self._punch From 39f3f4e77ea744fe0a0d1bdc7b138f00fbb0e74a Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Mon, 7 Mar 2022 09:38:44 +0330 Subject: [PATCH 08/16] add filter by user utility --- zk/utility.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 zk/utility.py diff --git a/zk/utility.py b/zk/utility.py new file mode 100644 index 0000000..9668814 --- /dev/null +++ b/zk/utility.py @@ -0,0 +1,24 @@ +class Utility(object): + """Utility Class""" + + def __init__(self): + pass + + @staticmethod + def filter_by_date(): + ... + + @staticmethod + def filter_by_user(attendances_list, users_list): + """ + + :param attendances_list: + :param users_list: + :return: + """ + + return [ + item + for item in attendances_list + if item.user_id in list(map(str, users_list)) + ] From 7e6492117330205e4a5df5c97e1623385ee727c5 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Mon, 7 Mar 2022 10:59:20 +0330 Subject: [PATCH 09/16] add filter by date utility --- zk/utility.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/zk/utility.py b/zk/utility.py index 9668814..f8dc1dd 100644 --- a/zk/utility.py +++ b/zk/utility.py @@ -5,18 +5,38 @@ def __init__(self): pass @staticmethod - def filter_by_date(): - ... + def filter_by_date(attendances_list, start=None, end=None): + """ + Select only desire attendances records by datetime condition. + + :param attendances_list: The list of attendances records. + :param start: The filter of starting datetime + :param end: The filter of ending datetime + :return: Limited list of attendances records. + """ + filtered = [] + + if start is not None: + for d in attendances_list: + if d.timestamp >= start: + filtered.append(d) + + if end is not None: + for d in attendances_list: + if d.timestamp <= end: + filtered.append(d) + + return filtered @staticmethod def filter_by_user(attendances_list, users_list): """ + Select only desire attendances records by user condition. - :param attendances_list: - :param users_list: - :return: + :param attendances_list: The list of attendances records. + :param users_list: The list of desire users to be select. + :return: Limited list of attendances records. """ - return [ item for item in attendances_list From a69e3a08da3b3fd8ca46d6b9cf0ce55d2c32f6eb Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Mon, 7 Mar 2022 11:15:21 +0330 Subject: [PATCH 10/16] add get_limited_attendance --- zk/base.py | 106 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 37 deletions(-) diff --git a/zk/base.py b/zk/base.py index 908cd2d..1221134 100644 --- a/zk/base.py +++ b/zk/base.py @@ -13,6 +13,7 @@ from .exception import ZKErrorConnection, ZKErrorResponse, ZKNetworkError from .user import User from .finger import Finger +from .utility import Utility def safe_cast(val, to_type, default=None): @@ -1577,42 +1578,7 @@ def read_with_buffer(self, command, fct=0 ,ext=0): if self.verbose: print ("_read w/chunk %i bytes" % start) return b''.join(data), start - def get_user_history( - self, users: list[Union[str, int]] = [], date_to_date: tuple = None - ) -> dict: - """ - Returns the history of attendances which is grouped by their uid. - :param users: List of users by uid or name. - :param date_to_date: - :return: Grouped by attendances records - """ - attendances = self.get_attendance() - history = {} - - def key_func(k): - """Returns the UID of each Attendances as a key.""" - return k()[0] - - if date_to_date == None: - _attendances = sorted(attendances, key=key_func) - j = 0 - for k, g in groupby(_attendances, key_func): - '''Group by Attendance ID''' - - if k in list(map(str, users)) or users == []: - '''Select the corresponding users by their IDs''' - - history[f'Attendance {k}'] = list(g) - for i, _ in enumerate(history[f'Attendance {k}']): - '''Select datetime, status, and punch from the tupple.''' - history[f'Attendance {k}'][i] = _attendances[i + j]()[1:] - j += i + 1 - else: - raise NotImplementedError() - - return history - - def get_attendance(self, date_to_date: tuple = None): + def get_attendance(self): """ return attendance record @@ -1678,15 +1644,81 @@ def get_attendance(self, date_to_date: tuple = None): attendance_data = attendance_data[40:] return attendances - def get_sorted_attendance(self, by_date: bool = False) -> list: + def get_user_history( + self, users: list[Union[str, int]] = [], + start: datetime = None, end: datetime = None + ) -> dict: + """ + Returns the history of attendances which is grouped by their uid. + + :param users: List of users by uid or name. + :param start: The filter starts from this datetime. + :param end: The filter ends up to this datetime. + :return: Grouped by attendances records + """ + attendances = self.get_attendance() + history = {} + + def key_func(k): + """Returns the UID of each Attendances as a key.""" + return k()[0] + + if start is None and end is None: + _attendances = sorted(attendances, key=key_func) + j, i = 0, 0 + for k, g in groupby(_attendances, key_func): + '''Group by Attendance ID''' + + if k in list(map(str, users)) or users == []: + '''Select the corresponding users by their IDs''' + + history[f'Attendance {k}'] = list(g) + for i, _ in enumerate(history[f'Attendance {k}']): + '''Select datetime, status, and punch from the tupple.''' + history[f'Attendance {k}'][i] = _attendances[i + j]()[1:] + j += i + 1 + else: + raise NotImplementedError() + + return history + + def get_sorted_attendance(self, by_date: bool = False) -> list[Attendance]: """ Sorting attendances record wheather by date or uid. + :param by_date: If it is True, means sorting by date. Else it will be sorted by uid. :return: Sorted records. """ return sorted(self.get_attendance(), key=lambda x: x()[int(by_date)]) + def get_limited_attendance( + self, users: list[Union[str, int]] = [], + start: datetime = None, end: datetime = None + ) -> list: + """ + Filter attendances' records with both user selection and/or datetime. + + :param users: List of users by uid or name. + :param start: The filter starts from this datetime. + :param end: The filter ends up to this datetime. + :return: Limited attendances record by the respective input filters. + """ + try: + attendances = self.get_sorted_attendance() + + if users: + attendances = Utility.filter_by_user(attendances, users) + if start is not None: + attendances = Utility.filter_by_date(attendances, start=start) + if end is not None: + attendances = Utility.filter_by_date(attendances, end=end) + + return attendances + + except Exception: + raise ZKErrorResponse("Something went wrong!") + def clear_attendance(self): """ clear all attendance record From c0b807e508ba9d0af2ba23eaf4125615c3e7c6bd Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Mon, 7 Mar 2022 17:07:40 +0330 Subject: [PATCH 11/16] fix test error caused by hinting type newer version (python 3.9) reduced to version 3.6 --- zk/base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zk/base.py b/zk/base.py index 1221134..8b9b2ec 100644 --- a/zk/base.py +++ b/zk/base.py @@ -1645,13 +1645,13 @@ def get_attendance(self): return attendances def get_user_history( - self, users: list[Union[str, int]] = [], - start: datetime = None, end: datetime = None + self, users: list = [], + start=None, end=None ) -> dict: """ Returns the history of attendances which is grouped by their uid. - :param users: List of users by uid or name. + :param users: List of users by uid. :param start: The filter starts from this datetime. :param end: The filter ends up to this datetime. :return: Grouped by attendances records @@ -1682,7 +1682,7 @@ def key_func(k): return history - def get_sorted_attendance(self, by_date: bool = False) -> list[Attendance]: + def get_sorted_attendance(self, by_date: bool = False) -> list: """ Sorting attendances record wheather by date or uid. @@ -1693,8 +1693,8 @@ def get_sorted_attendance(self, by_date: bool = False) -> list[Attendance]: return sorted(self.get_attendance(), key=lambda x: x()[int(by_date)]) def get_limited_attendance( - self, users: list[Union[str, int]] = [], - start: datetime = None, end: datetime = None + self, users: list = [], + start=None, end=None ) -> list: """ Filter attendances' records with both user selection and/or datetime. From f0f2943fbc06766c0002da71042bfc7a5116d7f7 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Tue, 8 Mar 2022 09:44:43 +0330 Subject: [PATCH 12/16] add more get_attendances methods --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a4c6951..a0fec2b 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,13 @@ zk.enroll_user('1') ```python # Get attendances (will return list of Attendance object) attendances = conn.get_attendance() +sorted_attendances = conn.get_sorted_attendance(by_date=False) # means sorting by uid +limited_attendances = conn.get_limited_attendance( + users=[1, 2], # only UIDs 1, 2 + start=datetime(2022, 1, 10, 12, 42), # from 2022,1,10 12:42:00 + end=datetime(2022, 1, 11) # to 2022,1,11 +) + # Clear attendances records conn.clear_attendance() ``` From ba224bcb0b5eab7c1d17c5fc7afd5e182390dc36 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Tue, 8 Mar 2022 09:51:42 +0330 Subject: [PATCH 13/16] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0fec2b..5f6704e 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ conn.set_time(newtime) ``` -* Ger Firmware Version and Extra Information +* Get Firmware Version and Extra Information ```python conn.get_firmware_version() From 61b7933f7d5de3264f78da3b36fe6c5c9b5cf58d Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 12 Mar 2022 12:06:02 +0330 Subject: [PATCH 14/16] complete get_user_history method --- zk/base.py | 85 ++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/zk/base.py b/zk/base.py index 8b9b2ec..774afec 100644 --- a/zk/base.py +++ b/zk/base.py @@ -1644,44 +1644,6 @@ def get_attendance(self): attendance_data = attendance_data[40:] return attendances - def get_user_history( - self, users: list = [], - start=None, end=None - ) -> dict: - """ - Returns the history of attendances which is grouped by their uid. - - :param users: List of users by uid. - :param start: The filter starts from this datetime. - :param end: The filter ends up to this datetime. - :return: Grouped by attendances records - """ - attendances = self.get_attendance() - history = {} - - def key_func(k): - """Returns the UID of each Attendances as a key.""" - return k()[0] - - if start is None and end is None: - _attendances = sorted(attendances, key=key_func) - j, i = 0, 0 - for k, g in groupby(_attendances, key_func): - '''Group by Attendance ID''' - - if k in list(map(str, users)) or users == []: - '''Select the corresponding users by their IDs''' - - history[f'Attendance {k}'] = list(g) - for i, _ in enumerate(history[f'Attendance {k}']): - '''Select datetime, status, and punch from the tupple.''' - history[f'Attendance {k}'][i] = _attendances[i + j]()[1:] - j += i + 1 - else: - raise NotImplementedError() - - return history - def get_sorted_attendance(self, by_date: bool = False) -> list: """ Sorting attendances record wheather by date or uid. @@ -1694,7 +1656,7 @@ def get_sorted_attendance(self, by_date: bool = False) -> list: def get_limited_attendance( self, users: list = [], - start=None, end=None + start_date=None, end_date=None ) -> list: """ Filter attendances' records with both user selection and/or datetime. @@ -1709,16 +1671,51 @@ def get_limited_attendance( if users: attendances = Utility.filter_by_user(attendances, users) - if start is not None: - attendances = Utility.filter_by_date(attendances, start=start) - if end is not None: - attendances = Utility.filter_by_date(attendances, end=end) + if start_date is not None: + attendances = Utility.filter_by_date(attendances, start=start_date) + if end_date is not None: + attendances = Utility.filter_by_date(attendances, end=end_date) return attendances - except Exception: + except Exception as e: + print(e) raise ZKErrorResponse("Something went wrong!") + def get_user_history( + self, users: list = [], + start_date=None, end_date=None + ) -> dict: + """ + Returns the history of attendances which is grouped by their uid. + + :param users: List of users by uid. + :param start: The filter starts from this datetime. + :param end: The filter ends up to this datetime. + :return: Grouped by attendances records including date, status, and punch + """ + history = {} + + def key_func(k): + """Returns the UID of each Attendances as a key.""" + return k.user_id + + _attendances = self.get_limited_attendance( + users=users, start_date=start_date, end_date=end_date + ) + j, i = 0, 0 + for k, g in groupby(_attendances, key_func): + '''Group by Attendance ID''' + history[f'Attendance {k}'] = list(g) + + for i, _ in enumerate(history[f'Attendance {k}']): + '''Select datetime, status, and punch from the tupple.''' + history[f'Attendance {k}'][i] = _attendances[i + j]()[1:] + + j += i + 1 + + return history + def clear_attendance(self): """ clear all attendance record From 99f1bd1754fcdf26f8e740992f1d3ed4047cc7d4 Mon Sep 17 00:00:00 2001 From: benyamin_7 Date: Sat, 12 Mar 2022 12:14:00 +0330 Subject: [PATCH 15/16] update with get_user_history --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5f6704e..f5d9725 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,14 @@ limited_attendances = conn.get_limited_attendance( conn.clear_attendance() ``` +* User history +```python +# Get the history of users records +hist = conn.get_user_history( + users=[1, 2], start_date=datetime(2022, 1, 10, 12, 42) +) +``` + * Test voice ```python From 25fb679535171f7be67061ad29470ffbd58081d2 Mon Sep 17 00:00:00 2001 From: Benyamin Jafari Date: Tue, 6 Aug 2024 18:16:54 +0330 Subject: [PATCH 16/16] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5d9725..4d02652 100644 --- a/README.md +++ b/README.md @@ -179,8 +179,8 @@ attendances = conn.get_attendance() sorted_attendances = conn.get_sorted_attendance(by_date=False) # means sorting by uid limited_attendances = conn.get_limited_attendance( users=[1, 2], # only UIDs 1, 2 - start=datetime(2022, 1, 10, 12, 42), # from 2022,1,10 12:42:00 - end=datetime(2022, 1, 11) # to 2022,1,11 + start_date=datetime(2022, 1, 10, 12, 42), # from 2022,1,10 12:42:00 + end_date=datetime(2022, 1, 11) # to 2022,1,11 ) # Clear attendances records