chinus-tools 1.0.1__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,26 @@
1
+ Metadata-Version: 2.1
2
+ Name: chinus_tools
3
+ Version: 1.0.1
4
+ Summary: This is a chinus Python package.
5
+ Author-email: Chinu9653 <juyoung9653@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/juyoung9653/chinus
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: json5
13
+
14
+ # Chinu9653's package
15
+
16
+ This is a sample Python package created by Chinu9653.
17
+
18
+ ## Features
19
+ - Feature 1
20
+ - Feature 2
21
+
22
+ ## Installation
23
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `chinus`.
24
+
25
+ ```bash
26
+ pip install chinus
@@ -0,0 +1,13 @@
1
+ # Chinu9653's package
2
+
3
+ This is a sample Python package created by Chinu9653.
4
+
5
+ ## Features
6
+ - Feature 1
7
+ - Feature 2
8
+
9
+ ## Installation
10
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `chinus`.
11
+
12
+ ```bash
13
+ pip install chinus
@@ -0,0 +1,32 @@
1
+ [build-system]
2
+ requires = [ "setuptools", "wheel",]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "chinus_tools"
7
+ version = "1.0.1"
8
+ description = "This is a chinus Python package."
9
+ requires-python = ">=3.6"
10
+ keywords = []
11
+ classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License",]
12
+ dependencies = [ "json5",]
13
+ [[project.authors]]
14
+ name = "Chinu9653"
15
+ email = "juyoung9653@gmail.com"
16
+
17
+ [project.readme]
18
+ file = "README.md"
19
+ content-type = "text/markdown"
20
+ encoding = "utf-8"
21
+
22
+ [project.license]
23
+ text = "MIT"
24
+
25
+ [project.urls]
26
+ Homepage = "https://github.com/juyoung9653/chinus"
27
+
28
+ [tool.setuptools.package-dir]
29
+ "" = "src"
30
+
31
+ [tool.setuptools.packages.find]
32
+ where = [ "src",]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
File without changes
@@ -0,0 +1,24 @@
1
+ import subprocess
2
+
3
+
4
+ def get_modified_items() -> str:
5
+ """
6
+ Git 상태를 확인하여 수정된 최상위 폴더 또는 파일의 목록을 공백으로 구분된 문자열로 반환합니다.
7
+
8
+ Returns:
9
+ str: 수정된 최상위 폴더 또는 파일들의 공백으로 구분된 문자열.
10
+ """
11
+ # 'git status --porcelain'으로 변경 사항이 있는지 확인
12
+ result = subprocess.run(['git', 'status', '--porcelain'], capture_output=True, text=True)
13
+
14
+ # 결과 파싱
15
+ modified_items = set()
16
+ for line in result.stdout.strip().splitlines():
17
+ # 변경된 파일 경로는 세 번째 컬럼부터 나옴
18
+ file_path = line[3:].strip()
19
+ # 최상위 폴더 또는 파일 추출
20
+ top_level_item = file_path.split('/')[0]
21
+ modified_items.add(top_level_item)
22
+
23
+ # 공백으로 구분된 문자열로 변환
24
+ return ' '.join(sorted(modified_items))
@@ -0,0 +1,20 @@
1
+ import json5
2
+
3
+
4
+ def load_json(
5
+ file_path: str,
6
+ encoding='utf-8'
7
+ ) -> dict:
8
+ with open(file_path, 'r', encoding=encoding) as f:
9
+ return json5.load(f)
10
+
11
+
12
+ def dump_json(
13
+ file_path: str,
14
+ data: dict,
15
+ encoding='utf-8',
16
+ ensure_ascii=False,
17
+ indent=2
18
+ ) -> None:
19
+ with open(file_path, 'w', encoding=encoding) as f:
20
+ json5.dump(data, f, ensure_ascii=ensure_ascii, indent=indent)
File without changes
@@ -0,0 +1,8 @@
1
+ import os
2
+
3
+ from chinus.tools.paths.get.project_root import get_project_root
4
+ from pathlib import Path
5
+
6
+
7
+ def get_absolute_path(project_relative_path: str, root_identifiers: set = None) -> str:
8
+ return str(Path(os.path.join(get_project_root(root_identifiers), project_relative_path)))
@@ -0,0 +1,30 @@
1
+ import os
2
+
3
+
4
+ def get_project_root(root_identifiers: set = None, start_path: str = os.getcwd()) -> str:
5
+ """프로젝트 루트 경로를 자동으로 추출하는 함수.
6
+
7
+ Args:
8
+ start_path (str): 탐색을 시작할 경로. 기본값은 현재 작업 디렉토리.
9
+
10
+ Returns:
11
+ str: 프로젝트 루트 경로.
12
+ :param start_path:
13
+ :param root_identifiers:
14
+ """
15
+ # 확인할 파일 목록: 프로젝트 루트에 있는지 확인할 파일들
16
+ root_identifiers1 = root_identifiers or {'.idea'}
17
+
18
+ # 현재 경로를 설정
19
+ current_path = start_path
20
+
21
+ # 루트 경로가 아니고 상위 디렉토리가 있는 동안 탐색
22
+ while current_path != os.path.dirname(current_path):
23
+ # 현재 디렉토리 내에 루트 식별 파일들이 있는지 확인
24
+ if any(os.path.exists(os.path.join(current_path, identifier)) for identifier in root_identifiers1):
25
+ return current_path # 루트 경로 반환
26
+ # 상위 디렉토리로 이동
27
+ current_path = os.path.dirname(current_path)
28
+
29
+ # 루트를 찾지 못한 경우 현재 작업 디렉토리 반환
30
+ return start_path
@@ -0,0 +1,13 @@
1
+ from chinus.decorator.warning.not_used_return_value import use_return
2
+
3
+
4
+ def br_print(*lines):
5
+ for line in lines:
6
+ print(line)
7
+
8
+
9
+
10
+ @use_return
11
+ def br_input(*lines, prompt=None):
12
+ br_print(*lines)
13
+ return input(prompt)
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.1
2
+ Name: chinus_tools
3
+ Version: 1.0.1
4
+ Summary: This is a chinus Python package.
5
+ Author-email: Chinu9653 <juyoung9653@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/juyoung9653/chinus
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Requires-Python: >=3.6
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: json5
13
+
14
+ # Chinu9653's package
15
+
16
+ This is a sample Python package created by Chinu9653.
17
+
18
+ ## Features
19
+ - Feature 1
20
+ - Feature 2
21
+
22
+ ## Installation
23
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `chinus`.
24
+
25
+ ```bash
26
+ pip install chinus
@@ -0,0 +1,17 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/chinus_tools/__init__.py
4
+ src/chinus_tools/jsons.py
5
+ src/chinus_tools.egg-info/PKG-INFO
6
+ src/chinus_tools.egg-info/SOURCES.txt
7
+ src/chinus_tools.egg-info/dependency_links.txt
8
+ src/chinus_tools.egg-info/requires.txt
9
+ src/chinus_tools.egg-info/top_level.txt
10
+ src/chinus_tools/git/__init__.py
11
+ src/chinus_tools/git/status.py
12
+ src/chinus_tools/paths/__init__.py
13
+ src/chinus_tools/paths/get/__init__.py
14
+ src/chinus_tools/paths/get/absolute_path.py
15
+ src/chinus_tools/paths/get/project_root.py
16
+ src/chinus_tools/print_input_utils/__init__.py
17
+ src/chinus_tools/print_input_utils/multi_line_io.py
@@ -0,0 +1 @@
1
+ chinus_tools