Title: [FEATURE] Enhance `StackQL` Constructor for Improved Usability · Issue #19 · stackql/pystackql · GitHub
Open Graph Title: [FEATURE] Enhance `StackQL` Constructor for Improved Usability · Issue #19 · stackql/pystackql
X Title: [FEATURE] Enhance `StackQL` Constructor for Improved Usability · Issue #19 · stackql/pystackql
Description: Description The StackQL class requires a refactor to separate read-only parameters and constructor arguments, as well as update and enhance its functionality regarding output formatting and argument handling, particularly when server_mod...
Open Graph Description: Description The StackQL class requires a refactor to separate read-only parameters and constructor arguments, as well as update and enhance its functionality regarding output formatting and argumen...
X Description: Description The StackQL class requires a refactor to separate read-only parameters and constructor arguments, as well as update and enhance its functionality regarding output formatting and argumen...
Opengraph URL: https://github.com/stackql/pystackql/issues/19
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE] Enhance `StackQL` Constructor for Improved Usability","articleBody":"## Description\r\n\r\nThe `StackQL` class requires a refactor to separate read-only parameters and constructor arguments, as well as update and enhance its functionality regarding output formatting and argument handling, particularly when `server_mode` is set to `False`.\r\n\r\n## Detailed Changes\r\n \r\n### 1. Changes to Read-Only Parameters\r\n- Ensure the following parameters are only valid when `server_mode=False`:\r\n - `version`\r\n - `params`\r\n - `bin_path`\r\n - `sha`\r\n - `auth`\r\n \r\n### 2. Removal and Replacement of Arguments\r\n- Remove `parse_json` and replace it with `output` which accepts the following options:\r\n - `dict` (default)\r\n - `pandas`\r\n - `csv` (only if `server_mode=False`)\r\n\r\n### 3. Additional Argument Handling\r\nWhen `output='csv'`, introduce additional parameters:\r\n- `delimiter`: Defaults to `,`.\r\n- `hide_headers`: Defaults to `False`.\r\n\r\nIf `server_mode=False`, allow additional configuration through the following arguments:\r\n- `api_timeout`: Default 45, 0 for no timeout\r\n- `proxy_host`: HTTP proxy host, default None\r\n- `proxy_password`: HTTP proxy password, default None\r\n- `proxy_port`: Int, HTTP proxy port, default -1\r\n- `proxy_scheme`: HTTP proxy scheme, default \"http\"\r\n- `proxy_user`: Default None\r\n- `max_results`: Max results per HTTP request, default -1\r\n- `page_limit`: Max pages of results per resource, default 20\r\n- `max_depth`: Max depth for indirect queries, default 5\r\n \r\n## Proposed Docstring Update\r\n\r\n```python\r\nclass StackQL:\r\n \"\"\"\r\n A class representing an instance of the StackQL query engine.\r\n\r\n download_dir: The download directory for the StackQL executable.\r\n :type download_dir: str\r\n :default: site.getuserbase()\r\n\r\n server_mode: Connect to a StackQL server.\r\n :type server_mode: bool\r\n :default: False\r\n \r\n server_address: The address of the StackQL server.\r\n :type server_address: str\r\n :default: '0.0.0.0'\r\n \r\n server_port: The port of the StackQL server.\r\n :type server_port: int\r\n :default: 5466\r\n \r\n output: Determines the format of the output, options are 'dict', 'pandas', and 'csv'.\r\n :type output: str\r\n :default: 'dict'\r\n :options: ['dict', 'pandas', 'csv']\r\n \r\n delimiter: (Only if output='csv') Delimiter character for CSV output.\r\n :type delimiter: str\r\n :default: ','\r\n\r\n hide_headers: (Only if output='csv') Whether to hide headers in CSV output.\r\n :type hide_headers: bool\r\n :default: False\r\n\r\n api_timeout: (server_mode=False only) API timeout.\r\n :type api_timeout: int\r\n :default: 45\r\n \r\n proxy_host: (server_mode=False only) HTTP proxy host.\r\n :type proxy_host: str\r\n :default: None\r\n \r\n proxy_password: (server_mode=False only) HTTP proxy password.\r\n :type proxy_password: str\r\n :default: None\r\n\r\n proxy_port: (server_mode=False only) HTTP proxy port.\r\n :type proxy_port: int\r\n :default: -1\r\n \r\n proxy_scheme: (server_mode=False only) HTTP proxy scheme.\r\n :type proxy_scheme: str\r\n :default: 'http'\r\n \r\n proxy_user: (server_mode=False only) HTTP proxy user.\r\n :type proxy_user: str\r\n :default: None\r\n \r\n max_results: (server_mode=False only) Max results per HTTP request.\r\n :type max_results: int\r\n :default: -1\r\n \r\n page_limit: (server_mode=False only) Max pages of results that will be returned per resource.\r\n :type page_limit: int\r\n :default: 20\r\n \r\n max_depth: (server_mode=False only) Max depth for indirect queries: views and subqueries.\r\n :type max_depth: int\r\n :default: 5\r\n \r\n --- Read-Only Attributes ---\r\n \r\n platform: The operating system platform.\r\n :type platform: str\r\n \r\n package_version: The version number of the pystackql Python package.\r\n :type package_version: str\r\n \r\n version: (server_mode=False only) The version number of the StackQL executable.\r\n :type version: str\r\n \r\n params: (server_mode=False only) A list of command-line parameters passed to the StackQL executable.\r\n :type params: list\r\n \r\n bin_path: (server_mode=False only) The full path of the StackQL executable.\r\n :type bin_path: str\r\n \r\n sha: (server_mode=False only) The commit (short) sha for the installed `stackql` binary build.\r\n :type sha: str\r\n \r\n auth: (server_mode=False only) StackQL provider authentication object supplied using the class constructor.\r\n :type auth: dict\r\n \"\"\"\r\n","author":{"url":"https://github.com/jeffreyaven","@type":"Person","name":"jeffreyaven"},"datePublished":"2023-10-13T01:09:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/19/pystackql/issues/19"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:90e239a5-f40e-2557-9aa4-6096e851d73c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A90E:9EDB:A4BED8:DEF31A:6A4D42DB |
| html-safe-nonce | e56922f6e25b1744d867e06138817c7528d9a8c373875e6a81729e6bddef3aa3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTBFOjlFREI6QTRCRUQ4OkRFRjMxQTo2QTRENDJEQiIsInZpc2l0b3JfaWQiOiI2OTY3NDU1NzM1MDIyOTYxMzcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | df69ca8bffd524c222ced1baa11fdfaeb7757a45ed5d4e8479d6583e51faceca |
| hovercard-subject-tag | issue:1941052223 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stackql/pystackql/19/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4330fc954624b66fa8f684dadf65919b8919d246e7ee8b35976e1b10555f3b19/stackql/pystackql/issues/19 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4330fc954624b66fa8f684dadf65919b8919d246e7ee8b35976e1b10555f3b19/stackql/pystackql/issues/19 |
| og:image:alt | Description The StackQL class requires a refactor to separate read-only parameters and constructor arguments, as well as update and enhance its functionality regarding output formatting and argumen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeffreyaven |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/stackql/pystackql git https://github.com/stackql/pystackql.git |
| octolytics-dimension-user_id | 95105302 |
| octolytics-dimension-user_login | stackql |
| octolytics-dimension-repository_id | 455730530 |
| octolytics-dimension-repository_nwo | stackql/pystackql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 455730530 |
| octolytics-dimension-repository_network_root_nwo | stackql/pystackql |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width