lupaxa-github-extractor 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.
Files changed (35) hide show
  1. lupaxa_github_extractor-0.1.0/LICENCE +21 -0
  2. lupaxa_github_extractor-0.1.0/PKG-INFO +175 -0
  3. lupaxa_github_extractor-0.1.0/README.md +132 -0
  4. lupaxa_github_extractor-0.1.0/pyproject.toml +232 -0
  5. lupaxa_github_extractor-0.1.0/setup.cfg +4 -0
  6. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/__init__.py +98 -0
  7. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/__main__.py +10 -0
  8. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/cli.py +383 -0
  9. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/client.py +390 -0
  10. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/constants.py +10 -0
  11. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/convert.py +182 -0
  12. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/errors.py +76 -0
  13. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/filters.py +47 -0
  14. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/http.py +289 -0
  15. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/models.py +362 -0
  16. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/pool.py +34 -0
  17. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/resources.py +66 -0
  18. lupaxa_github_extractor-0.1.0/src/lupaxa/github_extractor/version.py +10 -0
  19. lupaxa_github_extractor-0.1.0/src/lupaxa_github_extractor.egg-info/PKG-INFO +175 -0
  20. lupaxa_github_extractor-0.1.0/src/lupaxa_github_extractor.egg-info/SOURCES.txt +33 -0
  21. lupaxa_github_extractor-0.1.0/src/lupaxa_github_extractor.egg-info/dependency_links.txt +1 -0
  22. lupaxa_github_extractor-0.1.0/src/lupaxa_github_extractor.egg-info/entry_points.txt +2 -0
  23. lupaxa_github_extractor-0.1.0/src/lupaxa_github_extractor.egg-info/requires.txt +13 -0
  24. lupaxa_github_extractor-0.1.0/src/lupaxa_github_extractor.egg-info/top_level.txt +1 -0
  25. lupaxa_github_extractor-0.1.0/tests/test_cli.py +482 -0
  26. lupaxa_github_extractor-0.1.0/tests/test_client_addons.py +273 -0
  27. lupaxa_github_extractor-0.1.0/tests/test_client_get.py +88 -0
  28. lupaxa_github_extractor-0.1.0/tests/test_client_orgs.py +139 -0
  29. lupaxa_github_extractor-0.1.0/tests/test_client_repos.py +187 -0
  30. lupaxa_github_extractor-0.1.0/tests/test_client_resources.py +503 -0
  31. lupaxa_github_extractor-0.1.0/tests/test_client_user.py +328 -0
  32. lupaxa_github_extractor-0.1.0/tests/test_filters.py +100 -0
  33. lupaxa_github_extractor-0.1.0/tests/test_http.py +540 -0
  34. lupaxa_github_extractor-0.1.0/tests/test_models.py +123 -0
  35. lupaxa_github_extractor-0.1.0/tests/test_version.py +14 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) The Lupaxa Project
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,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: lupaxa-github-extractor
3
+ Version: 0.1.0
4
+ Summary: List GitHub organisations, repositories, and related data.
5
+ Author: The Lupaxa Project
6
+ Maintainer: The Lupaxa Project
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/lupaxa-api-extractor-toolbox/github-extractor
9
+ Project-URL: Repository, https://github.com/lupaxa-api-extractor-toolbox/github-extractor
10
+ Project-URL: Issues, https://github.com/lupaxa-api-extractor-toolbox/github-extractor/issues
11
+ Keywords: github,extractor,api
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Natural Language :: English
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: POSIX
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3 :: Only
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Topic :: Software Development
28
+ Requires-Python: >=3.11
29
+ Description-Content-Type: text/markdown
30
+ License-File: LICENCE
31
+ Requires-Dist: requests<3.0.0,>=2.32.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: build<2.0.0,>=1.2.2; extra == "dev"
34
+ Requires-Dist: mypy<2.0.0,>=1.17.0; extra == "dev"
35
+ Requires-Dist: pytest<9.0.0,>=8.4.0; extra == "dev"
36
+ Requires-Dist: pytest-cov<7.0.0,>=6.2.0; extra == "dev"
37
+ Requires-Dist: ruff<1.0.0,>=0.12.0; extra == "dev"
38
+ Requires-Dist: twine<7.0.0,>=6.1.0; extra == "dev"
39
+ Provides-Extra: test
40
+ Requires-Dist: pytest>=8.0; extra == "test"
41
+ Requires-Dist: pytest-cov>=5.0; extra == "test"
42
+ Dynamic: license-file
43
+
44
+ <p align="center">
45
+ <a href="https://github.com/lupaxa-api-extractor-toolbox">
46
+ <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/organisations/api-extractor-toolbox/readme-logo.png" alt="API Extractor Toolbox" />
47
+ </a>
48
+ </p>
49
+
50
+ <h1 align="center">GitHub Extractor</h1>
51
+
52
+ Read-only access to GitHub organisations, repositories, and the related data
53
+ you ask for. It is a Python library, `lupaxa.github_extractor`, and a
54
+ `github-extractor` command. It does not create, update, or delete GitHub data.
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ pip install lupaxa-github-extractor
60
+ ```
61
+
62
+ > **Note:** The command reads the token from `--token`, then `GITHUB_TOKEN`,
63
+ > then `gh auth token`, and passes that string into `GitHubExtractor`. The
64
+ > library does not read the environment.
65
+
66
+ ## Library
67
+
68
+ ```python
69
+ from lupaxa.github_extractor import GitHubExtractor
70
+
71
+ client = GitHubExtractor(token)
72
+ repos = client.repositories_by_org(
73
+ "acme",
74
+ resources=("topics", "workflows", "languages", "commits", "issues"),
75
+ )
76
+
77
+ for repo in repos:
78
+ names = [] if repo.topics is None else repo.topics.names
79
+ workflows = [] if repo.workflows is None else [item.name for item in repo.workflows]
80
+ print(repo.full_name, names, workflows, repo.languages)
81
+ for failure in repo.errors:
82
+ print(failure.addon, failure.status, failure.message)
83
+ ```
84
+
85
+ `resources` is one list. These names can be mixed in the same call:
86
+ `branches`, `contributors`, `languages`, `releases`, `tags`, `topics`,
87
+ `workflows`, `commits`, `issues`, `pulls`, `milestones`, `forks`,
88
+ `stargazers`, `subscribers`, `collaborators`, `labels`, `workflow_runs`,
89
+ `deployments`, `environments`, and `contents`. Organisation extras include
90
+ `audit_log`. User extras include `notifications`. A name that was not
91
+ requested is `None`.
92
+
93
+ `params` sets query strings per resource name. Each key must appear in the
94
+ `resources` list for that call. `issues` and `pulls` default to `state=all`.
95
+ `notifications` defaults to `all=true`. Caller values replace defaults.
96
+
97
+ ```python
98
+ repo = client.repository(
99
+ "acme/widget",
100
+ resources=("topics", "workflows", "workflow_runs", "issues"),
101
+ params={"issues": {"state": "closed"}},
102
+ )
103
+ user = client.authenticated_user(
104
+ resources=("repos", "notifications"),
105
+ repository_resources=("topics", "commits"),
106
+ )
107
+ ```
108
+
109
+ `repository(full_name, ...)` returns one repository. On `authenticated_user`,
110
+ `repository_resources` fetches extras on each repo in `repos`, `starred`, or
111
+ `subscriptions` when one of those lists is requested.
112
+
113
+ `topics` is one object with `names`. `workflows` is a list of workflow
114
+ objects, without `total_count`. `languages` is a dictionary of byte counts.
115
+ `forks` in that list replaces GitHub's integer fork count. Other fields from
116
+ the repository JSON stay on `repo.raw`.
117
+
118
+ A `404`, `409`, or `410` on one extra stores an empty list for that name and
119
+ records the failure on `errors`. The rest of the result is still returned.
120
+ Authentication failures, rate limits, and other `403` responses raise.
121
+
122
+ `slugs=True` stays a boolean. It returns names only and does not fetch
123
+ `resources`, even when that list is set.
124
+
125
+ ```python
126
+ names = client.repositories_by_org("acme", slugs=True)
127
+ ```
128
+
129
+ The other list methods are `user_repositories` (omit `username` for the
130
+ authenticated user), `visible_repositories`, and `organisation_repositories`.
131
+ `organisations(resources=("members", "teams", "hooks"))` lists the token's
132
+ organisations. `authenticated_user(resources=("emails", "repos"))` returns the
133
+ token's user. `get("/repos/acme/widget/commits")` returns raw JSON for any
134
+ read-only API path. `max_pages=None` follows every page. A positive integer
135
+ stops after that many pages.
136
+
137
+ ## Command Line
138
+
139
+ Flags are the command-line form of the same resource names. Order on the
140
+ command line does not matter.
141
+
142
+ ```bash
143
+ github-extractor repo acme/widget --topics --workflows --workflow-runs
144
+ github-extractor repos org acme --topics --workflows --languages --commits --issues
145
+ github-extractor repos user --username ada --releases --tags --pulls
146
+ github-extractor repos visible --skip-private --include 'acme/*' --topics
147
+ github-extractor repos organisations --include-org 'acme*'
148
+ github-extractor repos organizations --include-org 'acme*'
149
+ github-extractor organisations --members --teams --hooks
150
+ github-extractor user --repos --topics --notifications
151
+ github-extractor repos org acme --issues --param issues.state=closed --api-root https://github.example/api/v3
152
+ github-extractor repos org acme --slugs
153
+ github-extractor get /repos/acme/widget/commits --max-pages 2
154
+ ```
155
+
156
+ `--include` and `--ignore` are case-insensitive globs on `full_name`.
157
+ `--include-name` and `--ignore-name` match the repository name.
158
+ `--include-org` and `--ignore-org` limit `repos organisations` and
159
+ `repos organizations`. Repeat a flag to pass more than one glob. `--param`
160
+ sets `name.key=value` query parameters. `--api-root` overrides the API host.
161
+ `--max-pages` caps paging. `--timeout` and `--max-workers` default to 10
162
+ seconds and 8 workers.
163
+
164
+ The command prints JSON indented with two spaces. It exits `0` on success,
165
+ `2` for usage and a missing token, `3` for authentication, `4` for a rate
166
+ limit, `5` when a primary request is not found, and `1` for everything else.
167
+
168
+ ## Documentation
169
+
170
+ Longer walks and the full method list are in the
171
+ [documentation](https://github-extractor.thelupaxaproject.org/).
172
+
173
+ <a href="https://github.com/the-lupaxa-project">
174
+ <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/components/footer-for-child-orgs.svg" alt="The Lupaxa Project Footer" width="100%" />
175
+ </a>
@@ -0,0 +1,132 @@
1
+ <p align="center">
2
+ <a href="https://github.com/lupaxa-api-extractor-toolbox">
3
+ <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/organisations/api-extractor-toolbox/readme-logo.png" alt="API Extractor Toolbox" />
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">GitHub Extractor</h1>
8
+
9
+ Read-only access to GitHub organisations, repositories, and the related data
10
+ you ask for. It is a Python library, `lupaxa.github_extractor`, and a
11
+ `github-extractor` command. It does not create, update, or delete GitHub data.
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install lupaxa-github-extractor
17
+ ```
18
+
19
+ > **Note:** The command reads the token from `--token`, then `GITHUB_TOKEN`,
20
+ > then `gh auth token`, and passes that string into `GitHubExtractor`. The
21
+ > library does not read the environment.
22
+
23
+ ## Library
24
+
25
+ ```python
26
+ from lupaxa.github_extractor import GitHubExtractor
27
+
28
+ client = GitHubExtractor(token)
29
+ repos = client.repositories_by_org(
30
+ "acme",
31
+ resources=("topics", "workflows", "languages", "commits", "issues"),
32
+ )
33
+
34
+ for repo in repos:
35
+ names = [] if repo.topics is None else repo.topics.names
36
+ workflows = [] if repo.workflows is None else [item.name for item in repo.workflows]
37
+ print(repo.full_name, names, workflows, repo.languages)
38
+ for failure in repo.errors:
39
+ print(failure.addon, failure.status, failure.message)
40
+ ```
41
+
42
+ `resources` is one list. These names can be mixed in the same call:
43
+ `branches`, `contributors`, `languages`, `releases`, `tags`, `topics`,
44
+ `workflows`, `commits`, `issues`, `pulls`, `milestones`, `forks`,
45
+ `stargazers`, `subscribers`, `collaborators`, `labels`, `workflow_runs`,
46
+ `deployments`, `environments`, and `contents`. Organisation extras include
47
+ `audit_log`. User extras include `notifications`. A name that was not
48
+ requested is `None`.
49
+
50
+ `params` sets query strings per resource name. Each key must appear in the
51
+ `resources` list for that call. `issues` and `pulls` default to `state=all`.
52
+ `notifications` defaults to `all=true`. Caller values replace defaults.
53
+
54
+ ```python
55
+ repo = client.repository(
56
+ "acme/widget",
57
+ resources=("topics", "workflows", "workflow_runs", "issues"),
58
+ params={"issues": {"state": "closed"}},
59
+ )
60
+ user = client.authenticated_user(
61
+ resources=("repos", "notifications"),
62
+ repository_resources=("topics", "commits"),
63
+ )
64
+ ```
65
+
66
+ `repository(full_name, ...)` returns one repository. On `authenticated_user`,
67
+ `repository_resources` fetches extras on each repo in `repos`, `starred`, or
68
+ `subscriptions` when one of those lists is requested.
69
+
70
+ `topics` is one object with `names`. `workflows` is a list of workflow
71
+ objects, without `total_count`. `languages` is a dictionary of byte counts.
72
+ `forks` in that list replaces GitHub's integer fork count. Other fields from
73
+ the repository JSON stay on `repo.raw`.
74
+
75
+ A `404`, `409`, or `410` on one extra stores an empty list for that name and
76
+ records the failure on `errors`. The rest of the result is still returned.
77
+ Authentication failures, rate limits, and other `403` responses raise.
78
+
79
+ `slugs=True` stays a boolean. It returns names only and does not fetch
80
+ `resources`, even when that list is set.
81
+
82
+ ```python
83
+ names = client.repositories_by_org("acme", slugs=True)
84
+ ```
85
+
86
+ The other list methods are `user_repositories` (omit `username` for the
87
+ authenticated user), `visible_repositories`, and `organisation_repositories`.
88
+ `organisations(resources=("members", "teams", "hooks"))` lists the token's
89
+ organisations. `authenticated_user(resources=("emails", "repos"))` returns the
90
+ token's user. `get("/repos/acme/widget/commits")` returns raw JSON for any
91
+ read-only API path. `max_pages=None` follows every page. A positive integer
92
+ stops after that many pages.
93
+
94
+ ## Command Line
95
+
96
+ Flags are the command-line form of the same resource names. Order on the
97
+ command line does not matter.
98
+
99
+ ```bash
100
+ github-extractor repo acme/widget --topics --workflows --workflow-runs
101
+ github-extractor repos org acme --topics --workflows --languages --commits --issues
102
+ github-extractor repos user --username ada --releases --tags --pulls
103
+ github-extractor repos visible --skip-private --include 'acme/*' --topics
104
+ github-extractor repos organisations --include-org 'acme*'
105
+ github-extractor repos organizations --include-org 'acme*'
106
+ github-extractor organisations --members --teams --hooks
107
+ github-extractor user --repos --topics --notifications
108
+ github-extractor repos org acme --issues --param issues.state=closed --api-root https://github.example/api/v3
109
+ github-extractor repos org acme --slugs
110
+ github-extractor get /repos/acme/widget/commits --max-pages 2
111
+ ```
112
+
113
+ `--include` and `--ignore` are case-insensitive globs on `full_name`.
114
+ `--include-name` and `--ignore-name` match the repository name.
115
+ `--include-org` and `--ignore-org` limit `repos organisations` and
116
+ `repos organizations`. Repeat a flag to pass more than one glob. `--param`
117
+ sets `name.key=value` query parameters. `--api-root` overrides the API host.
118
+ `--max-pages` caps paging. `--timeout` and `--max-workers` default to 10
119
+ seconds and 8 workers.
120
+
121
+ The command prints JSON indented with two spaces. It exits `0` on success,
122
+ `2` for usage and a missing token, `3` for authentication, `4` for a rate
123
+ limit, `5` when a primary request is not found, and `1` for everything else.
124
+
125
+ ## Documentation
126
+
127
+ Longer walks and the full method list are in the
128
+ [documentation](https://github-extractor.thelupaxaproject.org/).
129
+
130
+ <a href="https://github.com/the-lupaxa-project">
131
+ <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/components/footer-for-child-orgs.svg" alt="The Lupaxa Project Footer" width="100%" />
132
+ </a>
@@ -0,0 +1,232 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "lupaxa-github-extractor"
7
+ version = "0.1.0"
8
+ description = "List GitHub organisations, repositories, and related data."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENCE"]
13
+ authors = [{ name = "The Lupaxa Project" }]
14
+ maintainers = [{ name = "The Lupaxa Project" }]
15
+ keywords = ["github", "extractor", "api"]
16
+ classifiers = [
17
+ "Development Status :: 2 - Pre-Alpha",
18
+ "Environment :: Console",
19
+ "Intended Audience :: Developers",
20
+ "Natural Language :: English",
21
+ "Operating System :: MacOS",
22
+ "Operating System :: Microsoft :: Windows",
23
+ "Operating System :: POSIX",
24
+ "Operating System :: POSIX :: Linux",
25
+ "Programming Language :: Python",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3 :: Only",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
32
+ "Topic :: Software Development",
33
+ ]
34
+ dependencies = ["requests>=2.32.0,<3.0.0"]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "build>=1.2.2,<2.0.0",
39
+ "mypy>=1.17.0,<2.0.0",
40
+ "pytest>=8.4.0,<9.0.0",
41
+ "pytest-cov>=6.2.0,<7.0.0",
42
+ "ruff>=0.12.0,<1.0.0",
43
+ "twine>=6.1.0,<7.0.0",
44
+ ]
45
+ test = ["pytest>=8.0", "pytest-cov>=5.0"]
46
+
47
+ [project.urls]
48
+ Homepage = "https://github.com/lupaxa-api-extractor-toolbox/github-extractor"
49
+ Repository = "https://github.com/lupaxa-api-extractor-toolbox/github-extractor"
50
+ Issues = "https://github.com/lupaxa-api-extractor-toolbox/github-extractor/issues"
51
+
52
+ [project.scripts]
53
+ github-extractor = "lupaxa.github_extractor.cli:main"
54
+
55
+ [tool.setuptools]
56
+ package-dir = { "" = "src" }
57
+
58
+ [tool.setuptools.packages.find]
59
+ where = ["src"]
60
+ include = ["lupaxa.github_extractor*"]
61
+ namespaces = true
62
+
63
+ [tool.ruff]
64
+ target-version = "py311"
65
+ line-length = 160
66
+ src = [
67
+ "src",
68
+ "tests",
69
+ ]
70
+ extend-exclude = [
71
+ ".mypy_cache",
72
+ ".pytest_cache",
73
+ ".tox",
74
+ ".venv",
75
+ "build",
76
+ "dist",
77
+ ]
78
+
79
+ [tool.ruff.lint]
80
+ select = [
81
+ "E",
82
+ "F",
83
+ "I",
84
+ "B",
85
+ "S",
86
+ "UP",
87
+ "SIM",
88
+ "C4",
89
+ "ISC",
90
+ "D",
91
+ "ANN",
92
+ "PT",
93
+ ]
94
+ ignore = [
95
+ "D200",
96
+ "D201",
97
+ "D202",
98
+ "D203",
99
+ "D204",
100
+ "D205",
101
+ "D206",
102
+ "D207",
103
+ "D208",
104
+ "D209",
105
+ "D210",
106
+ "D211",
107
+ "D212",
108
+ "ISC001",
109
+ ]
110
+
111
+ [tool.ruff.lint.per-file-ignores]
112
+ "tests/**/*.py" = [
113
+ "ANN",
114
+ "D",
115
+ "S101",
116
+ "S105",
117
+ ]
118
+
119
+ [tool.ruff.lint.flake8-annotations]
120
+ allow-star-arg-any = false
121
+ ignore-fully-untyped = false
122
+ mypy-init-return = true
123
+ suppress-dummy-args = false
124
+ suppress-none-returning = false
125
+
126
+ [tool.ruff.lint.flake8-builtins]
127
+ builtins-ignorelist = ["id"]
128
+
129
+ [tool.ruff.lint.flake8-pytest-style]
130
+ fixture-parentheses = false
131
+ mark-parentheses = false
132
+ parametrize-names-type = "tuple"
133
+ parametrize-values-row-type = "tuple"
134
+ parametrize-values-type = "list"
135
+
136
+ [tool.ruff.lint.flake8-quotes]
137
+ docstring-quotes = "double"
138
+ inline-quotes = "double"
139
+ multiline-quotes = "double"
140
+
141
+ [tool.ruff.lint.flake8-tidy-imports]
142
+ ban-relative-imports = "parents"
143
+
144
+ [tool.ruff.lint.isort]
145
+ combine-as-imports = true
146
+ force-sort-within-sections = true
147
+ known-first-party = ["lupaxa"]
148
+ split-on-trailing-comma = true
149
+
150
+ [tool.ruff.lint.mccabe]
151
+ max-complexity = 10
152
+
153
+ [tool.ruff.lint.pep8-naming]
154
+ classmethod-decorators = ["classmethod"]
155
+ staticmethod-decorators = ["staticmethod"]
156
+
157
+ [tool.ruff.lint.pylint]
158
+ allow-dunder-method-names = []
159
+ max-args = 10
160
+ max-branches = 12
161
+ max-returns = 6
162
+ max-statements = 50
163
+
164
+ [tool.ruff.lint.pyupgrade]
165
+ keep-runtime-typing = false
166
+
167
+ [tool.ruff.format]
168
+ docstring-code-format = true
169
+ docstring-code-line-length = 160
170
+ indent-style = "space"
171
+ line-ending = "lf"
172
+ quote-style = "double"
173
+ skip-magic-trailing-comma = false
174
+
175
+ [tool.mypy]
176
+ python_version = "3.11"
177
+ files = ["src", "tests"]
178
+ mypy_path = "src"
179
+ explicit_package_bases = true
180
+ packages = ["lupaxa.github_extractor"]
181
+ strict = true
182
+ pretty = true
183
+ show_column_numbers = true
184
+ show_error_codes = true
185
+ show_error_context = true
186
+ show_traceback = true
187
+ warn_unreachable = true
188
+ warn_unused_configs = true
189
+ exclude = ["^build/", "^dist/"]
190
+
191
+ [tool.pytest.ini_options]
192
+ minversion = "8.0"
193
+ addopts = [
194
+ "--strict-config",
195
+ "--strict-markers",
196
+ "--showlocals",
197
+ "--tb=short",
198
+ ]
199
+ testpaths = ["tests"]
200
+ pythonpath = ["src"]
201
+ xfail_strict = true
202
+ filterwarnings = ["error"]
203
+
204
+ [tool.coverage.run]
205
+ branch = true
206
+ parallel = true
207
+ source = ["lupaxa.github_extractor"]
208
+
209
+ [tool.coverage.paths]
210
+ source = [
211
+ "src/lupaxa/github_extractor",
212
+ "*/site-packages/lupaxa/github_extractor",
213
+ ]
214
+
215
+ [tool.coverage.report]
216
+ exclude_also = [
217
+ "if TYPE_CHECKING:",
218
+ "if __name__ == \"__main__\":",
219
+ "raise AssertionError",
220
+ "raise NotImplementedError",
221
+ ]
222
+ fail_under = 90
223
+ precision = 2
224
+ show_missing = true
225
+ skip_covered = false
226
+ skip_empty = true
227
+
228
+ [tool.coverage.html]
229
+ directory = "coverage/html"
230
+
231
+ [tool.coverage.xml]
232
+ output = "coverage/coverage.xml"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,98 @@
1
+ """List GitHub organisations, repositories, and related data."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .client import GitHubExtractor
6
+ from .errors import (
7
+ AuthenticationError,
8
+ ForbiddenError,
9
+ MissingOrgNameError,
10
+ MissingTokenError,
11
+ NotFoundError,
12
+ RateLimitExceededError,
13
+ RequestError,
14
+ RequestTimeoutError,
15
+ )
16
+ from .models import (
17
+ AuditEvent,
18
+ Branch,
19
+ Collaborator,
20
+ Commit,
21
+ Content,
22
+ Contributor,
23
+ Deployment,
24
+ Email,
25
+ Environment,
26
+ Event,
27
+ Fork,
28
+ GitHubObject,
29
+ GpgKey,
30
+ Hook,
31
+ Issue,
32
+ Label,
33
+ Milestone,
34
+ Notification,
35
+ Organisation,
36
+ PullRequest,
37
+ Release,
38
+ Repository,
39
+ ResourceError,
40
+ SshKey,
41
+ Stargazer,
42
+ Subscriber,
43
+ Tag,
44
+ Team,
45
+ TokenInformation,
46
+ Topics,
47
+ User,
48
+ Workflow,
49
+ WorkflowRun,
50
+ )
51
+ from .version import __version__, get_version
52
+
53
+ __all__ = [
54
+ "AuditEvent",
55
+ "AuthenticationError",
56
+ "Branch",
57
+ "Collaborator",
58
+ "Commit",
59
+ "Content",
60
+ "Contributor",
61
+ "Deployment",
62
+ "Email",
63
+ "Environment",
64
+ "Event",
65
+ "ForbiddenError",
66
+ "Fork",
67
+ "GitHubExtractor",
68
+ "GitHubObject",
69
+ "GpgKey",
70
+ "Hook",
71
+ "Issue",
72
+ "Label",
73
+ "Milestone",
74
+ "MissingOrgNameError",
75
+ "MissingTokenError",
76
+ "NotFoundError",
77
+ "Notification",
78
+ "Organisation",
79
+ "PullRequest",
80
+ "RateLimitExceededError",
81
+ "Release",
82
+ "Repository",
83
+ "RequestError",
84
+ "RequestTimeoutError",
85
+ "ResourceError",
86
+ "SshKey",
87
+ "Stargazer",
88
+ "Subscriber",
89
+ "Tag",
90
+ "Team",
91
+ "TokenInformation",
92
+ "Topics",
93
+ "User",
94
+ "Workflow",
95
+ "WorkflowRun",
96
+ "__version__",
97
+ "get_version",
98
+ ]
@@ -0,0 +1,10 @@
1
+ """Run GitHub Extractor as a module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+
7
+ from .cli import main
8
+
9
+ if __name__ == "__main__":
10
+ sys.exit(main())