dately 1.0.2__tar.gz → 1.0.4__tar.gz
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.
- dately-1.0.4/PKG-INFO +55 -0
- dately-1.0.4/README.md +40 -0
- {dately-1.0.2 → dately-1.0.4}/dately/core.py +8 -6
- dately-1.0.4/dately.egg-info/PKG-INFO +55 -0
- {dately-1.0.2 → dately-1.0.4}/setup.py +3 -3
- dately-1.0.2/PKG-INFO +0 -28
- dately-1.0.2/README.md +0 -13
- dately-1.0.2/dately.egg-info/PKG-INFO +0 -28
- {dately-1.0.2 → dately-1.0.4}/dately/__init__.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/__init__.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/Compiled.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/__init__.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/cdatetime/UniversalDateFormatter.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/cdatetime/__init__.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/cdatetime/iso8601T.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/cdatetime/iso8601Z.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/cdatetime/whichformat.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/clean_str.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/time_zones.cp38-win_amd64.pyd +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/timeutils.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/timezone.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately/utils.py +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately.egg-info/SOURCES.txt +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately.egg-info/dependency_links.txt +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately.egg-info/requires.txt +0 -0
- {dately-1.0.2 → dately-1.0.4}/dately.egg-info/top_level.txt +0 -0
- {dately-1.0.2 → dately-1.0.4}/setup.cfg +0 -0
dately-1.0.4/PKG-INFO
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: dately
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: A library for manipulating datetime strings.
|
|
5
|
+
Home-page: https://github.com/cedricmoorejr/dately
|
|
6
|
+
Author: Cedric Moore Jr.
|
|
7
|
+
Author-email: cedric@doydl.tech
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Source Code, https://github.com/cedricmoorejr/dately/tree/main/dately
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://github.com/cedricmoorejr/dately/blob/main/dately/assets/dately_logo.png" alt="Dately Logo" width="500"/>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
### Dately Library: Comprehensive Date and Time Handling in Python
|
|
21
|
+
|
|
22
|
+
The dately module is a comprehensive library designed for advanced date and time manipulation. It offers extensive capabilities to handle various date and time formats, ensuring compatibility across different systems and data structures. The module provides tools for validating, extracting, and transforming date and time information with a focus on performance and accuracy.
|
|
23
|
+
|
|
24
|
+
This module, currently available only for the Windows operating system, provides comprehensive functionalities for date parsing, detection, extraction, and conversion. It efficiently handles both individual dates and large arrays of dates, offering robust support for various input types, including date strings, datetime objects, pandas Series, and NumPy arrays. The core functionalities include converting dates to specified formats or datetime objects, as well as parsing, detecting, and extracting date components. Leveraging regular expressions and NumPy, it processes dates with high speed and accuracy, ensuring consistent date handling, specifically optimized for Windows environments.
|
|
25
|
+
|
|
26
|
+
A key aspect of this module is addressing inconsistencies in Python's date formatting on the Windows operating system. The module specifically targets the handling of the '-' flag in date format specifiers. This flag, used to remove leading zeros from formatted output (e.g., turning '01' into '1' for January), works reliably on Unix-like systems but does not function as intended on Windows. This discrepancy arises from the differing implementations of the underlying C libraries that Python relies on. For example, using a date format like '%Y-%-m-%d' on Windows results in Python not recognizing the specifier, leading to unexpected behaviors.
|
|
27
|
+
|
|
28
|
+
On Windows, where the feature to omit leading zeros using %-m in the strftime() and strptime() functions is unsupported, attempts to use such formats with inputs like '2024-3-01' can lead to misinterpretations, defaulting to '%Y-%m-%d', which retains the leading zero.
|
|
29
|
+
|
|
30
|
+
To solve this problem on Windows, the dately module introduces a workaround using regular expressions. It utilizes a detection function to determine the format string and then examines each date component for leading zeros through an extract_date_component function and a subsequent has_leading_zero check. Depending on the presence of leading zeros, the module adjusts the format string—replacing %m with %-m where applicable—to emulate the behavior expected from the '-' flag on Unix-like systems.
|
|
31
|
+
|
|
32
|
+
This method ensures that users on Windows achieve consistent date formatting, effectively compensating for the lack of native support for the '-' flag in date specifiers on this system.
|
|
33
|
+
|
|
34
|
+
Additionally, dately leverages both high-level Python and low-level C code (via Cython) to achieve efficient and high-performance operations.
|
|
35
|
+
|
|
36
|
+
Overall, dately is a powerful utility for anyone needing precise and flexible date and time handling in their applications, making it easier to manage, format, and validate date and time data consistently and efficiently.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
#### Key Features
|
|
40
|
+
|
|
41
|
+
1. **Date and Time Format Detection**:
|
|
42
|
+
- Automatically detect various date and time formats from strings, ensuring seamless parsing and conversion.
|
|
43
|
+
- Supports a wide range of date formats, including standard and unique custom formats.
|
|
44
|
+
|
|
45
|
+
2. **Timezone Management**:
|
|
46
|
+
- Fetches users current timezone information on import.
|
|
47
|
+
|
|
48
|
+
3. **String Manipulation and Validation**:
|
|
49
|
+
- Extract specific components (year, month, day, hour, minute, second, timezone) from datetime strings.
|
|
50
|
+
- Validate and replace parts of datetime strings to ensure accuracy and consistency.
|
|
51
|
+
- Strip time and timezone information from datetime strings when needed.
|
|
52
|
+
|
|
53
|
+
4. **Performance Optimizations**:
|
|
54
|
+
- Utilizes Cython to enhance performance for computationally intensive tasks.
|
|
55
|
+
- Interfaces with underlying C code to perform high-speed string operations and date validations.
|
dately-1.0.4/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://github.com/cedricmoorejr/dately/blob/main/dately/assets/dately_logo.png" alt="Dately Logo" width="500"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
### Dately Library: Comprehensive Date and Time Handling in Python
|
|
6
|
+
|
|
7
|
+
The dately module is a comprehensive library designed for advanced date and time manipulation. It offers extensive capabilities to handle various date and time formats, ensuring compatibility across different systems and data structures. The module provides tools for validating, extracting, and transforming date and time information with a focus on performance and accuracy.
|
|
8
|
+
|
|
9
|
+
This module, currently available only for the Windows operating system, provides comprehensive functionalities for date parsing, detection, extraction, and conversion. It efficiently handles both individual dates and large arrays of dates, offering robust support for various input types, including date strings, datetime objects, pandas Series, and NumPy arrays. The core functionalities include converting dates to specified formats or datetime objects, as well as parsing, detecting, and extracting date components. Leveraging regular expressions and NumPy, it processes dates with high speed and accuracy, ensuring consistent date handling, specifically optimized for Windows environments.
|
|
10
|
+
|
|
11
|
+
A key aspect of this module is addressing inconsistencies in Python's date formatting on the Windows operating system. The module specifically targets the handling of the '-' flag in date format specifiers. This flag, used to remove leading zeros from formatted output (e.g., turning '01' into '1' for January), works reliably on Unix-like systems but does not function as intended on Windows. This discrepancy arises from the differing implementations of the underlying C libraries that Python relies on. For example, using a date format like '%Y-%-m-%d' on Windows results in Python not recognizing the specifier, leading to unexpected behaviors.
|
|
12
|
+
|
|
13
|
+
On Windows, where the feature to omit leading zeros using %-m in the strftime() and strptime() functions is unsupported, attempts to use such formats with inputs like '2024-3-01' can lead to misinterpretations, defaulting to '%Y-%m-%d', which retains the leading zero.
|
|
14
|
+
|
|
15
|
+
To solve this problem on Windows, the dately module introduces a workaround using regular expressions. It utilizes a detection function to determine the format string and then examines each date component for leading zeros through an extract_date_component function and a subsequent has_leading_zero check. Depending on the presence of leading zeros, the module adjusts the format string—replacing %m with %-m where applicable—to emulate the behavior expected from the '-' flag on Unix-like systems.
|
|
16
|
+
|
|
17
|
+
This method ensures that users on Windows achieve consistent date formatting, effectively compensating for the lack of native support for the '-' flag in date specifiers on this system.
|
|
18
|
+
|
|
19
|
+
Additionally, dately leverages both high-level Python and low-level C code (via Cython) to achieve efficient and high-performance operations.
|
|
20
|
+
|
|
21
|
+
Overall, dately is a powerful utility for anyone needing precise and flexible date and time handling in their applications, making it easier to manage, format, and validate date and time data consistently and efficiently.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
#### Key Features
|
|
25
|
+
|
|
26
|
+
1. **Date and Time Format Detection**:
|
|
27
|
+
- Automatically detect various date and time formats from strings, ensuring seamless parsing and conversion.
|
|
28
|
+
- Supports a wide range of date formats, including standard and unique custom formats.
|
|
29
|
+
|
|
30
|
+
2. **Timezone Management**:
|
|
31
|
+
- Fetches users current timezone information on import.
|
|
32
|
+
|
|
33
|
+
3. **String Manipulation and Validation**:
|
|
34
|
+
- Extract specific components (year, month, day, hour, minute, second, timezone) from datetime strings.
|
|
35
|
+
- Validate and replace parts of datetime strings to ensure accuracy and consistency.
|
|
36
|
+
- Strip time and timezone information from datetime strings when needed.
|
|
37
|
+
|
|
38
|
+
4. **Performance Optimizations**:
|
|
39
|
+
- Utilizes Cython to enhance performance for computationally intensive tasks.
|
|
40
|
+
- Interfaces with underlying C code to perform high-speed string operations and date validations.
|
|
@@ -469,7 +469,7 @@ class DatelyDate:
|
|
|
469
469
|
return True
|
|
470
470
|
return False
|
|
471
471
|
|
|
472
|
-
def sequence(
|
|
472
|
+
def sequence(start_date, end_date, to_format=None):
|
|
473
473
|
"""
|
|
474
474
|
Generate a sequence of formatted dates between two dates.
|
|
475
475
|
|
|
@@ -477,21 +477,23 @@ class DatelyDate:
|
|
|
477
477
|
start_date (any): The start date of the sequence, which can be a datetime object or convertible to one.
|
|
478
478
|
end_date (any): The end date of the sequence, which can be a datetime object or convertible to one.
|
|
479
479
|
to_format (str, optional): The format string to use for formatting the dates.
|
|
480
|
-
Defaults to
|
|
480
|
+
Defaults to None.
|
|
481
481
|
|
|
482
482
|
Returns:
|
|
483
483
|
list of str: List of formatted date strings from start to end date inclusive.
|
|
484
484
|
"""
|
|
485
|
+
# Check if the start_date and end_date are valid datetime objects
|
|
485
486
|
if not self._is_datetime(start_date):
|
|
486
|
-
start_date = self.convert_date(start_date)
|
|
487
|
+
start_date = self.convert_date(start_date, to_format=to_format)
|
|
488
|
+
|
|
487
489
|
if not self._is_datetime(end_date):
|
|
488
|
-
end_date = self.convert_date(end_date)
|
|
489
|
-
|
|
490
|
+
end_date = self.convert_date(end_date, to_format=to_format)
|
|
491
|
+
|
|
490
492
|
# Calculate the number of days between the start and end dates
|
|
491
493
|
delta = end_date - start_date
|
|
492
494
|
|
|
493
495
|
# Generate the list of dates and format them
|
|
494
|
-
date_list = [(start_date + datetime.timedelta(days=i)
|
|
496
|
+
date_list = [self.convert_date(start_date + datetime.timedelta(days=i), to_format=to_format) for i in range(delta.days + 1)]
|
|
495
497
|
|
|
496
498
|
return date_list
|
|
497
499
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: dately
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: A library for manipulating datetime strings.
|
|
5
|
+
Home-page: https://github.com/cedricmoorejr/dately
|
|
6
|
+
Author: Cedric Moore Jr.
|
|
7
|
+
Author-email: cedric@doydl.tech
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Source Code, https://github.com/cedricmoorejr/dately/tree/main/dately
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://github.com/cedricmoorejr/dately/blob/main/dately/assets/dately_logo.png" alt="Dately Logo" width="500"/>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
### Dately Library: Comprehensive Date and Time Handling in Python
|
|
21
|
+
|
|
22
|
+
The dately module is a comprehensive library designed for advanced date and time manipulation. It offers extensive capabilities to handle various date and time formats, ensuring compatibility across different systems and data structures. The module provides tools for validating, extracting, and transforming date and time information with a focus on performance and accuracy.
|
|
23
|
+
|
|
24
|
+
This module, currently available only for the Windows operating system, provides comprehensive functionalities for date parsing, detection, extraction, and conversion. It efficiently handles both individual dates and large arrays of dates, offering robust support for various input types, including date strings, datetime objects, pandas Series, and NumPy arrays. The core functionalities include converting dates to specified formats or datetime objects, as well as parsing, detecting, and extracting date components. Leveraging regular expressions and NumPy, it processes dates with high speed and accuracy, ensuring consistent date handling, specifically optimized for Windows environments.
|
|
25
|
+
|
|
26
|
+
A key aspect of this module is addressing inconsistencies in Python's date formatting on the Windows operating system. The module specifically targets the handling of the '-' flag in date format specifiers. This flag, used to remove leading zeros from formatted output (e.g., turning '01' into '1' for January), works reliably on Unix-like systems but does not function as intended on Windows. This discrepancy arises from the differing implementations of the underlying C libraries that Python relies on. For example, using a date format like '%Y-%-m-%d' on Windows results in Python not recognizing the specifier, leading to unexpected behaviors.
|
|
27
|
+
|
|
28
|
+
On Windows, where the feature to omit leading zeros using %-m in the strftime() and strptime() functions is unsupported, attempts to use such formats with inputs like '2024-3-01' can lead to misinterpretations, defaulting to '%Y-%m-%d', which retains the leading zero.
|
|
29
|
+
|
|
30
|
+
To solve this problem on Windows, the dately module introduces a workaround using regular expressions. It utilizes a detection function to determine the format string and then examines each date component for leading zeros through an extract_date_component function and a subsequent has_leading_zero check. Depending on the presence of leading zeros, the module adjusts the format string—replacing %m with %-m where applicable—to emulate the behavior expected from the '-' flag on Unix-like systems.
|
|
31
|
+
|
|
32
|
+
This method ensures that users on Windows achieve consistent date formatting, effectively compensating for the lack of native support for the '-' flag in date specifiers on this system.
|
|
33
|
+
|
|
34
|
+
Additionally, dately leverages both high-level Python and low-level C code (via Cython) to achieve efficient and high-performance operations.
|
|
35
|
+
|
|
36
|
+
Overall, dately is a powerful utility for anyone needing precise and flexible date and time handling in their applications, making it easier to manage, format, and validate date and time data consistently and efficiently.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
#### Key Features
|
|
40
|
+
|
|
41
|
+
1. **Date and Time Format Detection**:
|
|
42
|
+
- Automatically detect various date and time formats from strings, ensuring seamless parsing and conversion.
|
|
43
|
+
- Supports a wide range of date formats, including standard and unique custom formats.
|
|
44
|
+
|
|
45
|
+
2. **Timezone Management**:
|
|
46
|
+
- Fetches users current timezone information on import.
|
|
47
|
+
|
|
48
|
+
3. **String Manipulation and Validation**:
|
|
49
|
+
- Extract specific components (year, month, day, hour, minute, second, timezone) from datetime strings.
|
|
50
|
+
- Validate and replace parts of datetime strings to ensure accuracy and consistency.
|
|
51
|
+
- Strip time and timezone information from datetime strings when needed.
|
|
52
|
+
|
|
53
|
+
4. **Performance Optimizations**:
|
|
54
|
+
- Utilizes Cython to enhance performance for computationally intensive tasks.
|
|
55
|
+
- Interfaces with underlying C code to perform high-speed string operations and date validations.
|
|
@@ -8,7 +8,7 @@ if sys.platform != 'win32':
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name="dately",
|
|
11
|
-
version="1.0.
|
|
11
|
+
version="1.0.4",
|
|
12
12
|
author="Cedric Moore Jr.",
|
|
13
13
|
author_email="cedric@doydl.tech",
|
|
14
14
|
description="A library for manipulating datetime strings.",
|
|
@@ -16,7 +16,7 @@ setup(
|
|
|
16
16
|
long_description_content_type="text/markdown",
|
|
17
17
|
url="https://github.com/cedricmoorejr/dately",
|
|
18
18
|
project_urls={
|
|
19
|
-
"Source Code": "https://github.com/cedricmoorejr/dately",
|
|
19
|
+
"Source Code": "https://github.com/cedricmoorejr/dately/tree/main/dately",
|
|
20
20
|
},
|
|
21
21
|
packages=find_packages(),
|
|
22
22
|
package_data={
|
|
@@ -38,4 +38,4 @@ setup(
|
|
|
38
38
|
"requests",
|
|
39
39
|
],
|
|
40
40
|
license="MIT",
|
|
41
|
-
)
|
|
41
|
+
)
|
dately-1.0.2/PKG-INFO
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: dately
|
|
3
|
-
Version: 1.0.2
|
|
4
|
-
Summary: A library for manipulating datetime strings.
|
|
5
|
-
Home-page: https://github.com/cedricmoorejr/dately
|
|
6
|
-
Author: Cedric Moore Jr.
|
|
7
|
-
Author-email: cedric@doydl.tech
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Source Code, https://github.com/cedricmoorejr/dately
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
-
Requires-Python: >=3.8
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
|
|
16
|
-
# Date Parsing and Component Extraction Module
|
|
17
|
-
|
|
18
|
-
This module, currently available only for the Windows operating system, provides comprehensive functionalities for date parsing, detection, extraction, and conversion. It efficiently handles both individual dates and large arrays of dates, offering robust support for various input types including date strings, datetime objects, pandas Series, and NumPy arrays. The core functionalities include converting dates to specified formats or datetime objects, as well as parsing, detecting, and extracting date components. Leveraging regular expressions and NumPy, it processes dates with high speed and accuracy, ensuring consistent date handling across different platforms, specifically optimized for Windows environments.
|
|
19
|
-
|
|
20
|
-
## Key Feature:
|
|
21
|
-
|
|
22
|
-
A key part of this module is to address inconsistencies in Python's date formatting specifically for the Windows operating system. The module targets the handling of the '-' flag in date format specifiers. While the '-' flag, used to remove leading zeros from formatted output (e.g., turning '01' into '1' for January), works reliably on Unix-like systems, it does not function as intended on Windows. This discrepancy arises from the differing implementations of the underlying C libraries that Python relies on. For example, using a date format like '%Y-%-m-%d' on Windows results in Python not recognizing the specifier, leading to unexpected behaviors.
|
|
23
|
-
|
|
24
|
-
On Windows, where the feature to omit leading zeros using `%-m` in the `strftime()` and `strptime()` functions is unsupported, attempts to use such formats with inputs like '2024-3-01' can lead to misinterpretations, defaulting to '%Y-%m-%d', which retains the leading zero.
|
|
25
|
-
|
|
26
|
-
To solve this problem on Windows, this module introduces a workaround using regular expressions. It utilizes a detect function to determine the format string and then examines each date component for leading zeros through an extract_date_component function and a subsequent has_leading_zero check. Depending on the presence of leading zeros, the module adjusts the format string—replacing `%m` with `%-m` where applicable—to emulate the behavior expected from the '-' flag on Unix-like systems.
|
|
27
|
-
|
|
28
|
-
This method ensures that users on Windows achieve consistent date formatting, effectively compensating for the lack of native support for the '-' flag in date specifiers on this system.
|
dately-1.0.2/README.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Date Parsing and Component Extraction Module
|
|
2
|
-
|
|
3
|
-
This module, currently available only for the Windows operating system, provides comprehensive functionalities for date parsing, detection, extraction, and conversion. It efficiently handles both individual dates and large arrays of dates, offering robust support for various input types including date strings, datetime objects, pandas Series, and NumPy arrays. The core functionalities include converting dates to specified formats or datetime objects, as well as parsing, detecting, and extracting date components. Leveraging regular expressions and NumPy, it processes dates with high speed and accuracy, ensuring consistent date handling across different platforms, specifically optimized for Windows environments.
|
|
4
|
-
|
|
5
|
-
## Key Feature:
|
|
6
|
-
|
|
7
|
-
A key part of this module is to address inconsistencies in Python's date formatting specifically for the Windows operating system. The module targets the handling of the '-' flag in date format specifiers. While the '-' flag, used to remove leading zeros from formatted output (e.g., turning '01' into '1' for January), works reliably on Unix-like systems, it does not function as intended on Windows. This discrepancy arises from the differing implementations of the underlying C libraries that Python relies on. For example, using a date format like '%Y-%-m-%d' on Windows results in Python not recognizing the specifier, leading to unexpected behaviors.
|
|
8
|
-
|
|
9
|
-
On Windows, where the feature to omit leading zeros using `%-m` in the `strftime()` and `strptime()` functions is unsupported, attempts to use such formats with inputs like '2024-3-01' can lead to misinterpretations, defaulting to '%Y-%m-%d', which retains the leading zero.
|
|
10
|
-
|
|
11
|
-
To solve this problem on Windows, this module introduces a workaround using regular expressions. It utilizes a detect function to determine the format string and then examines each date component for leading zeros through an extract_date_component function and a subsequent has_leading_zero check. Depending on the presence of leading zeros, the module adjusts the format string—replacing `%m` with `%-m` where applicable—to emulate the behavior expected from the '-' flag on Unix-like systems.
|
|
12
|
-
|
|
13
|
-
This method ensures that users on Windows achieve consistent date formatting, effectively compensating for the lack of native support for the '-' flag in date specifiers on this system.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: dately
|
|
3
|
-
Version: 1.0.2
|
|
4
|
-
Summary: A library for manipulating datetime strings.
|
|
5
|
-
Home-page: https://github.com/cedricmoorejr/dately
|
|
6
|
-
Author: Cedric Moore Jr.
|
|
7
|
-
Author-email: cedric@doydl.tech
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Source Code, https://github.com/cedricmoorejr/dately
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
-
Requires-Python: >=3.8
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
|
|
16
|
-
# Date Parsing and Component Extraction Module
|
|
17
|
-
|
|
18
|
-
This module, currently available only for the Windows operating system, provides comprehensive functionalities for date parsing, detection, extraction, and conversion. It efficiently handles both individual dates and large arrays of dates, offering robust support for various input types including date strings, datetime objects, pandas Series, and NumPy arrays. The core functionalities include converting dates to specified formats or datetime objects, as well as parsing, detecting, and extracting date components. Leveraging regular expressions and NumPy, it processes dates with high speed and accuracy, ensuring consistent date handling across different platforms, specifically optimized for Windows environments.
|
|
19
|
-
|
|
20
|
-
## Key Feature:
|
|
21
|
-
|
|
22
|
-
A key part of this module is to address inconsistencies in Python's date formatting specifically for the Windows operating system. The module targets the handling of the '-' flag in date format specifiers. While the '-' flag, used to remove leading zeros from formatted output (e.g., turning '01' into '1' for January), works reliably on Unix-like systems, it does not function as intended on Windows. This discrepancy arises from the differing implementations of the underlying C libraries that Python relies on. For example, using a date format like '%Y-%-m-%d' on Windows results in Python not recognizing the specifier, leading to unexpected behaviors.
|
|
23
|
-
|
|
24
|
-
On Windows, where the feature to omit leading zeros using `%-m` in the `strftime()` and `strptime()` functions is unsupported, attempts to use such formats with inputs like '2024-3-01' can lead to misinterpretations, defaulting to '%Y-%m-%d', which retains the leading zero.
|
|
25
|
-
|
|
26
|
-
To solve this problem on Windows, this module introduces a workaround using regular expressions. It utilizes a detect function to determine the format string and then examines each date component for leading zeros through an extract_date_component function and a subsequent has_leading_zero check. Depending on the presence of leading zeros, the module adjusts the format string—replacing `%m` with `%-m` where applicable—to emulate the behavior expected from the '-' flag on Unix-like systems.
|
|
27
|
-
|
|
28
|
-
This method ensures that users on Windows achieve consistent date formatting, effectively compensating for the lack of native support for the '-' flag in date specifiers on this system.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dately-1.0.2 → dately-1.0.4}/dately/mold/pyd/cdatetime/UniversalDateFormatter.cp38-win_amd64.pyd
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|