EOF-413-LGH 1.0.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,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: EOF_413_LGH
3
+ Version: 1.0.0
4
+ Summary: Библиотека для работы с GitHub API.
5
+ Home-page: https://github.com/EOF-413/LibraryGitHub
6
+ Author: EOF-413
7
+ Author-email: org.animea@mail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.6
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: EOF_413_LLS>=1.1.0
22
+ Requires-Dist: EOF_413_LH>=1.0.1
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # LibraryGitHub (LGH)
35
+
36
+ **LGH** - это библиотека для работы с GitHub API. Позволяет искать репозитории, связанные с основным репозиторием, и скачивать файлы.
37
+
38
+ ## Особенности
39
+
40
+ - Поиск репозиториев, связанных с основным репозиторием (по ссылке в описании)
41
+ - Получение информации о файлах в корне репозитория
42
+ - Получение ссылки на последний релиз с ZIP-ассетом
43
+ - Интеграция с LibraryHttp (LH)
44
+ - Интеграция с LibraryLogSystem (LLS)
45
+
46
+ ## Установка
47
+
48
+ ```py
49
+ from LGH import Github
50
+ ```
51
+
52
+ ## Использование
53
+
54
+ ### Поиск связанных репозиториев
55
+
56
+ # Поиск репозиториев, связанных с основным
57
+
58
+ ```py
59
+ from LGH import Github
60
+
61
+ repos = Github.search('https://github.com/owner/main-repo')
62
+
63
+ # Поиск с ограничением количества
64
+ repos = Github.search('https://github.com/owner/main-repo', per_page=50)
65
+ ```
66
+
67
+ ### Скачивание файлов из репозитория
68
+
69
+ ```py
70
+ from LGH import Github
71
+
72
+ # Скачивание файла из корня репозитория
73
+ file_content = Github.download('owner', 'repo', 'manifest.json')
74
+
75
+ if file_content:
76
+ with open('manifest.json', 'wb') as f:
77
+ f.write(file_content)
78
+ ```
79
+
80
+ ### Получение информации о файлах
81
+
82
+ ```py
83
+ from LGH import Github
84
+
85
+ repos = Github.search('https://github.com/owner/main-repo')
86
+
87
+ for name, info in repos.items():
88
+ print(f"Репозиторий: {name}")
89
+ print(f"Разработчик: {info['DEV']}")
90
+ print(f"Ссылка: {info['LINK']}")
91
+
92
+ if info['FILES']:
93
+ print("Файлы:")
94
+ for key, value in info['FILES'].items():
95
+ print(f" {key}: {value}")
96
+
97
+ if info['RELEASE']:
98
+ print(f"Релиз: {info['RELEASE']}")
99
+ ```
100
+
101
+ ## API
102
+
103
+ ### Github.search()
104
+
105
+ ```py
106
+ Github.search(main_repo=None, per_page=100)
107
+ ```
108
+
109
+ Ищет репозитории, связанные с основным репозиторием.
110
+
111
+ Параметры:
112
+
113
+ ```PY
114
+ - main_repo (str): URL основного репозитория (по умолчанию: None)
115
+ - per_page (int): Количество результатов на страницу (по умолчанию: 100)
116
+ ```
117
+
118
+ Возвращает:
119
+
120
+ ```PY
121
+ - dict: Словарь с информацией о найденных репозиториях
122
+ ```
123
+
124
+ Исключения:
125
+
126
+ ```py
127
+ - GithubError: Ошибка при поиске или загрузке
128
+ ```
129
+
130
+ ### Github.download()
131
+
132
+ ```py
133
+ Github.download(owner, repo, filename)
134
+ ```
135
+
136
+ Скачивает файл из корня репозитория.
137
+
138
+ Параметры:
139
+
140
+ ```py
141
+ - owner (str): Владелец репозитория
142
+ - repo (str): Название репозитория
143
+ - filename (str): Имя файла
144
+ ```
145
+
146
+ Возвращает:
147
+
148
+ ```py
149
+ - bytes: Содержимое файла или None если файл не найден
150
+ ```
151
+
152
+ ## Формат возвращаемых данных
153
+
154
+ ```json
155
+ {
156
+ "NameOfRepo": {
157
+ "DEV": ["Developer 1", "Developer 2"],
158
+ "LINK": "https://github.com/owner/NameOfRepo",
159
+ "FILES": {
160
+ "EXE": "main.exe",
161
+ "MAN": "manifest.json",
162
+ "ICO": "icon.ico"
163
+ },
164
+ "RELEASE": "https://github.com/owner/NameOfRepo/releases/download/v1.0/asset.zip"
165
+ }
166
+ }
167
+ ```
168
+
169
+ ## Логирование
170
+
171
+ Все операции логируются через LLS в logs/GitHub/:
172
+
173
+ ```log
174
+ [25.07.2026 21:59:18] [INFO] [repository.py] [search] [45] -> Найдено репозиториев, связанных с [owner/main-repo]: 5.
175
+ [25.07.2026 21:59:18] [ERROR] [repository.py] [search] [30] -> Не удалось найти репозитории: 404 Not Found
176
+ ```
177
+
178
+ ## Структура логов
179
+
180
+ ```text
181
+ logs/
182
+ └── GitHub/
183
+ ├── debug/
184
+ ├── info/
185
+ │ └── 21.59.18_25.07.2026.log
186
+ ├── warnings/
187
+ ├── errors/
188
+ │ └── 21.59.18_25.07.2026.log
189
+ └── critical/
190
+ ```
191
+
192
+ ## Зависимости
193
+
194
+ [LibraryHttp (LH)](https://github.com/EOF-413/LibraryHttp)
195
+ [LibraryLogSystem (LLS)](https://github.com/EOF-413/LibraryLogSystem)
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ EOF_413_LGH.egg-info/PKG-INFO
5
+ EOF_413_LGH.egg-info/SOURCES.txt
6
+ EOF_413_LGH.egg-info/dependency_links.txt
7
+ EOF_413_LGH.egg-info/requires.txt
8
+ EOF_413_LGH.egg-info/top_level.txt
9
+ LGH/__init__.py
10
+ LGH/repository.py
@@ -0,0 +1,2 @@
1
+ EOF_413_LLS>=1.1.0
2
+ EOF_413_LH>=1.0.1
@@ -0,0 +1,5 @@
1
+ from .repository import Github
2
+
3
+ __all__ = [
4
+ 'Github'
5
+ ]
@@ -0,0 +1,141 @@
1
+ import json
2
+ import urllib.error
3
+ import urllib.parse
4
+
5
+ from LH import Http
6
+ from LLS import log_init
7
+
8
+ log = log_init('modules/GitHub')
9
+
10
+ API_ROOT = 'https://api.github.com'
11
+
12
+
13
+ class GithubError(Exception):
14
+ pass
15
+
16
+
17
+ class Github:
18
+ """
19
+ Общая библиотека поиска репозиториев, связанных с главным репозиторием.
20
+ Связь определяется по ссылке на главный репозиторий в "О нас" - "Иконка настроек" - "Описание".
21
+
22
+ Пример "О нас:
23
+ AmazingMultiTool - программа, созданная соединить все бот-программы в одно удобное приложение,
24
+ Наш основной репозиторий: https://github.com/EOF-413/AmazingMultiTool!"
25
+ """
26
+
27
+ @staticmethod
28
+ def search(main_repo=None, per_page=100):
29
+ """
30
+ Возвращает словарь:
31
+ {
32
+ "NameOfRepo": {
33
+ "DEV": ["DEV 1", "DEV 2", "DEV 3", "..."],
34
+ "LINK": "https://github.com/owner/NameOfRepo",
35
+ "FILES": {"EXE": "main.exe", "MAN": "manifest.json", "ICO": "icon.ico"},
36
+ "RELEASE": "https://.../asset.zip" # None, если релиза с zip-ассетом нет
37
+ }
38
+ }
39
+ """
40
+
41
+ if main_repo is None:
42
+ raise GithubError('Не был передан основной репозиторий.')
43
+
44
+ main_repo = main_repo.rstrip('/').replace('https://github.com/', '')
45
+
46
+ query = urllib.parse.quote(f'"https://github.com/{main_repo}" in:description', safe='')
47
+
48
+ try:
49
+ data = Http.get_json(f'{API_ROOT}/search/repositories?q={query}&per_page={per_page}')
50
+ except urllib.error.HTTPError as e:
51
+ log.error(f"Не удалось найти репозитории, связанные с [{main_repo}]: {e}")
52
+ raise GithubError(f'Не удалось загрузить список репозиториев: {e}')
53
+ except (urllib.error.URLError, json.JSONDecodeError) as e:
54
+ log.error(f"Не удалось найти репозитории, связанные с [{main_repo}]: {e}")
55
+ raise GithubError(f'Не удалось загрузить список репозиториев: {e}')
56
+
57
+ items = data.get('items', [])
58
+ count = data.get('total_count', len(items))
59
+ if count > len(items):
60
+ log.warning(f"Найдено {count} репозиториев, обработано {len(items)} (ограничение: {per_page}.).")
61
+
62
+ dependents = {}
63
+ for repo in items:
64
+ owner = repo['owner']['login']
65
+ name = repo['name']
66
+
67
+ dependents[name] = {
68
+ 'DEV': [owner],
69
+ 'LINK': repo.get('html_url', f'https://github.com/{owner}/{name}'),
70
+ 'FILES': Github._scan(owner, name),
71
+ 'RELEASE': Github._latest(owner, name),
72
+ }
73
+
74
+ log.info(f"Найдено репозиториев, связанных с [{main_repo}]: {len(dependents)}.")
75
+ return dependents
76
+
77
+ @staticmethod
78
+ def download(owner, repo, filename):
79
+ """Скачивает файл из корня репозитория (ветка по умолчанию). None, если не удалось."""
80
+ try:
81
+ data = Http.get_json(f'{API_ROOT}/repos/{owner}/{repo}/contents/{filename}')
82
+ except urllib.error.HTTPError as e:
83
+ log.debug(f"Не удалось получить [{filename}] из {owner}/{repo}: {e}")
84
+ return None
85
+ except (urllib.error.URLError, json.JSONDecodeError) as e:
86
+ log.debug(f"Не удалось получить [{filename}] из {owner}/{repo}: {e}")
87
+ return None
88
+
89
+ download_url = data.get('download_url')
90
+
91
+ if not download_url:
92
+ return None
93
+
94
+ try:
95
+ return Http.get(download_url)
96
+ except urllib.error.URLError as e:
97
+ log.debug(f"Не удалось скачать [{filename}] из {owner}/{repo}: {e}")
98
+ return None
99
+
100
+ @staticmethod
101
+ def _scan(owner, repo):
102
+ try:
103
+ items = Http.get_json(f'{API_ROOT}/repos/{owner}/{repo}/contents/')
104
+ except urllib.error.HTTPError as e:
105
+ log.debug(f"Не удалось получить список файлов {owner}/{repo}: {e}")
106
+ return {}
107
+ except (urllib.error.URLError, json.JSONDecodeError) as e:
108
+ log.debug(f"Не удалось получить список файлов {owner}/{repo}: {e}")
109
+ return {}
110
+
111
+ files = {}
112
+ for item in items:
113
+ if item.get('type') != 'file':
114
+ continue
115
+ name = item.get('name', '')
116
+ lower = name.lower()
117
+ if lower.endswith('.exe') and 'EXE' not in files:
118
+ files['EXE'] = name
119
+ elif lower == 'manifest.json':
120
+ files['MAN'] = name
121
+ elif lower == 'icon.ico':
122
+ files['ICO'] = name
123
+ return files
124
+
125
+ @staticmethod
126
+ def _latest(owner, repo):
127
+ try:
128
+ release = Http.get_json(f'{API_ROOT}/repos/{owner}/{repo}/releases/latest')
129
+ except urllib.error.HTTPError as e:
130
+ log.debug(f"Нет релизов у {owner}/{repo}: {e}")
131
+ return None
132
+ except (urllib.error.URLError, json.JSONDecodeError) as e:
133
+ log.debug(f"Не удалось получить релиз {owner}/{repo}: {e}")
134
+ return None
135
+
136
+ assets = release.get('assets', [])
137
+ zip_assets = [a for a in assets if a.get('name', '').lower().endswith('.zip')]
138
+ if not zip_assets:
139
+ log.error(f"В последнем релизе {owner}/{repo} нет zip-ассета.")
140
+ return None
141
+ return zip_assets[0]['browser_download_url']
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 EOF-413
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: EOF_413_LGH
3
+ Version: 1.0.0
4
+ Summary: Библиотека для работы с GitHub API.
5
+ Home-page: https://github.com/EOF-413/LibraryGitHub
6
+ Author: EOF-413
7
+ Author-email: org.animea@mail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.6
10
+ Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: EOF_413_LLS>=1.1.0
22
+ Requires-Dist: EOF_413_LH>=1.0.1
23
+ Dynamic: author
24
+ Dynamic: author-email
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # LibraryGitHub (LGH)
35
+
36
+ **LGH** - это библиотека для работы с GitHub API. Позволяет искать репозитории, связанные с основным репозиторием, и скачивать файлы.
37
+
38
+ ## Особенности
39
+
40
+ - Поиск репозиториев, связанных с основным репозиторием (по ссылке в описании)
41
+ - Получение информации о файлах в корне репозитория
42
+ - Получение ссылки на последний релиз с ZIP-ассетом
43
+ - Интеграция с LibraryHttp (LH)
44
+ - Интеграция с LibraryLogSystem (LLS)
45
+
46
+ ## Установка
47
+
48
+ ```py
49
+ from LGH import Github
50
+ ```
51
+
52
+ ## Использование
53
+
54
+ ### Поиск связанных репозиториев
55
+
56
+ # Поиск репозиториев, связанных с основным
57
+
58
+ ```py
59
+ from LGH import Github
60
+
61
+ repos = Github.search('https://github.com/owner/main-repo')
62
+
63
+ # Поиск с ограничением количества
64
+ repos = Github.search('https://github.com/owner/main-repo', per_page=50)
65
+ ```
66
+
67
+ ### Скачивание файлов из репозитория
68
+
69
+ ```py
70
+ from LGH import Github
71
+
72
+ # Скачивание файла из корня репозитория
73
+ file_content = Github.download('owner', 'repo', 'manifest.json')
74
+
75
+ if file_content:
76
+ with open('manifest.json', 'wb') as f:
77
+ f.write(file_content)
78
+ ```
79
+
80
+ ### Получение информации о файлах
81
+
82
+ ```py
83
+ from LGH import Github
84
+
85
+ repos = Github.search('https://github.com/owner/main-repo')
86
+
87
+ for name, info in repos.items():
88
+ print(f"Репозиторий: {name}")
89
+ print(f"Разработчик: {info['DEV']}")
90
+ print(f"Ссылка: {info['LINK']}")
91
+
92
+ if info['FILES']:
93
+ print("Файлы:")
94
+ for key, value in info['FILES'].items():
95
+ print(f" {key}: {value}")
96
+
97
+ if info['RELEASE']:
98
+ print(f"Релиз: {info['RELEASE']}")
99
+ ```
100
+
101
+ ## API
102
+
103
+ ### Github.search()
104
+
105
+ ```py
106
+ Github.search(main_repo=None, per_page=100)
107
+ ```
108
+
109
+ Ищет репозитории, связанные с основным репозиторием.
110
+
111
+ Параметры:
112
+
113
+ ```PY
114
+ - main_repo (str): URL основного репозитория (по умолчанию: None)
115
+ - per_page (int): Количество результатов на страницу (по умолчанию: 100)
116
+ ```
117
+
118
+ Возвращает:
119
+
120
+ ```PY
121
+ - dict: Словарь с информацией о найденных репозиториях
122
+ ```
123
+
124
+ Исключения:
125
+
126
+ ```py
127
+ - GithubError: Ошибка при поиске или загрузке
128
+ ```
129
+
130
+ ### Github.download()
131
+
132
+ ```py
133
+ Github.download(owner, repo, filename)
134
+ ```
135
+
136
+ Скачивает файл из корня репозитория.
137
+
138
+ Параметры:
139
+
140
+ ```py
141
+ - owner (str): Владелец репозитория
142
+ - repo (str): Название репозитория
143
+ - filename (str): Имя файла
144
+ ```
145
+
146
+ Возвращает:
147
+
148
+ ```py
149
+ - bytes: Содержимое файла или None если файл не найден
150
+ ```
151
+
152
+ ## Формат возвращаемых данных
153
+
154
+ ```json
155
+ {
156
+ "NameOfRepo": {
157
+ "DEV": ["Developer 1", "Developer 2"],
158
+ "LINK": "https://github.com/owner/NameOfRepo",
159
+ "FILES": {
160
+ "EXE": "main.exe",
161
+ "MAN": "manifest.json",
162
+ "ICO": "icon.ico"
163
+ },
164
+ "RELEASE": "https://github.com/owner/NameOfRepo/releases/download/v1.0/asset.zip"
165
+ }
166
+ }
167
+ ```
168
+
169
+ ## Логирование
170
+
171
+ Все операции логируются через LLS в logs/GitHub/:
172
+
173
+ ```log
174
+ [25.07.2026 21:59:18] [INFO] [repository.py] [search] [45] -> Найдено репозиториев, связанных с [owner/main-repo]: 5.
175
+ [25.07.2026 21:59:18] [ERROR] [repository.py] [search] [30] -> Не удалось найти репозитории: 404 Not Found
176
+ ```
177
+
178
+ ## Структура логов
179
+
180
+ ```text
181
+ logs/
182
+ └── GitHub/
183
+ ├── debug/
184
+ ├── info/
185
+ │ └── 21.59.18_25.07.2026.log
186
+ ├── warnings/
187
+ ├── errors/
188
+ │ └── 21.59.18_25.07.2026.log
189
+ └── critical/
190
+ ```
191
+
192
+ ## Зависимости
193
+
194
+ [LibraryHttp (LH)](https://github.com/EOF-413/LibraryHttp)
195
+ [LibraryLogSystem (LLS)](https://github.com/EOF-413/LibraryLogSystem)
@@ -0,0 +1,162 @@
1
+ # LibraryGitHub (LGH)
2
+
3
+ **LGH** - это библиотека для работы с GitHub API. Позволяет искать репозитории, связанные с основным репозиторием, и скачивать файлы.
4
+
5
+ ## Особенности
6
+
7
+ - Поиск репозиториев, связанных с основным репозиторием (по ссылке в описании)
8
+ - Получение информации о файлах в корне репозитория
9
+ - Получение ссылки на последний релиз с ZIP-ассетом
10
+ - Интеграция с LibraryHttp (LH)
11
+ - Интеграция с LibraryLogSystem (LLS)
12
+
13
+ ## Установка
14
+
15
+ ```py
16
+ from LGH import Github
17
+ ```
18
+
19
+ ## Использование
20
+
21
+ ### Поиск связанных репозиториев
22
+
23
+ # Поиск репозиториев, связанных с основным
24
+
25
+ ```py
26
+ from LGH import Github
27
+
28
+ repos = Github.search('https://github.com/owner/main-repo')
29
+
30
+ # Поиск с ограничением количества
31
+ repos = Github.search('https://github.com/owner/main-repo', per_page=50)
32
+ ```
33
+
34
+ ### Скачивание файлов из репозитория
35
+
36
+ ```py
37
+ from LGH import Github
38
+
39
+ # Скачивание файла из корня репозитория
40
+ file_content = Github.download('owner', 'repo', 'manifest.json')
41
+
42
+ if file_content:
43
+ with open('manifest.json', 'wb') as f:
44
+ f.write(file_content)
45
+ ```
46
+
47
+ ### Получение информации о файлах
48
+
49
+ ```py
50
+ from LGH import Github
51
+
52
+ repos = Github.search('https://github.com/owner/main-repo')
53
+
54
+ for name, info in repos.items():
55
+ print(f"Репозиторий: {name}")
56
+ print(f"Разработчик: {info['DEV']}")
57
+ print(f"Ссылка: {info['LINK']}")
58
+
59
+ if info['FILES']:
60
+ print("Файлы:")
61
+ for key, value in info['FILES'].items():
62
+ print(f" {key}: {value}")
63
+
64
+ if info['RELEASE']:
65
+ print(f"Релиз: {info['RELEASE']}")
66
+ ```
67
+
68
+ ## API
69
+
70
+ ### Github.search()
71
+
72
+ ```py
73
+ Github.search(main_repo=None, per_page=100)
74
+ ```
75
+
76
+ Ищет репозитории, связанные с основным репозиторием.
77
+
78
+ Параметры:
79
+
80
+ ```PY
81
+ - main_repo (str): URL основного репозитория (по умолчанию: None)
82
+ - per_page (int): Количество результатов на страницу (по умолчанию: 100)
83
+ ```
84
+
85
+ Возвращает:
86
+
87
+ ```PY
88
+ - dict: Словарь с информацией о найденных репозиториях
89
+ ```
90
+
91
+ Исключения:
92
+
93
+ ```py
94
+ - GithubError: Ошибка при поиске или загрузке
95
+ ```
96
+
97
+ ### Github.download()
98
+
99
+ ```py
100
+ Github.download(owner, repo, filename)
101
+ ```
102
+
103
+ Скачивает файл из корня репозитория.
104
+
105
+ Параметры:
106
+
107
+ ```py
108
+ - owner (str): Владелец репозитория
109
+ - repo (str): Название репозитория
110
+ - filename (str): Имя файла
111
+ ```
112
+
113
+ Возвращает:
114
+
115
+ ```py
116
+ - bytes: Содержимое файла или None если файл не найден
117
+ ```
118
+
119
+ ## Формат возвращаемых данных
120
+
121
+ ```json
122
+ {
123
+ "NameOfRepo": {
124
+ "DEV": ["Developer 1", "Developer 2"],
125
+ "LINK": "https://github.com/owner/NameOfRepo",
126
+ "FILES": {
127
+ "EXE": "main.exe",
128
+ "MAN": "manifest.json",
129
+ "ICO": "icon.ico"
130
+ },
131
+ "RELEASE": "https://github.com/owner/NameOfRepo/releases/download/v1.0/asset.zip"
132
+ }
133
+ }
134
+ ```
135
+
136
+ ## Логирование
137
+
138
+ Все операции логируются через LLS в logs/GitHub/:
139
+
140
+ ```log
141
+ [25.07.2026 21:59:18] [INFO] [repository.py] [search] [45] -> Найдено репозиториев, связанных с [owner/main-repo]: 5.
142
+ [25.07.2026 21:59:18] [ERROR] [repository.py] [search] [30] -> Не удалось найти репозитории: 404 Not Found
143
+ ```
144
+
145
+ ## Структура логов
146
+
147
+ ```text
148
+ logs/
149
+ └── GitHub/
150
+ ├── debug/
151
+ ├── info/
152
+ │ └── 21.59.18_25.07.2026.log
153
+ ├── warnings/
154
+ ├── errors/
155
+ │ └── 21.59.18_25.07.2026.log
156
+ └── critical/
157
+ ```
158
+
159
+ ## Зависимости
160
+
161
+ [LibraryHttp (LH)](https://github.com/EOF-413/LibraryHttp)
162
+ [LibraryLogSystem (LLS)](https://github.com/EOF-413/LibraryLogSystem)
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,33 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open('README.md', encoding='utf-8') as f:
4
+ long_description = f.read()
5
+
6
+ setup(
7
+ name='EOF_413_LGH',
8
+ version='1.0.0',
9
+ author='EOF-413',
10
+ author_email='org.animea@mail.com',
11
+ description='Библиотека для работы с GitHub API.',
12
+ long_description=long_description,
13
+ long_description_content_type='text/markdown',
14
+ url='https://github.com/EOF-413/LibraryGitHub',
15
+ packages=find_packages(),
16
+ classifiers=[
17
+ 'Programming Language :: Python :: 3',
18
+ 'Programming Language :: Python :: 3.6',
19
+ 'Programming Language :: Python :: 3.7',
20
+ 'Programming Language :: Python :: 3.8',
21
+ 'Programming Language :: Python :: 3.9',
22
+ 'Programming Language :: Python :: 3.10',
23
+ 'Programming Language :: Python :: 3.11',
24
+ 'Operating System :: OS Independent',
25
+ 'Intended Audience :: Developers',
26
+ 'Topic :: Software Development :: Libraries :: Python Modules',
27
+ ],
28
+ python_requires='>=3.6',
29
+ install_requires=[
30
+ 'EOF_413_LLS>=1.1.0',
31
+ 'EOF_413_LH>=1.0.1'
32
+ ],
33
+ )