-
Notifications
You must be signed in to change notification settings - Fork 9
docs: update docstrings and readme pystac-client #84
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
be78607
docs: update docstrings and readme
c30cbb0
Merge branch 'main' into update-docs
gadomski 82199fa
docs: add pystapi client
gadomski da52f18
Merge branch 'main' into update-docs
1815ead
resolve mkdocs issues in docstrings
stellamzr 155ce14
Merge branch 'main' into update-docs
stellamzr 6e5a21f
feat: more fixups
gadomski 1ba7137
Merge branch 'main' into update-docs
gadomski ba2a32b
fix: lint
gadomski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,53 @@ | ||||||||||||||||||||||||||||||||||||||||||
| # pystapi-client | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| PySTAPI Client is a Python library for interacting with [STAPI](https://github.com/stapi-spec/stapi-spec) endpoints. Below is a overview of the supported endpoints and examples. | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| ## Installation | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| Install from PyPi. | ||||||||||||||||||||||||||||||||||||||||||
| The dependencies for **pystapi-client** are the Python [httpx](https://www.python-httpx.org/) and [dateutil](https://dateutil.readthedocs.io) libraries. | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| ```shell | ||||||||||||||||||||||||||||||||||||||||||
| python -m pip install pystapi-client | ||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| ## Currently Supported Endpoints | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| These endpoints are fully implemented and available in the current version of PySTAPI Client. | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| | Category | Endpoint | Description | | ||||||||||||||||||||||||||||||||||||||||||
| |----------|----------|-------------| | ||||||||||||||||||||||||||||||||||||||||||
| | Root | `/` | Root endpoint (for links and conformance) | | ||||||||||||||||||||||||||||||||||||||||||
| | Root | `/conformance` | Conformance information | | ||||||||||||||||||||||||||||||||||||||||||
| | Products | `/products` | List all products | | ||||||||||||||||||||||||||||||||||||||||||
| | Products | `/products/{product_id}` | Get specific product | | ||||||||||||||||||||||||||||||||||||||||||
| | Orders | `/orders` | List all orders | | ||||||||||||||||||||||||||||||||||||||||||
| | Orders | `/orders/{order_id}` | Get specific order | | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| ## Usage Example | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| The `pystapi_client.Client` class is the main interface for working with services that conform to the STAPI API spec. | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| Pre-request: The app should be accessible at `http://localhost:8000`. | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| Pre-request: The app should be accessible at `http://localhost:8000`. |
Outdated
Member
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.
Nit: let's make the call simpler, to show you don't have to pass by keyword:
Suggested change
| product = client.get_product(product_id="test-spotlight") | |
| # List all Opportunities for a Product | |
| opportunities = client.get_product_opportunities(product_id="test-spotlight") | |
| # List orders | |
| orders = client.get_orders() | |
| # Get specific order | |
| order = client.get_order(order_id="test-order") | |
| product = client.get_product("test-spotlight") | |
| # List all Opportunities for a Product | |
| opportunities = client.get_product_opportunities("test-spotlight") | |
| # List orders | |
| orders = client.get_orders() | |
| # Get specific order | |
| order = client.get_order("test-order") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,8 @@ description = "Python library for searching Satellite Tasking API (STAPI) APIs." | |
| readme = "README.md" | ||
| authors = [ | ||
| { name = "Kaveh Karimi-Asli", email = "[email protected]" }, | ||
| { name = "Philip Weiss", email = "[email protected]" } | ||
| { name = "Philip Weiss", email = "[email protected]" }, | ||
| { name = "Stella Reinhardt", email = "[email protected]"} | ||
| ] | ||
| maintainers = [{ name = "Pete Gadomski", email = "[email protected]" }] | ||
| keywords = ["stapi"] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm a little wary about including this table, as we'll have to keep it continually updated. I think I'd prefer to just point to the API docs, which will be generated from the code?