Skip to content

Commit 57c4884

Browse files
committed
Adding src/neptune_api_codegen/README.md
1 parent debc797 commit 57c4884

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

src/neptune_api_codegen/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# neptune_api_codegen
2+
3+
Utility for generating Neptune API bindings and local API spec used by `neptune_query`.
4+
It orchestrates Dockerized generators to:
5+
6+
- copy OpenAPI (swagger) and Protobuf sources from the private Neptune backend repository
7+
- build a unified OpenAPI document
8+
- generate Python client code from OpenAPI
9+
- generate Python modules from `.proto` definitions
10+
- place artifacts under `src/neptune_query/generated/`
11+
12+
See also: `src/neptune_query/generated/README.md` for a map of generated outputs.
13+
14+
## Prerequisites
15+
- Docker installed and running (required to build images and run generators)
16+
- Git installed (used to embed the backend commit reference)
17+
- Access to the Neptune backend repository (cloned locally)
18+
19+
## Quick start
20+
From the `neptune-query` repository root:
21+
22+
```
23+
poetry run python -m neptune_api_codegen.cli
24+
```
25+
26+
By default this performs a dry-run:
27+
- copies swagger/proto inputs from the backend repo into a temporary work dir
28+
- generates OpenAPI, Python client code, and Python protobuf modules there
29+
- removes the temporary dir afterwards
30+
31+
To apply the change to `src/neptune_query/generated/`, run with `--update`:
32+
33+
```
34+
poetry run python -m neptune_api_codegen.cli --update
35+
```
36+
37+
To keep the temporary directory for inspection:
38+
39+
```
40+
poetry run python -m neptune_api_codegen.cli --keep-tmpdir
41+
```
42+
43+
## Temporary working directory
44+
A unique working directory is created under `./tmp/` per run, for example:
45+
46+
```
47+
./tmp/neptune-api__20260114_141229_2195/
48+
├── api_spec/ # swagger + proto copied from backend + GIT_REF
49+
└── generated_python/ # openapi client + protobuf python generated here
50+
```
51+
52+
If `--keep-tmpdir` is not used, the work directory is removed.
53+
54+
## Backend repository detection
55+
If `--neptune-repo-path` is not provided, the tool attempts to auto-detect the Neptune backend repository
56+
on your local filesystem next to this project (../neptune).

src/neptune_query/generated/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ src/
1616

1717
To regenerate these files, run the following from neptune-query repo root:
1818

19-
cd src && python3 -m neptune_api_codegen.cli
19+
poetry run python -m neptune_api_codegen.cli

0 commit comments

Comments
 (0)