github-issue-exporter 0.1.0__tar.gz → 0.2.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.
- github_issue_exporter-0.2.0/.github/workflows/ci.yml +35 -0
- github_issue_exporter-0.2.0/CLAUDE.md +74 -0
- github_issue_exporter-0.2.0/Justfile +22 -0
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/PKG-INFO +45 -14
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/README.md +43 -12
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/pyproject.toml +17 -1
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/__init__.py +4 -8
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/__main__.py +1 -1
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/cli/main.py +106 -81
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/auth.py +48 -41
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/config.py +67 -35
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/export_engine.py +164 -98
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/filesystem.py +159 -90
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/github_client.py +165 -104
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/transformer.py +33 -28
- github_issue_exporter-0.2.0/tests/conftest.py +197 -0
- github_issue_exporter-0.2.0/tests/test_auth.py +73 -0
- github_issue_exporter-0.2.0/tests/test_cli.py +167 -0
- github_issue_exporter-0.2.0/tests/test_config.py +58 -0
- github_issue_exporter-0.2.0/tests/test_export_engine.py +164 -0
- github_issue_exporter-0.2.0/tests/test_filesystem.py +140 -0
- github_issue_exporter-0.2.0/tests/test_github_client.py +188 -0
- github_issue_exporter-0.2.0/tests/test_transformer.py +32 -0
- github_issue_exporter-0.2.0/uv.lock +615 -0
- github_issue_exporter-0.1.0/uv.lock +0 -395
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/.github/workflows/publish.yml +0 -0
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/.gitignore +0 -0
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/.python-version +0 -0
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/architecture.md +0 -0
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/cli/__init__.py +0 -0
- {github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/core/__init__.py +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.11", "3.13"]
|
|
18
|
+
env:
|
|
19
|
+
UV_PYTHON: ${{ matrix.python-version }}
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v4
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync --locked
|
|
30
|
+
|
|
31
|
+
- name: Lint
|
|
32
|
+
run: uv run ruff check
|
|
33
|
+
|
|
34
|
+
- name: Test
|
|
35
|
+
run: uv run pytest
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Development Commands
|
|
6
|
+
|
|
7
|
+
### Package Management
|
|
8
|
+
- **Install dependencies**: `uv sync`
|
|
9
|
+
- **Install development dependencies**: `uv sync --dev`
|
|
10
|
+
- **Install as editable package**: `uv pip install -e .`
|
|
11
|
+
|
|
12
|
+
### Running the Application
|
|
13
|
+
- **Run CLI tool**: `python -m github_issue_exporter.cli.main`
|
|
14
|
+
- **Or via installed entry point**: `github-issue-exporter`
|
|
15
|
+
- **Single repository export**: `github-issue-exporter export owner/repo`
|
|
16
|
+
- **Multiple repositories**: `github-issue-exporter export owner/repo1,owner/repo2`
|
|
17
|
+
- **Show help**: `github-issue-exporter --help`
|
|
18
|
+
|
|
19
|
+
### Testing and Validation
|
|
20
|
+
- **Run tests**: `uv run pytest` (or `just test`)
|
|
21
|
+
- **Lint**: `uv run ruff check` (or `just lint`)
|
|
22
|
+
- **Both**: `just check`
|
|
23
|
+
|
|
24
|
+
Tests live in `tests/` and run offline: `tests/conftest.py` routes every `httpx.AsyncClient` through a fake GitHub API and isolates `HOME` and the working directory, so the real config, stored tokens and `./exports` are never touched. Add a test alongside any behaviour change. CI (`.github/workflows/ci.yml`) runs lint and tests on pushes to `main` and on pull requests.
|
|
25
|
+
|
|
26
|
+
## Architecture Overview
|
|
27
|
+
|
|
28
|
+
This is an async Python CLI tool built with Typer and Rich that exports GitHub issues to individual JSON files. The architecture follows a modular design with clear separation of concerns:
|
|
29
|
+
|
|
30
|
+
### Core Components
|
|
31
|
+
- **CLI Layer** (`cli/main.py`): Typer-based command interface with Rich formatting
|
|
32
|
+
- **Export Engine** (`core/export_engine.py`): Orchestrates the export process across multiple repositories
|
|
33
|
+
- **GitHub Client** (`core/github_client.py`): HTTPX-based async API client with rate limiting
|
|
34
|
+
- **Authentication** (`core/auth.py`): Manages GitHub tokens with encrypted storage
|
|
35
|
+
- **Configuration** (`core/config.py`): Handles settings and credential storage
|
|
36
|
+
- **Transformer** (`core/transformer.py`): Converts GitHub API responses to export format
|
|
37
|
+
- **Filesystem** (`core/filesystem.py`): Manages file operations and directory structure
|
|
38
|
+
|
|
39
|
+
### Key Patterns
|
|
40
|
+
- **Async/Await**: All GitHub API operations use async patterns for concurrent processing
|
|
41
|
+
- **Rich Console**: Consistent use of Rich for progress bars, tables, and formatted output
|
|
42
|
+
- **Repository Batching**: Supports processing multiple repositories concurrently with configurable limits
|
|
43
|
+
- **Incremental Updates**: Only re-exports issues whose `updated_at` is newer than the `updated_date` stored in the exported file
|
|
44
|
+
- **Encrypted Storage**: GitHub tokens are encrypted using the cryptography library
|
|
45
|
+
|
|
46
|
+
### File Organization
|
|
47
|
+
- Issues exported to: `{output_dir}/{owner}/{repo}/{state}/{issue_number}-{slugified-title}.json`
|
|
48
|
+
- Configuration stored at: `~/.config/github-issue-exporter-tool/config.json`
|
|
49
|
+
- State directories: `open/` and `closed/` based on current issue state
|
|
50
|
+
|
|
51
|
+
### Authentication Flow
|
|
52
|
+
1. Check environment variables (`GITHUB_TOKEN` or `GITHUB_TOKEN_{OWNER}_{REPO}`)
|
|
53
|
+
2. Load encrypted tokens from config file
|
|
54
|
+
3. Prompt user for new token if needed
|
|
55
|
+
4. Test that the token can read the repository before proceeding (the `/user` lookup is informational only, because app/Actions tokens cannot call it)
|
|
56
|
+
5. Store new tokens with encryption
|
|
57
|
+
|
|
58
|
+
## Important Implementation Notes
|
|
59
|
+
|
|
60
|
+
- **Rate Limiting**: GitHub API client retries with backoff, honours `Retry-After` and the `X-RateLimit-*` headers, and handles both 403 and 429 rate limit responses
|
|
61
|
+
- **Concurrent Processing**: Default 3 concurrent repositories, configurable up to 10
|
|
62
|
+
- **Error Handling**: Partial failures continue processing other repositories and issues; any failure (including a single issue that could not be saved) is listed in the summary and makes the exit code non-zero
|
|
63
|
+
- **Exit Codes**: `typer.Exit` is an `Exception` subclass; raise it outside any `try/except Exception` block
|
|
64
|
+
- **Security**: Never commit tokens. Stored tokens are encrypted, but the key lives beside the config file, so the real protection is the owner-only permissions on the config directory
|
|
65
|
+
- **File Moves**: When issue state changes, files are moved between `open/` and `closed/` directories. The new file is written before the old one is removed
|
|
66
|
+
- **Incremental Logic**: Compares the issue's `updated_at` with the `updated_date` stored inside the exported file (not the file's mtime). Files written with `--no-comments` record `comments_included: false` and are refreshed by the next run that includes comments
|
|
67
|
+
- **Settings**: Only `default_output_dir` from the config's global settings is honoured; `concurrent_repos`, `api_rate_limit_buffer` and the per-repository settings are stored but not yet read
|
|
68
|
+
|
|
69
|
+
## Dependencies
|
|
70
|
+
- **typer**: CLI framework with automatic help generation
|
|
71
|
+
- **rich**: Terminal formatting, progress bars, and user interaction
|
|
72
|
+
- **httpx**: Async HTTP client for GitHub API calls
|
|
73
|
+
- **cryptography**: Token encryption for secure credential storage
|
|
74
|
+
- **pydantic**: Data validation and configuration management
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# List available recipes
|
|
2
|
+
default:
|
|
3
|
+
@just --list
|
|
4
|
+
|
|
5
|
+
# Install dependencies, including dev tools
|
|
6
|
+
install:
|
|
7
|
+
uv sync
|
|
8
|
+
|
|
9
|
+
# Run the test suite (extra arguments are passed to pytest)
|
|
10
|
+
test *args:
|
|
11
|
+
uv run pytest {{args}}
|
|
12
|
+
|
|
13
|
+
# Lint the code
|
|
14
|
+
lint:
|
|
15
|
+
uv run ruff check
|
|
16
|
+
|
|
17
|
+
# Apply automatic lint fixes
|
|
18
|
+
fix:
|
|
19
|
+
uv run ruff check --fix
|
|
20
|
+
|
|
21
|
+
# Lint and test
|
|
22
|
+
check: lint test
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: github-issue-exporter
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Export GitHub issues to individual JSON files with incremental updates and credential management
|
|
5
5
|
Project-URL: Homepage, https://github.com/Beep-Boop-Digital/github-issue-exporter
|
|
6
6
|
Project-URL: Repository, https://github.com/Beep-Boop-Digital/github-issue-exporter
|
|
@@ -22,11 +22,11 @@ Authored by Claude Code.
|
|
|
22
22
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
25
|
-
- **Incremental Updates**: Only exports issues that have
|
|
25
|
+
- **Incremental Updates**: Only re-exports issues that have changed since they were last exported
|
|
26
26
|
- **Multiple Repositories**: Process multiple repositories concurrently
|
|
27
|
-
- **
|
|
27
|
+
- **Credential Storage**: GitHub tokens are stored encrypted, per repository
|
|
28
28
|
- **Rich Progress Display**: Beautiful progress bars and status updates
|
|
29
|
-
- **
|
|
29
|
+
- **Configuration**: Configurable default output directory
|
|
30
30
|
- **Comprehensive Export**: Includes issue metadata, comments, labels, and assignees
|
|
31
31
|
|
|
32
32
|
## Installation
|
|
@@ -43,21 +43,26 @@ uv pip install -e .
|
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
# Export issues from a single repository
|
|
46
|
-
github-issue-exporter owner/repo
|
|
46
|
+
github-issue-exporter export owner/repo
|
|
47
47
|
|
|
48
48
|
# Export from multiple repositories
|
|
49
|
-
github-issue-exporter owner/repo1,owner/repo2,owner/repo3
|
|
49
|
+
github-issue-exporter export owner/repo1,owner/repo2,owner/repo3
|
|
50
|
+
|
|
51
|
+
# Export the repositories listed in a file (one owner/repo per line, # for comments)
|
|
52
|
+
github-issue-exporter export repos.txt
|
|
50
53
|
|
|
51
54
|
# Custom output directory
|
|
52
|
-
github-issue-exporter owner/repo --output /path/to/exports
|
|
55
|
+
github-issue-exporter export owner/repo --output /path/to/exports
|
|
53
56
|
|
|
54
57
|
# Force re-export (ignore timestamps)
|
|
55
|
-
github-issue-exporter owner/repo --force
|
|
58
|
+
github-issue-exporter export owner/repo --force
|
|
56
59
|
|
|
57
60
|
# Export only open issues
|
|
58
|
-
github-issue-exporter owner/repo --state open
|
|
61
|
+
github-issue-exporter export owner/repo --state open
|
|
59
62
|
```
|
|
60
63
|
|
|
64
|
+
The command exits with status 0 only if every repository and every issue was exported.
|
|
65
|
+
|
|
61
66
|
## Authentication
|
|
62
67
|
|
|
63
68
|
The tool supports multiple authentication methods:
|
|
@@ -73,6 +78,8 @@ export GITHUB_TOKEN_OWNER_REPO="your_token_here"
|
|
|
73
78
|
# Example: GITHUB_TOKEN_BEEP_BOOP_DIGITAL_GITHUB_ISSUE_EXPORTER="token"
|
|
74
79
|
```
|
|
75
80
|
|
|
81
|
+
A token is accepted if it can read the repository. When exporting more than 5 repositories unattended, pass `--yes` to skip the confirmation prompt.
|
|
82
|
+
|
|
76
83
|
### Interactive Prompt
|
|
77
84
|
|
|
78
85
|
If no environment variables are set, the tool will automatically prompt for a GitHub Personal Access Token. You can create one at: https://github.com/settings/tokens
|
|
@@ -84,7 +91,9 @@ If no environment variables are set, the tool will automatically prompt for a Gi
|
|
|
84
91
|
|
|
85
92
|
### Token Storage
|
|
86
93
|
|
|
87
|
-
Interactively provided tokens
|
|
94
|
+
Interactively provided tokens can be stored per-repository. Environment variable tokens are not stored.
|
|
95
|
+
|
|
96
|
+
Stored tokens are encrypted, but the encryption key is kept next to the config file in `~/.config/github-issue-exporter-tool/`, so the protection comes from that directory's owner-only permissions. Treat the directory like any other credential store.
|
|
88
97
|
|
|
89
98
|
## Configuration
|
|
90
99
|
|
|
@@ -136,11 +145,18 @@ Issues are exported as individual JSON files with the following structure:
|
|
|
136
145
|
],
|
|
137
146
|
"export_metadata": {
|
|
138
147
|
"exported_at": "iso_string",
|
|
139
|
-
"tool_version": "string"
|
|
148
|
+
"tool_version": "string",
|
|
149
|
+
"comments_included": "boolean"
|
|
140
150
|
}
|
|
141
151
|
}
|
|
142
152
|
```
|
|
143
153
|
|
|
154
|
+
`comments_included` is `false` for files written with `--no-comments`. A later run without that flag fetches the missing comments.
|
|
155
|
+
|
|
156
|
+
## Incremental Updates
|
|
157
|
+
|
|
158
|
+
Every run lists the repository's issues and compares each issue's `updated_at` on GitHub with the `updated_date` stored in its exported file. Only issues that are new or have changed are fetched in full and rewritten. Use `--force` to rewrite everything.
|
|
159
|
+
|
|
144
160
|
## File Organization
|
|
145
161
|
|
|
146
162
|
Files are organized by repository and issue state:
|
|
@@ -168,7 +184,7 @@ exports/
|
|
|
168
184
|
**Key Features:**
|
|
169
185
|
- Issues are organized into `open` and `closed` subdirectories based on their current state
|
|
170
186
|
- Filenames use the issue number (not internal ID) for easier identification
|
|
171
|
-
- When an issue state changes, the file is automatically moved to the appropriate directory
|
|
187
|
+
- When an issue state changes, the file is automatically moved to the appropriate directory. This also applies to `--state open` and `--state closed` runs: issues that have left the requested state are looked up individually and moved
|
|
172
188
|
|
|
173
189
|
## Commands
|
|
174
190
|
|
|
@@ -180,11 +196,12 @@ github-issue-exporter export [OPTIONS] REPOSITORIES
|
|
|
180
196
|
```
|
|
181
197
|
|
|
182
198
|
Options:
|
|
183
|
-
- `--output, -o`: Output directory (default: ./exports)
|
|
199
|
+
- `--output, -o`: Output directory (default: the directory set with `config --set-output`, initially ./exports)
|
|
184
200
|
- `--force, -f`: Force re-export, ignoring timestamps
|
|
185
201
|
- `--state, -s`: Issue state (open, closed, all)
|
|
186
202
|
- `--no-comments`: Skip exporting comments
|
|
187
203
|
- `--concurrent, -c`: Max concurrent repositories (1-10)
|
|
204
|
+
- `--yes, -y`: Skip the confirmation prompt shown for more than 5 repositories
|
|
188
205
|
|
|
189
206
|
### cleanup
|
|
190
207
|
Remove files for issues that no longer exist.
|
|
@@ -193,6 +210,10 @@ Remove files for issues that no longer exist.
|
|
|
193
210
|
github-issue-exporter cleanup [OPTIONS] REPOSITORY
|
|
194
211
|
```
|
|
195
212
|
|
|
213
|
+
Options:
|
|
214
|
+
- `--output, -o`: Output directory where the files are stored
|
|
215
|
+
- `--dry-run`: List the files that would be removed without deleting them
|
|
216
|
+
|
|
196
217
|
### config
|
|
197
218
|
Manage configuration and credentials.
|
|
198
219
|
|
|
@@ -207,6 +228,16 @@ Show version information.
|
|
|
207
228
|
github-issue-exporter --version
|
|
208
229
|
```
|
|
209
230
|
|
|
231
|
+
## Development
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
uv sync # install dependencies, including pytest and ruff
|
|
235
|
+
uv run pytest # run the tests (offline, against a fake GitHub API)
|
|
236
|
+
uv run ruff check # lint
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
With [just](https://github.com/casey/just) installed, `just check` runs both.
|
|
240
|
+
|
|
210
241
|
## Requirements
|
|
211
242
|
|
|
212
243
|
- Python 3.11+
|
|
@@ -6,11 +6,11 @@ Authored by Claude Code.
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- **Incremental Updates**: Only exports issues that have
|
|
9
|
+
- **Incremental Updates**: Only re-exports issues that have changed since they were last exported
|
|
10
10
|
- **Multiple Repositories**: Process multiple repositories concurrently
|
|
11
|
-
- **
|
|
11
|
+
- **Credential Storage**: GitHub tokens are stored encrypted, per repository
|
|
12
12
|
- **Rich Progress Display**: Beautiful progress bars and status updates
|
|
13
|
-
- **
|
|
13
|
+
- **Configuration**: Configurable default output directory
|
|
14
14
|
- **Comprehensive Export**: Includes issue metadata, comments, labels, and assignees
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
@@ -27,21 +27,26 @@ uv pip install -e .
|
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
# Export issues from a single repository
|
|
30
|
-
github-issue-exporter owner/repo
|
|
30
|
+
github-issue-exporter export owner/repo
|
|
31
31
|
|
|
32
32
|
# Export from multiple repositories
|
|
33
|
-
github-issue-exporter owner/repo1,owner/repo2,owner/repo3
|
|
33
|
+
github-issue-exporter export owner/repo1,owner/repo2,owner/repo3
|
|
34
|
+
|
|
35
|
+
# Export the repositories listed in a file (one owner/repo per line, # for comments)
|
|
36
|
+
github-issue-exporter export repos.txt
|
|
34
37
|
|
|
35
38
|
# Custom output directory
|
|
36
|
-
github-issue-exporter owner/repo --output /path/to/exports
|
|
39
|
+
github-issue-exporter export owner/repo --output /path/to/exports
|
|
37
40
|
|
|
38
41
|
# Force re-export (ignore timestamps)
|
|
39
|
-
github-issue-exporter owner/repo --force
|
|
42
|
+
github-issue-exporter export owner/repo --force
|
|
40
43
|
|
|
41
44
|
# Export only open issues
|
|
42
|
-
github-issue-exporter owner/repo --state open
|
|
45
|
+
github-issue-exporter export owner/repo --state open
|
|
43
46
|
```
|
|
44
47
|
|
|
48
|
+
The command exits with status 0 only if every repository and every issue was exported.
|
|
49
|
+
|
|
45
50
|
## Authentication
|
|
46
51
|
|
|
47
52
|
The tool supports multiple authentication methods:
|
|
@@ -57,6 +62,8 @@ export GITHUB_TOKEN_OWNER_REPO="your_token_here"
|
|
|
57
62
|
# Example: GITHUB_TOKEN_BEEP_BOOP_DIGITAL_GITHUB_ISSUE_EXPORTER="token"
|
|
58
63
|
```
|
|
59
64
|
|
|
65
|
+
A token is accepted if it can read the repository. When exporting more than 5 repositories unattended, pass `--yes` to skip the confirmation prompt.
|
|
66
|
+
|
|
60
67
|
### Interactive Prompt
|
|
61
68
|
|
|
62
69
|
If no environment variables are set, the tool will automatically prompt for a GitHub Personal Access Token. You can create one at: https://github.com/settings/tokens
|
|
@@ -68,7 +75,9 @@ If no environment variables are set, the tool will automatically prompt for a Gi
|
|
|
68
75
|
|
|
69
76
|
### Token Storage
|
|
70
77
|
|
|
71
|
-
Interactively provided tokens
|
|
78
|
+
Interactively provided tokens can be stored per-repository. Environment variable tokens are not stored.
|
|
79
|
+
|
|
80
|
+
Stored tokens are encrypted, but the encryption key is kept next to the config file in `~/.config/github-issue-exporter-tool/`, so the protection comes from that directory's owner-only permissions. Treat the directory like any other credential store.
|
|
72
81
|
|
|
73
82
|
## Configuration
|
|
74
83
|
|
|
@@ -120,11 +129,18 @@ Issues are exported as individual JSON files with the following structure:
|
|
|
120
129
|
],
|
|
121
130
|
"export_metadata": {
|
|
122
131
|
"exported_at": "iso_string",
|
|
123
|
-
"tool_version": "string"
|
|
132
|
+
"tool_version": "string",
|
|
133
|
+
"comments_included": "boolean"
|
|
124
134
|
}
|
|
125
135
|
}
|
|
126
136
|
```
|
|
127
137
|
|
|
138
|
+
`comments_included` is `false` for files written with `--no-comments`. A later run without that flag fetches the missing comments.
|
|
139
|
+
|
|
140
|
+
## Incremental Updates
|
|
141
|
+
|
|
142
|
+
Every run lists the repository's issues and compares each issue's `updated_at` on GitHub with the `updated_date` stored in its exported file. Only issues that are new or have changed are fetched in full and rewritten. Use `--force` to rewrite everything.
|
|
143
|
+
|
|
128
144
|
## File Organization
|
|
129
145
|
|
|
130
146
|
Files are organized by repository and issue state:
|
|
@@ -152,7 +168,7 @@ exports/
|
|
|
152
168
|
**Key Features:**
|
|
153
169
|
- Issues are organized into `open` and `closed` subdirectories based on their current state
|
|
154
170
|
- Filenames use the issue number (not internal ID) for easier identification
|
|
155
|
-
- When an issue state changes, the file is automatically moved to the appropriate directory
|
|
171
|
+
- When an issue state changes, the file is automatically moved to the appropriate directory. This also applies to `--state open` and `--state closed` runs: issues that have left the requested state are looked up individually and moved
|
|
156
172
|
|
|
157
173
|
## Commands
|
|
158
174
|
|
|
@@ -164,11 +180,12 @@ github-issue-exporter export [OPTIONS] REPOSITORIES
|
|
|
164
180
|
```
|
|
165
181
|
|
|
166
182
|
Options:
|
|
167
|
-
- `--output, -o`: Output directory (default: ./exports)
|
|
183
|
+
- `--output, -o`: Output directory (default: the directory set with `config --set-output`, initially ./exports)
|
|
168
184
|
- `--force, -f`: Force re-export, ignoring timestamps
|
|
169
185
|
- `--state, -s`: Issue state (open, closed, all)
|
|
170
186
|
- `--no-comments`: Skip exporting comments
|
|
171
187
|
- `--concurrent, -c`: Max concurrent repositories (1-10)
|
|
188
|
+
- `--yes, -y`: Skip the confirmation prompt shown for more than 5 repositories
|
|
172
189
|
|
|
173
190
|
### cleanup
|
|
174
191
|
Remove files for issues that no longer exist.
|
|
@@ -177,6 +194,10 @@ Remove files for issues that no longer exist.
|
|
|
177
194
|
github-issue-exporter cleanup [OPTIONS] REPOSITORY
|
|
178
195
|
```
|
|
179
196
|
|
|
197
|
+
Options:
|
|
198
|
+
- `--output, -o`: Output directory where the files are stored
|
|
199
|
+
- `--dry-run`: List the files that would be removed without deleting them
|
|
200
|
+
|
|
180
201
|
### config
|
|
181
202
|
Manage configuration and credentials.
|
|
182
203
|
|
|
@@ -191,6 +212,16 @@ Show version information.
|
|
|
191
212
|
github-issue-exporter --version
|
|
192
213
|
```
|
|
193
214
|
|
|
215
|
+
## Development
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
uv sync # install dependencies, including pytest and ruff
|
|
219
|
+
uv run pytest # run the tests (offline, against a fake GitHub API)
|
|
220
|
+
uv run ruff check # lint
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
With [just](https://github.com/casey/just) installed, `just check` runs both.
|
|
224
|
+
|
|
194
225
|
## Requirements
|
|
195
226
|
|
|
196
227
|
- Python 3.11+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "github-issue-exporter"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Export GitHub issues to individual JSON files with incremental updates and credential management"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -16,6 +16,12 @@ authors = [
|
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
[dependency-groups]
|
|
20
|
+
dev = [
|
|
21
|
+
"pytest>=8.0",
|
|
22
|
+
"ruff>=0.8",
|
|
23
|
+
]
|
|
24
|
+
|
|
19
25
|
[project.scripts]
|
|
20
26
|
github-issue-exporter = "github_issue_exporter.cli.main:app"
|
|
21
27
|
|
|
@@ -30,3 +36,13 @@ build-backend = "hatchling.build"
|
|
|
30
36
|
|
|
31
37
|
[tool.hatch.build.targets.wheel]
|
|
32
38
|
packages = ["src/github_issue_exporter"]
|
|
39
|
+
|
|
40
|
+
[tool.pytest.ini_options]
|
|
41
|
+
testpaths = ["tests"]
|
|
42
|
+
|
|
43
|
+
[tool.ruff]
|
|
44
|
+
target-version = "py311"
|
|
45
|
+
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
# Pinned explicitly so results don't shift when ruff changes its defaults.
|
|
48
|
+
select = ["E4", "E7", "E9", "F"]
|
{github_issue_exporter-0.1.0 → github_issue_exporter-0.2.0}/src/github_issue_exporter/__init__.py
RENAMED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"""GitHub Issue Exporter Tool
|
|
2
2
|
|
|
3
|
-
A command-line tool that exports GitHub issues to individual JSON files,
|
|
4
|
-
with incremental updates and credential management. Supports multiple
|
|
3
|
+
A command-line tool that exports GitHub issues to individual JSON files,
|
|
4
|
+
with incremental updates and credential management. Supports multiple
|
|
5
5
|
repositories with per-repo configuration.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
from importlib.metadata import version
|
|
10
|
-
except ImportError:
|
|
11
|
-
# Python < 3.8 fallback
|
|
12
|
-
from importlib_metadata import version
|
|
8
|
+
from importlib.metadata import version
|
|
13
9
|
|
|
14
10
|
try:
|
|
15
11
|
__version__ = version("github-issue-exporter")
|
|
16
12
|
except Exception:
|
|
17
13
|
# Fallback for development/editable installs where metadata might not be available
|
|
18
|
-
__version__ = "dev"
|
|
14
|
+
__version__ = "dev"
|