site-toolslifecycle-ak01 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.
- site_toolslifecycle_ak01-0.1.0/PKG-INFO +10 -0
- site_toolslifecycle_ak01-0.1.0/README.md +0 -0
- site_toolslifecycle_ak01-0.1.0/pyproject.toml +21 -0
- site_toolslifecycle_ak01-0.1.0/setup.cfg +4 -0
- site_toolslifecycle_ak01-0.1.0/src/site_asset_toolscycle/__init__.py +0 -0
- site_toolslifecycle_ak01-0.1.0/src/site_asset_toolscycle/site_toolscycle.py +58 -0
- site_toolslifecycle_ak01-0.1.0/src/site_toolslifecycle_ak01.egg-info/PKG-INFO +10 -0
- site_toolslifecycle_ak01-0.1.0/src/site_toolslifecycle_ak01.egg-info/SOURCES.txt +8 -0
- site_toolslifecycle_ak01-0.1.0/src/site_toolslifecycle_ak01.egg-info/dependency_links.txt +1 -0
- site_toolslifecycle_ak01-0.1.0/src/site_toolslifecycle_ak01.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: site-toolslifecycle-ak01
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A structural evaluation and financial depreciation library for construction assets.
|
|
5
|
+
Author-email: Anurag K <khanapurkaranurag@gmail.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "site-toolslifecycle-ak01"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Anurag K", email="khanapurkaranurag@gmail.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "A structural evaluation and financial depreciation library for construction assets."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.7"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[tool.setuptools.packages.find]
|
|
21
|
+
where = ["src"]
|
|
File without changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from datetime import date
|
|
2
|
+
|
|
3
|
+
class AssetEvaluator:
|
|
4
|
+
def __init__(self, initial_cost, purchase_date, condition, depreciation_rate=0.20, lifespan_years=5):
|
|
5
|
+
self.initial_cost = float(initial_cost)
|
|
6
|
+
self.purchase_date = purchase_date
|
|
7
|
+
self.condition = condition.upper()
|
|
8
|
+
# Generic Custom Variables
|
|
9
|
+
self.depreciation_rate = float(depreciation_rate)
|
|
10
|
+
self.lifespan_years = int(lifespan_years)
|
|
11
|
+
|
|
12
|
+
def calculate_current_value(self):
|
|
13
|
+
age_in_days = (date.today() - self.purchase_date).days
|
|
14
|
+
age_in_years = age_in_days / 365.25
|
|
15
|
+
|
|
16
|
+
current_value = self.initial_cost * ((1 - self.depreciation_rate) ** age_in_years)
|
|
17
|
+
|
|
18
|
+
if self.condition == 'FAIR':
|
|
19
|
+
current_value *= 0.8
|
|
20
|
+
elif self.condition == 'DAMAGED':
|
|
21
|
+
current_value *= 0.4
|
|
22
|
+
|
|
23
|
+
return max(round(current_value, 2), 0.0)
|
|
24
|
+
|
|
25
|
+
def requires_urgent_inspection(self):
|
|
26
|
+
age_in_days = (date.today() - self.purchase_date).days
|
|
27
|
+
age_in_years = age_in_days / 365.25
|
|
28
|
+
|
|
29
|
+
if self.condition == 'DAMAGED' or age_in_years > self.lifespan_years:
|
|
30
|
+
return True
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
class FleetAnalyzer:
|
|
34
|
+
def __init__(self, assets_list):
|
|
35
|
+
self.assets = assets_list
|
|
36
|
+
|
|
37
|
+
def generate_executive_report(self):
|
|
38
|
+
total_portfolio_value = 0.0
|
|
39
|
+
urgent_alerts = 0
|
|
40
|
+
|
|
41
|
+
for asset in self.assets:
|
|
42
|
+
evaluator = AssetEvaluator(
|
|
43
|
+
initial_cost=asset['cost'],
|
|
44
|
+
purchase_date=asset['date'],
|
|
45
|
+
condition=asset['condition'],
|
|
46
|
+
depreciation_rate=asset.get('depreciation_rate', 0.20),
|
|
47
|
+
lifespan_years=asset.get('lifespan_years', 5)
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
total_portfolio_value += evaluator.calculate_current_value()
|
|
51
|
+
if evaluator.requires_urgent_inspection():
|
|
52
|
+
urgent_alerts += 1
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
"total_assets_tracked": len(self.assets),
|
|
56
|
+
"total_financial_value": round(total_portfolio_value, 2),
|
|
57
|
+
"tools_requiring_inspection": urgent_alerts
|
|
58
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: site-toolslifecycle-ak01
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A structural evaluation and financial depreciation library for construction assets.
|
|
5
|
+
Author-email: Anurag K <khanapurkaranurag@gmail.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/site_asset_toolscycle/__init__.py
|
|
4
|
+
src/site_asset_toolscycle/site_toolscycle.py
|
|
5
|
+
src/site_toolslifecycle_ak01.egg-info/PKG-INFO
|
|
6
|
+
src/site_toolslifecycle_ak01.egg-info/SOURCES.txt
|
|
7
|
+
src/site_toolslifecycle_ak01.egg-info/dependency_links.txt
|
|
8
|
+
src/site_toolslifecycle_ak01.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
site_asset_toolscycle
|