bdsc-cli 0.2.1__py3-none-any.whl
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.
- bdsc_cli/__init__.py +3 -0
- bdsc_cli/cli.py +612 -0
- bdsc_cli/core.py +2661 -0
- bdsc_cli-0.2.1.dist-info/METADATA +362 -0
- bdsc_cli-0.2.1.dist-info/RECORD +9 -0
- bdsc_cli-0.2.1.dist-info/WHEEL +5 -0
- bdsc_cli-0.2.1.dist-info/entry_points.txt +2 -0
- bdsc_cli-0.2.1.dist-info/licenses/LICENSE +21 -0
- bdsc_cli-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bdsc-cli
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Sync and query BDSC datasets locally
|
|
5
|
+
Author: Gustavo Madeira Santana
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/gumadeiras/bdsc-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/gumadeiras/bdsc-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/gumadeiras/bdsc-cli/issues
|
|
10
|
+
Keywords: bdsc,drosophila,cli,bioinformatics,genetics
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Provides-Extra: release
|
|
18
|
+
Requires-Dist: build>=1.2.2; extra == "release"
|
|
19
|
+
Requires-Dist: twine>=6.1.0; extra == "release"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# bdsc-cli
|
|
23
|
+
|
|
24
|
+
Small CLI for syncing public Bloomington Drosophila Stock Center datasets and
|
|
25
|
+
querying them locally.
|
|
26
|
+
|
|
27
|
+
Repo:
|
|
28
|
+
|
|
29
|
+
- https://github.com/gumadeiras/bdsc-cli
|
|
30
|
+
|
|
31
|
+
Primary source:
|
|
32
|
+
|
|
33
|
+
- https://bdsc.indiana.edu/stocks/stockdata.html
|
|
34
|
+
|
|
35
|
+
What it does:
|
|
36
|
+
|
|
37
|
+
- syncs BDSC CSV datasets into a local cache
|
|
38
|
+
- builds a local SQLite index
|
|
39
|
+
- supports local text search and stock lookups
|
|
40
|
+
- exposes optional live search against BDSC's current web endpoint
|
|
41
|
+
|
|
42
|
+
No third-party Python dependencies.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
Another computer:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
brew tap gumadeiras/tap
|
|
50
|
+
brew install bdsc-cli
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or install the release wheel directly with `pipx`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pipx install 'bdsc-cli @ https://github.com/gumadeiras/bdsc-cli/releases/download/v0.2.1/bdsc_cli-0.2.1-py3-none-any.whl'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or with plain `pip`:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
python3 -m pip install 'bdsc-cli @ https://github.com/gumadeiras/bdsc-cli/releases/download/v0.2.1/bdsc_cli-0.2.1-py3-none-any.whl'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Source install:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/gumadeiras/bdsc-cli.git
|
|
69
|
+
cd bdsc-cli
|
|
70
|
+
python3 -m pip install .
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Repo-local dev install:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cd ~/git/bdsc-cli
|
|
77
|
+
python3 -m venv .venv
|
|
78
|
+
. .venv/bin/activate
|
|
79
|
+
python -m pip install -e .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Check the CLI:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
bdsc --help
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Build release artifacts locally:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
python -m pip install -e .[release]
|
|
92
|
+
python -m build
|
|
93
|
+
python -m twine check dist/*
|
|
94
|
+
python scripts/render_homebrew_formula.py dist/bdsc_cli-$(python - <<'PY'
|
|
95
|
+
from bdsc_cli import __version__
|
|
96
|
+
print(__version__)
|
|
97
|
+
PY
|
|
98
|
+
).tar.gz
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
PyPI note:
|
|
102
|
+
|
|
103
|
+
- the GitHub release is live
|
|
104
|
+
- PyPI trusted publishing is not configured yet for `bdsc-cli`
|
|
105
|
+
- `pip install bdsc-cli` will work after that publisher is added
|
|
106
|
+
|
|
107
|
+
## Quickstart
|
|
108
|
+
|
|
109
|
+
Create a local cache and index:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
bdsc sync
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Then query it:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
bdsc find Chronos
|
|
119
|
+
bdsc find 'Or56a Lexa'
|
|
120
|
+
bdsc report optogenetics
|
|
121
|
+
bdsc find --gene Or56a --property lexA
|
|
122
|
+
bdsc find --gene Or42b --driver-family lexA
|
|
123
|
+
bdsc find RRID:BDSC_77118
|
|
124
|
+
bdsc find FBti0195688
|
|
125
|
+
bdsc stock 77118
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Usage
|
|
129
|
+
|
|
130
|
+
Default state directory:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
~/.local/share/bdsc-cli
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Sync datasets and build the local index:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
bdsc sync
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use `find` for nearly all interactive querying:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
bdsc find Chronos
|
|
146
|
+
bdsc find Chronis
|
|
147
|
+
bdsc find 'Or56a Lexa'
|
|
148
|
+
bdsc find FBgn0003996 --json
|
|
149
|
+
bdsc find RRID:BDSC_77118
|
|
150
|
+
bdsc find FBti0195688
|
|
151
|
+
bdsc find --kind property VALIUM20
|
|
152
|
+
bdsc find --kind property-exact lexA
|
|
153
|
+
bdsc find --kind driver-family QF
|
|
154
|
+
bdsc find --kind relationship RNAi
|
|
155
|
+
bdsc find --gene Or56a --property lexA
|
|
156
|
+
bdsc find --gene Or42b --driver-family lexA
|
|
157
|
+
bdsc find --gene Or42b --driver-family qf
|
|
158
|
+
bdsc find --dataset genes --property olfactory --relationship coding --jsonl
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Use canned reports for common retrieval buckets:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
bdsc report olfactory
|
|
165
|
+
bdsc report drivers --jsonl
|
|
166
|
+
bdsc report optogenetics --limit 50
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Inspect cache/index status:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
bdsc status
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Use a custom cache/index location:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
bdsc sync --state-dir ./data
|
|
179
|
+
bdsc find Chronos --state-dir ./data
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Structured output for scripts or agents:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
bdsc status --json
|
|
186
|
+
bdsc find Chronos --json
|
|
187
|
+
bdsc find FBgn0003996 --dataset genes --json
|
|
188
|
+
bdsc find --gene Or56a --property lexA --json
|
|
189
|
+
bdsc export components --limit 5 --format jsonl
|
|
190
|
+
bdsc stock 77118 --json
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Commands
|
|
194
|
+
|
|
195
|
+
- `bdsc sync`: download the BDSC CSV datasets; builds the index by default
|
|
196
|
+
- `bdsc build-index`: rebuild the SQLite index from previously downloaded CSVs
|
|
197
|
+
- `bdsc status`: show local dataset freshness and index metadata
|
|
198
|
+
- `bdsc find [query]`: primary query command; free-text lookup or compound filters
|
|
199
|
+
- `bdsc report <name>`: canned reports for `olfactory`, `drivers`, `optogenetics`
|
|
200
|
+
- `bdsc export <dataset>`: stream normalized rows as `jsonl`, `csv`, or `tsv`
|
|
201
|
+
- `bdsc terms <scope>`: inspect available property/relationship vocab
|
|
202
|
+
- `bdsc stock <stknum>`: local stock details
|
|
203
|
+
- legacy compatibility shims still exist for `search`, `gene`, `component`, `fbid`, `rrid`, `property`, `property-exact`, `driver-family`, `relationship`, `lookup`, `filter`, `live-search`
|
|
204
|
+
|
|
205
|
+
## Find
|
|
206
|
+
|
|
207
|
+
Use `find` when the caller does not want to choose a dedicated query command up
|
|
208
|
+
front.
|
|
209
|
+
|
|
210
|
+
Auto-detect rules:
|
|
211
|
+
|
|
212
|
+
- digits -> `stock`
|
|
213
|
+
- `RRID:BDSC_*` or `BDSC_*` -> `rrid`
|
|
214
|
+
- `FBgn...` -> `gene`
|
|
215
|
+
- `FBti...` / `FBal...` / similar `FB..` ids in the component table -> `fbid`
|
|
216
|
+
- transgene/component-like text (`P{...}`, brackets, `attP`, `CyO`) -> `component`
|
|
217
|
+
- multi-term or dotted construct fragments -> local full-text `search`
|
|
218
|
+
- `--kind property` when you want property-driven lookup explicitly
|
|
219
|
+
- single bare terms -> `gene`, then local full-text `search` fallback if no gene hits
|
|
220
|
+
|
|
221
|
+
Examples:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
bdsc find Chronos
|
|
225
|
+
bdsc find RRID:BDSC_77118
|
|
226
|
+
bdsc find --kind component 'P{10XUAS-Chronos'
|
|
227
|
+
bdsc find --kind property VALIUM20
|
|
228
|
+
bdsc find --kind property-exact lexA
|
|
229
|
+
bdsc find --kind driver-family qf
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Export
|
|
233
|
+
|
|
234
|
+
Use `export` when another tool wants direct normalized rows instead of
|
|
235
|
+
search-oriented output.
|
|
236
|
+
|
|
237
|
+
Datasets:
|
|
238
|
+
|
|
239
|
+
- `stocks`
|
|
240
|
+
- `components`
|
|
241
|
+
- `genes`
|
|
242
|
+
- `properties`
|
|
243
|
+
|
|
244
|
+
Examples:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
bdsc export stocks --limit 3
|
|
248
|
+
bdsc export genes --query Chronos --kind gene
|
|
249
|
+
bdsc export components --query FBti0195688 --kind fbid --format jsonl
|
|
250
|
+
bdsc export properties --query VALIUM20 --kind property --format tsv
|
|
251
|
+
bdsc export components --gene Or56a --property lexA --format jsonl
|
|
252
|
+
bdsc export components --gene Or42b --driver-family qf --format jsonl
|
|
253
|
+
bdsc export genes --property olfactory --relationship coding --format csv
|
|
254
|
+
bdsc export components --format tsv --output components.tsv
|
|
255
|
+
bdsc export genes --format csv --output genes.csv
|
|
256
|
+
bdsc export properties --limit 20 --format jsonl
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
`export --query` uses the same lookup kinds as `find --kind`:
|
|
260
|
+
|
|
261
|
+
- `stock`
|
|
262
|
+
- `rrid`
|
|
263
|
+
- `gene`
|
|
264
|
+
- `fbid`
|
|
265
|
+
- `component`
|
|
266
|
+
- `property`
|
|
267
|
+
- `property-exact`
|
|
268
|
+
- `driver-family`
|
|
269
|
+
- `relationship`
|
|
270
|
+
- `search`
|
|
271
|
+
- `auto`
|
|
272
|
+
|
|
273
|
+
You can also stack explicit filter flags on `export`; multiple flags combine as
|
|
274
|
+
AND:
|
|
275
|
+
|
|
276
|
+
- `--stock`
|
|
277
|
+
- `--rrid`
|
|
278
|
+
- `--gene`
|
|
279
|
+
- `--component`
|
|
280
|
+
- `--fbid`
|
|
281
|
+
- `--property`
|
|
282
|
+
- `--property-exact`
|
|
283
|
+
- `--driver-family`
|
|
284
|
+
- `--relationship`
|
|
285
|
+
- `--search`
|
|
286
|
+
|
|
287
|
+
## Compound Find
|
|
288
|
+
|
|
289
|
+
`find` also subsumes compound filters. Default dataset: `components`.
|
|
290
|
+
|
|
291
|
+
Examples:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
bdsc find --gene Or56a --property lexA
|
|
295
|
+
bdsc find --gene Or67d --property qf
|
|
296
|
+
bdsc find --gene Or42b --driver-family lexA
|
|
297
|
+
bdsc find --gene Or56a --property-exact lexA
|
|
298
|
+
bdsc find --dataset stocks --property optogenetic
|
|
299
|
+
bdsc find --dataset genes --property olfactory --relationship coding --jsonl
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Reports
|
|
303
|
+
|
|
304
|
+
Use `report` for curated high-level buckets that would otherwise need multiple
|
|
305
|
+
queries or OR filters.
|
|
306
|
+
|
|
307
|
+
Reports:
|
|
308
|
+
|
|
309
|
+
- `olfactory`: receptor-family genes (`Or*`, `Orco`, `Ir*`, `Obp*`)
|
|
310
|
+
- `drivers`: GAL4 / lexA / QF / split-driver / FLP-like driver surfaces
|
|
311
|
+
- `optogenetics`: common optogenetic effectors plus optogenetic-tagged properties
|
|
312
|
+
|
|
313
|
+
Examples:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
bdsc report olfactory
|
|
317
|
+
bdsc report olfactory --dataset genes --jsonl
|
|
318
|
+
bdsc report drivers --limit 50 --json
|
|
319
|
+
bdsc report optogenetics --dataset components --jsonl
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
## Terms
|
|
323
|
+
|
|
324
|
+
Use `terms` when you need to discover the vocabulary before filtering.
|
|
325
|
+
|
|
326
|
+
Scopes:
|
|
327
|
+
|
|
328
|
+
- `properties`
|
|
329
|
+
- `property-descriptions`
|
|
330
|
+
- `relationships`
|
|
331
|
+
|
|
332
|
+
Examples:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
bdsc terms properties --limit 20
|
|
336
|
+
bdsc terms properties --query VALIUM --json
|
|
337
|
+
bdsc terms relationships --limit 20
|
|
338
|
+
bdsc terms property-descriptions --query optogenetic --jsonl
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Notes
|
|
342
|
+
|
|
343
|
+
- `sync` uses conditional HTTP headers when possible (`ETag`,
|
|
344
|
+
`If-Modified-Since`) to avoid re-downloading unchanged files.
|
|
345
|
+
- Local lookup is built from the public CSV dumps, not the private site search
|
|
346
|
+
endpoints.
|
|
347
|
+
- `search` now uses a two-stage index: exact/prefix FTS first, trigram fuzzy
|
|
348
|
+
fallback second. Typos and loose spacing/punctuation usually still find the
|
|
349
|
+
intended stock without having the exact BDSC string.
|
|
350
|
+
- `find` is the intended interactive entrypoint; dedicated legacy query
|
|
351
|
+
commands still work but are no longer the main documented path.
|
|
352
|
+
- direct lookup paths also rerank fuzzy candidates when exact/prefix matching
|
|
353
|
+
misses.
|
|
354
|
+
- use `property-exact` or `driver-family` when `property` is too broad for a
|
|
355
|
+
reliable LexA/QF/GAL4-style answer.
|
|
356
|
+
- tag pushes like `vX.Y.Z` run the release workflow: build artifacts, create a
|
|
357
|
+
GitHub release, and publish to PyPI.
|
|
358
|
+
- `scripts/render_homebrew_formula.py` renders a Homebrew formula from a built
|
|
359
|
+
sdist; use it when updating a tap after a release.
|
|
360
|
+
- The live endpoint is undocumented and may change without notice.
|
|
361
|
+
- BDSC data is large enough that the first full sync/index can take a few
|
|
362
|
+
minutes depending on network and disk speed.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
bdsc_cli/__init__.py,sha256=-IJEEnNHUdbMBDUoc3EcGfKPUhQOkpRnKnqyQm6W3JU,49
|
|
2
|
+
bdsc_cli/cli.py,sha256=88yCfI90caOzQ8co0s9jXmHyNRy9TYnZy7Hx05YVz9g,19350
|
|
3
|
+
bdsc_cli/core.py,sha256=SnVufGFAem6OhRgtoSadSTFhqgPH42IzhypZbyIt-_8,87500
|
|
4
|
+
bdsc_cli-0.2.1.dist-info/licenses/LICENSE,sha256=pOm_AKDa_IHzuMyjTQlSC46C0WZiYTDhQXkmlkSk6cI,1080
|
|
5
|
+
bdsc_cli-0.2.1.dist-info/METADATA,sha256=APHorGNWwzBvB9okPtHIxAxpb7HHzOfY5tOD08t2jMY,9296
|
|
6
|
+
bdsc_cli-0.2.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
7
|
+
bdsc_cli-0.2.1.dist-info/entry_points.txt,sha256=pOMr0MMUcKBxqPpNCgrP8q8F-ffTI1z6caNvBbTyg9A,43
|
|
8
|
+
bdsc_cli-0.2.1.dist-info/top_level.txt,sha256=CKhLY15Afkzfa_SUO4zuxn9roQBA0dWrjTFgcFypd7E,9
|
|
9
|
+
bdsc_cli-0.2.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gustavo Madeira Santana
|
|
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 @@
|
|
|
1
|
+
bdsc_cli
|