DataOpsHub 6.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
DataOpsHub/__init__.py ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ DataOpsHub is a comprehensive Python package for data operations in healthcare applications.
6
+ It provides a set of tools for database operations, form validation, security, and web automation.
7
+ """
8
+
9
+ __version__ = '6.2.0'
10
+
11
+ # Define what should be available when using 'from DataOpsHub import *'
12
+ __all__ = [
13
+ # UPPERCASE constants
14
+ 'INVALID_AGE_ERROR',
15
+ 'INVALID_DATE_FORMAT_ERROR',
16
+ 'INVALID_DATE_RANGE_ERROR',
17
+ 'INVALID_EMAIL_ERROR',
18
+ 'INVALID_FIRST_NAME_ERROR',
19
+ 'INVALID_FIRST_SURNAME_ERROR',
20
+ 'INVALID_ID_FORMAT_ERROR',
21
+ 'INVALID_ID_TYPE_ERROR',
22
+ 'INVALID_PASSWORD_ERROR',
23
+ 'INVALID_SECOND_SURNAME_ERROR',
24
+ 'INVALID_TEL_ERROR',
25
+ 'MISSING_DATE_VALUES_ERROR',
26
+ 'USER_EXISTS_ERROR',
27
+
28
+ # CapWords classes
29
+ 'LabResults',
30
+ 'MedicationsHistory',
31
+ 'RegistrationForm',
32
+ 'User',
33
+ 'UserService',
34
+ 'VitalSigns',
35
+
36
+ # snake_case functions and variables
37
+ 'automated_passwords',
38
+ 'config',
39
+ 'database_handler',
40
+ 'error_messages',
41
+ 'exceptions',
42
+ 'generate_json_validation_response',
43
+ 'table_mappings',
44
+ 'upload_data',
45
+ 'validate_date_range',
46
+ 'validate_id_field',
47
+ 'webdriver_Firefox_Chrome_setup_test'
48
+ ]
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Constants Package
6
+
7
+ This package contains constants used across the DataOpsHub application.
8
+ """
9
+
10
+ # Define what should be available when using 'from DataOpsHub.constants import *'
11
+ __all__ = [
12
+ 'INVALID_AGE_ERROR',
13
+ 'INVALID_DATE_FORMAT_ERROR',
14
+ 'INVALID_DATE_RANGE_ERROR',
15
+ 'INVALID_DATE_RANGE_FORMAT_ERROR',
16
+ 'INVALID_EMAIL_ERROR',
17
+ 'INVALID_FIELD_ERROR',
18
+ 'INVALID_FIRST_NAME_ERROR',
19
+ 'INVALID_FIRST_SURNAME_ERROR',
20
+ 'INVALID_ID_FORMAT_ERROR',
21
+ 'INVALID_ID_TYPE_ERROR',
22
+ 'INVALID_PASSWORD_ERROR',
23
+ 'INVALID_SECOND_SURNAME_ERROR',
24
+ 'INVALID_TEL_ERROR',
25
+ 'INVALID_TEL_SEARCH_VALUE',
26
+ 'MISSING_DATE_VALUES_ERROR',
27
+ 'TABLE_FIELD_MAPPING',
28
+ 'USER_EXISTS_ERROR'
29
+ ]
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Error Messages Module
6
+
7
+ This module contains error messages used across the DataOpsHub application.
8
+ """
9
+
10
+ # ID validation errors
11
+ INVALID_ID_FORMAT_ERROR = "Invalid ID format. ID must be 3-10 characters long and contain only alphanumeric characters and hyphens."
12
+ INVALID_ID_TYPE_ERROR = "Invalid ID type. ID must be a string."
13
+
14
+ # Date validation errors
15
+ INVALID_DATE_FORMAT_ERROR = "Invalid date format. Date must be in the format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM'."
16
+ INVALID_DATE_RANGE_ERROR = "Invalid date range. The start date must be before the end date."
17
+ INVALID_DATE_RANGE_FORMAT_ERROR = "Invalid date range format. Date range must be in the format {'min_value': 'YYYY-MM-DD', 'max_value': 'YYYY-MM-DD'}."
18
+ MISSING_DATE_VALUES_ERROR = "Missing date values. Both 'min_value' and 'max_value' must be provided."
19
+
20
+ # Field validation errors
21
+ INVALID_FIELD_ERROR = "Invalid field. The field does not exist in the model."
22
+ INVALID_EMAIL_ERROR = "Invalid email format. Please provide a valid email address."
23
+ INVALID_FIRST_NAME_ERROR = "Invalid first name. First name must be 2-50 characters long and contain only letters and spaces."
24
+ INVALID_FIRST_SURNAME_ERROR = "Invalid first surname. First surname must be 2-50 characters long and contain only letters and spaces."
25
+ INVALID_SECOND_SURNAME_ERROR = "Invalid second surname. Second surname must be 2-50 characters long and contain only letters and spaces."
26
+ INVALID_PASSWORD_ERROR = "Invalid password. Password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one number, and one special character."
27
+ INVALID_TEL_ERROR = "Invalid telephone number. Telephone number must be 9-15 digits long and contain only numbers, spaces, and hyphens."
28
+ INVALID_AGE_ERROR = "Invalid age. Age must be between 14 and 120 years."
29
+ USER_EXISTS_ERROR = "User already exists. Please choose a different username or email."
30
+ INVALID_TEL_SEARCH_VALUE = "Invalid telephone search value. Telephone number must be 9-15 digits long and contain only numbers, spaces, and hyphens."
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Table Mappings Module
6
+
7
+ This module contains mappings between table names and their field names.
8
+ """
9
+
10
+ TABLE_FIELD_MAPPING = {
11
+ 'user': {
12
+ 'id_field': 'user_id',
13
+ 'date_field': 'created_at'
14
+ }
15
+ }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Data Entry Forms package for DataOpsHub.
6
+
7
+ This package provides tools for managing, validating, and processing user data entries.
8
+ """
9
+
10
+ # Define what should be available when using 'from DataOpsHub.data_entry_forms import *'
11
+ __all__ = [
12
+ # Uppercase constants
13
+ 'INVALID_AGE_ERROR',
14
+ 'INVALID_DATE_FORMAT_ERROR',
15
+ 'INVALID_DATE_RANGE_ERROR',
16
+ 'INVALID_EMAIL_ERROR',
17
+ 'INVALID_FIRST_NAME_ERROR',
18
+ 'INVALID_FIRST_SURNAME_ERROR',
19
+ 'INVALID_ID_FORMAT_ERROR',
20
+ 'INVALID_ID_TYPE_ERROR',
21
+ 'INVALID_PASSWORD_ERROR',
22
+ 'INVALID_SECOND_SURNAME_ERROR',
23
+ 'INVALID_TEL_ERROR',
24
+ 'MISSING_DATE_VALUES_ERROR',
25
+ 'USER_EXISTS_ERROR',
26
+
27
+ # PascalCase classes
28
+ 'RegistrationForm',
29
+
30
+ # snake_case functions
31
+ 'generate_json_validation_response',
32
+ 'validate_date_range',
33
+ 'validate_id_field'
34
+ ]
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Forms package for DataOpsHub.
6
+
7
+ This package contains form classes used for data entry validation.
8
+ """
9
+
10
+ # Define what should be available when using 'from DataOpsHub.data_entry_forms.forms import *'
11
+ __all__ = [
12
+ 'RegistrationForm'
13
+ ]
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ #----------------#
5
+ # Import modules #
6
+ #----------------#
7
+
8
+ # from flask_ngrok import run_with_ngrok
9
+ # from flask import Flask,request, url_for
10
+ from wtforms import Form, StringField, validators
11
+
12
+ # Import project modules #
13
+ #------------------------#
14
+
15
+ #----------------#
16
+ # Define classes #
17
+ #----------------#
18
+
19
+ class RegistrationForm(Form):
20
+ email = StringField('Email', [validators.Email(), validators.DataRequired()])
21
+ first_name = StringField('First Name', [validators.Length(min=2, max=50), validators.DataRequired()])
22
+ last_name = StringField('Last Name', [validators.Length(min=2, max=50), validators.DataRequired()])
23
+
24
+ #------------------#
25
+ # Define functions #
26
+ #------------------#
27
+
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Form Field Validators Package
6
+
7
+ This package provides validation functionality for form fields in various contexts.
8
+ It includes utilities for validating different types of data such as dates, IDs, and other fields.
9
+ """
10
+
11
+ # Define what should be available when using 'from DataOpsHub.data_entry_forms.validators import *'
12
+ __all__ = [
13
+ # Backend validation functions
14
+ 'generate_json_validation_response',
15
+ 'validate_date_range',
16
+ 'validate_id_field',
17
+ 'verify_spanish_dni',
18
+
19
+ # Backend error messages
20
+ 'INVALID_DATE_FORMAT_ERROR',
21
+ 'INVALID_DATE_RANGE_ERROR',
22
+ 'INVALID_DATE_RANGE_FORMAT_ERROR',
23
+ 'INVALID_FIELD_ERROR',
24
+ 'INVALID_ID_FORMAT_ERROR',
25
+ 'INVALID_ID_TYPE_ERROR',
26
+ 'MISSING_DATE_VALUES_ERROR',
27
+
28
+ # Backend constants
29
+ 'DISPLAYABLE_FIELDS',
30
+ 'FIELD_NAME_LIST_PRETTY',
31
+ 'FIELD_VALIDATORS',
32
+ 'FILTERABLE_FIELDS',
33
+ 'ID_PATTERN',
34
+
35
+ # Full-stack validation functions
36
+ 'generate_error_dict',
37
+ 'generate_error_dict_nonempty',
38
+ 'validate_age_field',
39
+ 'validate_email_field',
40
+ 'validate_field',
41
+ 'validate_form_with_json',
42
+
43
+ # Full-stack constants
44
+ 'DROPDOWN_ID_LIST',
45
+ 'ERR_STR_LIST',
46
+ 'ERR_STR_LIST_SEARCH',
47
+ 'FIELD_NAME_LIST_ENG',
48
+ 'FIELD_NAME_LIST_ESP',
49
+ 'FIELD_NAME_SEARCH_LIST',
50
+ 'INVALID_TEL_SEARCH_VALUE',
51
+ 'REG_EXP_DICT',
52
+ 'REG_EXP_DICT_SEARCH'
53
+ ]