-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Summary
The Shock client libraries in libs/ and shock-client/ are outdated. The Python client is Python 2 only and broken on Python 3, the JavaScript client is a 2013 jQuery browser script, and the Go client library has not been updated since 2019. For scripting against Shock today, users must fall back to raw curl commands.
Current State
| Client | Language | Location | Last Active | Issues |
|---|---|---|---|---|
go-shock-client |
Go library | vendor/github.com/MG-RAST/go-shock-client/ |
2019 | No go.mod; not published as a Go module; vendored/frozen |
shock-client |
Go CLI | shock-client/ |
2018 | Compiles but no new features; wiki docs reference port 7044 |
shock.py |
Python 2 | libs/shock.py |
2019 | Broken on Python 3 — uses cStringIO, urllib.urlencode, urllib.quote |
shock.js |
JS (jQuery) | libs/shock.js |
2013 | Browser-only; jQuery dependency; no npm package; pre-ES6 |
SHOCK::Client |
Perl | libs/SHOCK/Client.pm |
2019 | Functional but unmaintained |
Proposed Work
High Priority
- Port
libs/shock.pyto Python 3 — replacecStringIOwithio.BytesIO,urllib→urllib.parse, test against current Shock API. This is the most impactful change since Python is widely used in the bioinformatics community.
Medium Priority
- Modernize
go-shock-client— addgo.mod, publish as a proper Go module, update to current API (locations, types endpoints). Consider merging into this repo or updating the external repo atgithub.com/MG-RAST/go-shock-client. - Replace
libs/shock.jswith a modern JS/Node client — drop jQuery dependency, usefetchAPI, publish as npm package or at minimum make it usable from Node.js.
Low Priority
- Update
shock-clientCLI — add support for locations and types commands, update default port references. - Decide on Perl client — determine if
libs/SHOCK/Client.pmstill has users; if not, consider archiving.
Alternative
If maintaining multiple language clients is too much overhead, consider:
- Documenting the REST API thoroughly (done in fee7725) and providing a
curl-based tutorial (done indocs/tutorial.md) - Generating clients from the OpenAPI spec (
docs/API/shock-openapi.yaml) using a tool likeopenapi-generator
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels