inception-helper-func 0.1.0__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.
- inception_helper_func-0.1.0/LICENSE +0 -0
- inception_helper_func-0.1.0/PKG-INFO +18 -0
- inception_helper_func-0.1.0/README.md +1 -0
- inception_helper_func-0.1.0/inception_helper_func/__init__.py +0 -0
- inception_helper_func-0.1.0/inception_helper_func/datetimeformat.py +53 -0
- inception_helper_func-0.1.0/inception_helper_func/money.py +8 -0
- inception_helper_func-0.1.0/inception_helper_func.egg-info/PKG-INFO +18 -0
- inception_helper_func-0.1.0/inception_helper_func.egg-info/SOURCES.txt +12 -0
- inception_helper_func-0.1.0/inception_helper_func.egg-info/dependency_links.txt +1 -0
- inception_helper_func-0.1.0/inception_helper_func.egg-info/requires.txt +3 -0
- inception_helper_func-0.1.0/inception_helper_func.egg-info/top_level.txt +1 -0
- inception_helper_func-0.1.0/pyproject.toml +3 -0
- inception_helper_func-0.1.0/setup.cfg +4 -0
- inception_helper_func-0.1.0/setup.py +46 -0
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: inception_helper_func
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: inception_helper_func is a package that contains helper functions for the InceptionForce project
|
|
5
|
+
Home-page: https://github.com/KhaduaBloom/inceptionforcepackages/tree/main/PythonPackage/inceptionHelperFunc
|
|
6
|
+
Author: KhaduaBloom
|
|
7
|
+
Author-email: khaduabloom@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.13.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: graypy==2.1.0
|
|
15
|
+
Requires-Dist: psutil==6.1.0
|
|
16
|
+
Requires-Dist: pytz==2025.2
|
|
17
|
+
|
|
18
|
+
python 3.13.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
python 3.13.0
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from datetime import datetime, UTC
|
|
2
|
+
import pytz
|
|
3
|
+
|
|
4
|
+
def format_datetime_from_iso(date: str, date_format: str, time_format: str, time_zone: str) -> dict:
|
|
5
|
+
"""
|
|
6
|
+
Formats a date string based on the provided format and timezone.
|
|
7
|
+
|
|
8
|
+
:param date: The date string (e.g., "2025-04-25T12:00:00Z").
|
|
9
|
+
:param date_format: The date format (e.g., 'd MMM yyyy').
|
|
10
|
+
:param time_format: The time format (e.g., 'hh:mm a').
|
|
11
|
+
:param time_zone: The timezone (e.g., 'America/Ojinaga').
|
|
12
|
+
:return: A dictionary containing formatted time, date, and datetime.
|
|
13
|
+
"""
|
|
14
|
+
tz = pytz.timezone(time_zone)
|
|
15
|
+
utc_time = datetime.fromisoformat(date).replace(tzinfo=pytz.utc)
|
|
16
|
+
zoned_time = utc_time.astimezone(tz)
|
|
17
|
+
|
|
18
|
+
formatted_time = zoned_time.strftime(time_format)
|
|
19
|
+
formatted_date = zoned_time.strftime(date_format)
|
|
20
|
+
formatted_datetime = zoned_time.strftime(f"{date_format} {time_format}")
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
'time': formatted_time,
|
|
24
|
+
'date': formatted_date,
|
|
25
|
+
'dateTime': formatted_datetime
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def format_datetime_from_epoch(date: int, date_format: str, time_format: str, time_zone: str) -> dict:
|
|
29
|
+
"""
|
|
30
|
+
Formats an epoch timestamp based on the provided format and timezone.
|
|
31
|
+
|
|
32
|
+
:param date: The epoch timestamp (e.g., 1714156800).
|
|
33
|
+
:param date_format: The date format (e.g., 'd MMM yyyy').
|
|
34
|
+
:param time_format: The time format (e.g., 'hh:mm a').
|
|
35
|
+
:param time_zone: The timezone (e.g., 'America/Ojinaga').
|
|
36
|
+
:return: A dictionary containing formatted time, date, and datetime.
|
|
37
|
+
"""
|
|
38
|
+
tz = pytz.timezone(time_zone)
|
|
39
|
+
epoch_time = datetime.fromtimestamp(date, tz=UTC)
|
|
40
|
+
zoned_time = epoch_time.astimezone(tz)
|
|
41
|
+
|
|
42
|
+
formatted_time = zoned_time.strftime(time_format)
|
|
43
|
+
formatted_date = zoned_time.strftime(date_format)
|
|
44
|
+
formatted_datetime = zoned_time.strftime(f"{date_format} {time_format}")
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
'time': formatted_time,
|
|
48
|
+
'date': formatted_date,
|
|
49
|
+
'dateTime': formatted_datetime
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# Example usage with an epoch timestamp
|
|
53
|
+
print(format_datetime_from_epoch(1714156800, '%d %b %Y', '%I:%M %p', 'America/Ojinaga'))
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
def fmt(amount: float) -> str:
|
|
2
|
+
"""Formats the amount as money, including two decimal places and thousands separator."""
|
|
3
|
+
return '{:,.2f}'.format(amount)
|
|
4
|
+
|
|
5
|
+
def fmt_with_currency(amount: float, currency: str) -> str:
|
|
6
|
+
"""Formats the amount as money, including two decimal places and thousands separator, and adds the currency symbol."""
|
|
7
|
+
return f'{currency} {fmt(amount)}'
|
|
8
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: inception_helper_func
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: inception_helper_func is a package that contains helper functions for the InceptionForce project
|
|
5
|
+
Home-page: https://github.com/KhaduaBloom/inceptionforcepackages/tree/main/PythonPackage/inceptionHelperFunc
|
|
6
|
+
Author: KhaduaBloom
|
|
7
|
+
Author-email: khaduabloom@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.13.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: graypy==2.1.0
|
|
15
|
+
Requires-Dist: psutil==6.1.0
|
|
16
|
+
Requires-Dist: pytz==2025.2
|
|
17
|
+
|
|
18
|
+
python 3.13.0
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
inception_helper_func/__init__.py
|
|
6
|
+
inception_helper_func/datetimeformat.py
|
|
7
|
+
inception_helper_func/money.py
|
|
8
|
+
inception_helper_func.egg-info/PKG-INFO
|
|
9
|
+
inception_helper_func.egg-info/SOURCES.txt
|
|
10
|
+
inception_helper_func.egg-info/dependency_links.txt
|
|
11
|
+
inception_helper_func.egg-info/requires.txt
|
|
12
|
+
inception_helper_func.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
inception_helper_func
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from setuptools import setup, find_packages, Command
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CleanUpCommand(Command):
|
|
7
|
+
"""Custom command to remove files created by inception_helper_func."""
|
|
8
|
+
|
|
9
|
+
description = "Clean up files created by inception_helper_func"
|
|
10
|
+
user_options = []
|
|
11
|
+
|
|
12
|
+
def initialize_options(self):
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
def finalize_options(self):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
def run(self):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
setup(
|
|
23
|
+
name="inception_helper_func",
|
|
24
|
+
version="0.1.0",
|
|
25
|
+
author="KhaduaBloom",
|
|
26
|
+
author_email="khaduabloom@gmail.com",
|
|
27
|
+
description="inception_helper_func is a package that contains helper functions for the InceptionForce project",
|
|
28
|
+
long_description=open("README.md").read(),
|
|
29
|
+
long_description_content_type="text/markdown",
|
|
30
|
+
url="https://github.com/KhaduaBloom/inceptionforcepackages/tree/main/PythonPackage/inceptionHelperFunc",
|
|
31
|
+
packages=find_packages(),
|
|
32
|
+
classifiers=[
|
|
33
|
+
"Programming Language :: Python :: 3",
|
|
34
|
+
"License :: OSI Approved :: MIT License",
|
|
35
|
+
"Operating System :: OS Independent",
|
|
36
|
+
],
|
|
37
|
+
python_requires=">=3.13.0",
|
|
38
|
+
install_requires=[
|
|
39
|
+
"graypy==2.1.0",
|
|
40
|
+
"psutil==6.1.0",
|
|
41
|
+
"pytz==2025.2"
|
|
42
|
+
],
|
|
43
|
+
cmdclass={
|
|
44
|
+
"cleanup": CleanUpCommand,
|
|
45
|
+
},
|
|
46
|
+
)
|