sloth-hatch 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.
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2018 The Python Packaging Authority
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: sloth-hatch
3
+ Version: 0.1.0
4
+ Summary: A package of basic functions because I'm lazy.
5
+ Author: Brendan Hatch
6
+ Author-email: Brendan Hatch <thebrendanhatch@gmail.com>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Dist: build>=1.4.0
12
+ Requires-Python: >=3.11
13
+ Description-Content-Type: text/markdown
14
+
File without changes
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = ["uv_build >= 0.10.7, <0.11.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "sloth-hatch"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name="Brendan Hatch", email="thebrendanhatch@gmail.com" },
10
+ ]
11
+ description = "A package of basic functions because I'm lazy."
12
+ readme = "README.md"
13
+ requires-python = ">=3.11"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "Operating System :: OS Independent",
17
+ ]
18
+ license = "MIT"
19
+ license-files = ["LICEN[CS]E*"]
20
+ dependencies = [
21
+ "build>=1.4.0",
22
+ ]
File without changes
@@ -0,0 +1,44 @@
1
+ import os
2
+ import shutil
3
+ import yaml
4
+ import json
5
+ import functools
6
+
7
+ def read_lines(f):
8
+ with open(f) as inf:
9
+ lines = [l.rstrip() for l in inf.readlines()]
10
+ return lines
11
+
12
+ def read_content(f):
13
+ with open(f) as inf:
14
+ content = inf.read()
15
+ return content
16
+
17
+ def read_json(f):
18
+ with open(f) as inf:
19
+ data = json.load(inf)
20
+ return data
21
+
22
+ def read_yaml(f):
23
+ with open(f) as inf:
24
+ config = yaml.safe_load(inf)
25
+ return config
26
+
27
+ def log_function_call(f):
28
+ @functools.wraps(f)
29
+ def wrapper(**args):
30
+ print(f"\n---------------- Calling {f.__name__} ----------------")
31
+ for arg, value in args.items():
32
+ print(f"\t{arg}=`{value}`")
33
+ result = f(**args)
34
+ print(f"\n---------------- Ending {f.__name__} ----------------")
35
+ return result
36
+ return wrapper
37
+
38
+ def create_directory(d, destroy=True):
39
+ if destroy:
40
+ if os.path.exists(d):
41
+ print(f"DELETING: {d}")
42
+ shutil.rmtree(d)
43
+ print(f"CREATING: {d}")
44
+ os.makedirs(d, exist_ok=True)