bdsc 0.2.4__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.
@@ -0,0 +1,352 @@
1
+ Metadata-Version: 2.4
2
+ Name: bdsc
3
+ Version: 0.2.4
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
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
51
+ ```
52
+
53
+ PyPI with `pipx`:
54
+
55
+ ```bash
56
+ pipx install bdsc
57
+ ```
58
+
59
+ PyPI with plain `pip`:
60
+
61
+ ```bash
62
+ python3 -m pip install bdsc
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
+ ```
95
+
96
+ ## Quickstart
97
+
98
+ Create a local cache and index:
99
+
100
+ ```bash
101
+ bdsc sync
102
+ ```
103
+
104
+ Then query it:
105
+
106
+ ```bash
107
+ bdsc find Chronos
108
+ bdsc find 'Or56a Lexa'
109
+ bdsc report optogenetics
110
+ bdsc find --gene Or56a --property lexA
111
+ bdsc find --gene Or42b --driver-family lexA
112
+ bdsc find RRID:BDSC_77118
113
+ bdsc find FBti0195688
114
+ bdsc stock 77118
115
+ ```
116
+
117
+ ## Usage
118
+
119
+ Default state directory:
120
+
121
+ ```text
122
+ ~/.local/share/bdsc-cli
123
+ ```
124
+
125
+ Sync datasets and build the local index:
126
+
127
+ ```bash
128
+ bdsc sync
129
+ ```
130
+
131
+ Use `find` for nearly all interactive querying:
132
+
133
+ ```bash
134
+ bdsc find Chronos
135
+ bdsc find Chronis
136
+ bdsc find 'Or56a Lexa'
137
+ bdsc find FBgn0003996 --json
138
+ bdsc find RRID:BDSC_77118
139
+ bdsc find FBti0195688
140
+ bdsc find --kind property VALIUM20
141
+ bdsc find --kind property-exact lexA
142
+ bdsc find --kind driver-family QF
143
+ bdsc find --kind relationship RNAi
144
+ bdsc find --gene Or56a --property lexA
145
+ bdsc find --gene Or42b --driver-family lexA
146
+ bdsc find --gene Or42b --driver-family qf
147
+ bdsc find --dataset genes --property olfactory --relationship coding --jsonl
148
+ ```
149
+
150
+ Use canned reports for common retrieval buckets:
151
+
152
+ ```bash
153
+ bdsc report olfactory
154
+ bdsc report drivers --jsonl
155
+ bdsc report optogenetics --limit 50
156
+ ```
157
+
158
+ Inspect cache/index status:
159
+
160
+ ```bash
161
+ bdsc status
162
+ ```
163
+
164
+ Use a custom cache/index location:
165
+
166
+ ```bash
167
+ bdsc sync --state-dir ./data
168
+ bdsc find Chronos --state-dir ./data
169
+ ```
170
+
171
+ Structured output for scripts or agents:
172
+
173
+ ```bash
174
+ bdsc status --json
175
+ bdsc find Chronos --json
176
+ bdsc find FBgn0003996 --dataset genes --json
177
+ bdsc find --gene Or56a --property lexA --json
178
+ bdsc export components --limit 5 --format jsonl
179
+ bdsc stock 77118 --json
180
+ ```
181
+
182
+ Query commands return all matches by default. Use `--limit N` when you want a
183
+ bounded result set.
184
+
185
+ ## Commands
186
+
187
+ - `bdsc sync`: download the BDSC CSV datasets; builds the index by default
188
+ - `bdsc build-index`: rebuild the SQLite index from previously downloaded CSVs
189
+ - `bdsc status`: show local dataset freshness and index metadata
190
+ - `bdsc find [query]`: primary query command; free-text lookup or compound filters
191
+ - `bdsc report <name>`: canned reports for `olfactory`, `drivers`, `optogenetics`
192
+ - `bdsc export <dataset>`: stream normalized rows as `jsonl`, `csv`, or `tsv`
193
+ - `bdsc terms <scope>`: inspect available property/relationship vocab
194
+ - `bdsc stock <stknum>`: local stock details
195
+ - legacy compatibility shims still exist for `search`, `gene`, `component`, `fbid`, `rrid`, `property`, `property-exact`, `driver-family`, `relationship`, `lookup`, `filter`, `live-search`
196
+
197
+ ## Find
198
+
199
+ Use `find` when the caller does not want to choose a dedicated query command up
200
+ front.
201
+
202
+ Auto-detect rules:
203
+
204
+ - digits -> `stock`
205
+ - `RRID:BDSC_*` or `BDSC_*` -> `rrid`
206
+ - `FBgn...` -> `gene`
207
+ - `FBti...` / `FBal...` / similar `FB..` ids in the component table -> `fbid`
208
+ - transgene/component-like text (`P{...}`, brackets, `attP`, `CyO`) -> `component`
209
+ - multi-term or dotted construct fragments -> local full-text `search`
210
+ - `--kind property` when you want property-driven lookup explicitly
211
+ - single bare terms -> `gene`, then local full-text `search` fallback if no gene hits
212
+
213
+ Examples:
214
+
215
+ ```bash
216
+ bdsc find Chronos
217
+ bdsc find RRID:BDSC_77118
218
+ bdsc find --kind component 'P{10XUAS-Chronos'
219
+ bdsc find --kind property VALIUM20
220
+ bdsc find --kind property-exact lexA
221
+ bdsc find --kind driver-family qf
222
+ ```
223
+
224
+ ## Export
225
+
226
+ Use `export` when another tool wants direct normalized rows instead of
227
+ search-oriented output.
228
+
229
+ Datasets:
230
+
231
+ - `stocks`
232
+ - `components`
233
+ - `genes`
234
+ - `properties`
235
+
236
+ Examples:
237
+
238
+ ```bash
239
+ bdsc export stocks --limit 3
240
+ bdsc export genes --query Chronos --kind gene
241
+ bdsc export components --query FBti0195688 --kind fbid --format jsonl
242
+ bdsc export properties --query VALIUM20 --kind property --format tsv
243
+ bdsc export components --gene Or56a --property lexA --format jsonl
244
+ bdsc export components --gene Or42b --driver-family qf --format jsonl
245
+ bdsc export genes --property olfactory --relationship coding --format csv
246
+ bdsc export components --format tsv --output components.tsv
247
+ bdsc export genes --format csv --output genes.csv
248
+ bdsc export properties --limit 20 --format jsonl
249
+ ```
250
+
251
+ `export --query` uses the same lookup kinds as `find --kind`:
252
+
253
+ - `stock`
254
+ - `rrid`
255
+ - `gene`
256
+ - `fbid`
257
+ - `component`
258
+ - `property`
259
+ - `property-exact`
260
+ - `driver-family`
261
+ - `relationship`
262
+ - `search`
263
+ - `auto`
264
+
265
+ You can also stack explicit filter flags on `export`; multiple flags combine as
266
+ AND:
267
+
268
+ - `--stock`
269
+ - `--rrid`
270
+ - `--gene`
271
+ - `--component`
272
+ - `--fbid`
273
+ - `--property`
274
+ - `--property-exact`
275
+ - `--driver-family`
276
+ - `--relationship`
277
+ - `--search`
278
+
279
+ ## Compound Find
280
+
281
+ `find` also subsumes compound filters. Default dataset: `components`.
282
+
283
+ Examples:
284
+
285
+ ```bash
286
+ bdsc find --gene Or56a --property lexA
287
+ bdsc find --gene Or67d --property qf
288
+ bdsc find --gene Or42b --driver-family lexA
289
+ bdsc find --gene Or56a --property-exact lexA
290
+ bdsc find --dataset stocks --property optogenetic
291
+ bdsc find --dataset genes --property olfactory --relationship coding --jsonl
292
+ ```
293
+
294
+ ## Reports
295
+
296
+ Use `report` for curated high-level buckets that would otherwise need multiple
297
+ queries or OR filters.
298
+
299
+ Reports:
300
+
301
+ - `olfactory`: receptor-family genes (`Or*`, `Orco`, `Ir*`, `Obp*`)
302
+ - `drivers`: GAL4 / lexA / QF / split-driver / FLP-like driver surfaces
303
+ - `optogenetics`: common optogenetic effectors plus optogenetic-tagged properties
304
+
305
+ Examples:
306
+
307
+ ```bash
308
+ bdsc report olfactory
309
+ bdsc report olfactory --dataset genes --jsonl
310
+ bdsc report drivers --limit 50 --json
311
+ bdsc report optogenetics --dataset components --jsonl
312
+ ```
313
+
314
+ ## Terms
315
+
316
+ Use `terms` when you need to discover the vocabulary before filtering.
317
+
318
+ Scopes:
319
+
320
+ - `properties`
321
+ - `property-descriptions`
322
+ - `relationships`
323
+
324
+ Examples:
325
+
326
+ ```bash
327
+ bdsc terms properties --limit 20
328
+ bdsc terms properties --query VALIUM --json
329
+ bdsc terms relationships --limit 20
330
+ bdsc terms property-descriptions --query optogenetic --jsonl
331
+ ```
332
+
333
+ ## Notes
334
+
335
+ - `sync` uses conditional HTTP headers when possible (`ETag`,
336
+ `If-Modified-Since`) to avoid re-downloading unchanged files.
337
+ - Local lookup is built from the public CSV dumps, not the private site search
338
+ endpoints.
339
+ - `search` now uses a two-stage index: exact/prefix FTS first, trigram fuzzy
340
+ fallback second. Typos and loose spacing/punctuation usually still find the
341
+ intended stock without having the exact BDSC string.
342
+ - `find` is the intended interactive entrypoint; dedicated legacy query
343
+ commands still work but are no longer the main documented path.
344
+ - direct lookup paths also rerank fuzzy candidates when exact/prefix matching
345
+ misses.
346
+ - use `property-exact` or `driver-family` when `property` is too broad for a
347
+ reliable LexA/QF/GAL4-style answer.
348
+ - tag pushes like `vX.Y.Z` run the release workflow: build artifacts, create a
349
+ GitHub release, publish to PyPI, and update `gumadeiras/homebrew-tap`.
350
+ - The live endpoint is undocumented and may change without notice.
351
+ - BDSC data is large enough that the first full sync/index can take a few
352
+ minutes depending on network and disk speed.
@@ -0,0 +1,9 @@
1
+ bdsc-0.2.4.dist-info/licenses/LICENSE,sha256=pOm_AKDa_IHzuMyjTQlSC46C0WZiYTDhQXkmlkSk6cI,1080
2
+ bdsc_cli/__init__.py,sha256=8JeJFxyVOg7u8HKh9f7ghabbPznK_dFjby_fTdgAvjs,49
3
+ bdsc_cli/cli.py,sha256=jEHsJ-nCAQ2XIwO4HUGni8_FoQDe_zAJrD_5YeluDm0,20045
4
+ bdsc_cli/core.py,sha256=6y-knGNCT6ZtUXJ_ks6ildMUIcDjvyhgFvbVwaPLWKE,88527
5
+ bdsc-0.2.4.dist-info/METADATA,sha256=RPcMRtJXpQFU-fvMZz5A8vaIBDmggW4pnuQymRxmbBY,8738
6
+ bdsc-0.2.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
7
+ bdsc-0.2.4.dist-info/entry_points.txt,sha256=pOMr0MMUcKBxqPpNCgrP8q8F-ffTI1z6caNvBbTyg9A,43
8
+ bdsc-0.2.4.dist-info/top_level.txt,sha256=CKhLY15Afkzfa_SUO4zuxn9roQBA0dWrjTFgcFypd7E,9
9
+ bdsc-0.2.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ bdsc = bdsc_cli.cli:main
@@ -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
bdsc_cli/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ __all__ = ["__version__"]
2
+
3
+ __version__ = "0.2.4"