-
Notifications
You must be signed in to change notification settings - Fork 33
Add san cli #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add san cli #193
Changes from all commits
fbd8476
d9b378f
ca4d815
3384021
b2c499e
2f776fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,7 @@ For full API documentation and metric definitions, see [Santiment Academy](https | |||||||
|
|
||||||||
| - [Installation](#installation) | ||||||||
| - [Extra packages](#extra-packages) | ||||||||
| - [CLI](#cli) | ||||||||
| - [Configuration](#configuration) | ||||||||
| - [Environment variable](#environment-variable) | ||||||||
| - [Programmatic](#programmatic) | ||||||||
|
|
@@ -61,6 +62,54 @@ There are a few utilities in the `san/extras/` directory for backtesting and eve | |||||||
| pip install 'sanpy[extras]' | ||||||||
| ``` | ||||||||
|
|
||||||||
| ## CLI | ||||||||
|
|
||||||||
| Sanpy includes a command-line interface for quick data access without writing Python. | ||||||||
|
|
||||||||
| ``` | ||||||||
| san --help | ||||||||
| san --version | ||||||||
| ``` | ||||||||
|
|
||||||||
| ### Configuration | ||||||||
|
|
||||||||
| ```bash | ||||||||
| san config set-key <your-api-key> # Store API key | ||||||||
| san config show # Show current config | ||||||||
| san config path # Config file location | ||||||||
| san config clear # Remove stored API key | ||||||||
| ``` | ||||||||
|
|
||||||||
| The CLI reads the API key from (in order): `--api-key` flag, `SANPY_APIKEY` env var, stored config file. | ||||||||
|
|
||||||||
| ### Discovery | ||||||||
|
|
||||||||
| ```bash | ||||||||
| san metrics # List all metrics | ||||||||
| san metrics --slug bitcoin # Metrics for a specific asset | ||||||||
| san projects # List all projects | ||||||||
| ``` | ||||||||
|
|
||||||||
| ### Fetching data | ||||||||
|
|
||||||||
| ```bash | ||||||||
| san get price_usd --slug bitcoin --from 2024-01-01 --to 2024-01-05 | ||||||||
| san get price_usd --slug bitcoin --from 2024-01-01 --to 2024-01-05 -f json | ||||||||
| san get price_usd --slug bitcoin --aggregation avg | ||||||||
|
|
||||||||
| san get-many price_usd --slugs bitcoin,ethereum --from 2024-01-01 --to 2024-01-05 | ||||||||
| ``` | ||||||||
|
|
||||||||
| ### Rate limits & complexity | ||||||||
|
|
||||||||
| ```bash | ||||||||
| san rate-limit # API calls remaining | ||||||||
| san api-calls # API call history | ||||||||
| san complexity price_usd # Query complexity check | ||||||||
| ``` | ||||||||
|
|
||||||||
| All commands support `--format` (`table`, `json`, `csv`) and `--api-key` options. | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scope the flag-support claim more narrowly.
Proposed wording-All commands support `--format` (`table`, `json`, `csv`) and `--api-key` options.
+The discovery, data, and diagnostics commands support `--format` (`table`, `json`, `csv`).
+API-backed commands also accept `--api-key`.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
|
|
||||||||
| ## Configuration | ||||||||
|
|
||||||||
| Some metrics require a paid [SanAPI plan](https://academy.santiment.net/products-and-plans/sanapi-plans/) to access real-time or full historical data. You can provide an API key in two ways: | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a language to this fenced block.
This trips markdownlint and loses shell highlighting.
Proposed fix
Verify each finding against the current code and only fix it if needed.
In
@README.mdaround lines 69 - 72, The fenced code block containing thecommands "san --help" and "san --version" lacks a language tag, which trips
markdownlint and prevents shell highlighting; update that block by changing the
opening backticks to include a language identifier (e.g., replace
withbash) so the block readsbash followed by the two commands and closingto enable shell syntax highlighting.