NASA-IMPACT / NASA-IMPACT/csda-client
Async flavored client
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 2
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 4
Description
This thought came up when considering if we can use this library in our STAC API to talk to Data Auth API (/signup/api/users/{username}/ and /signup/api/users/{username}/) as part of adding authorization. Some of the response models aren't complete enough for the needs, but the bigger blocker is that it'd be unfortunate to put sync code into async endpoints.
It seems like there's at least a few options:
- Write an
AsyncCsdaClientalongside the(Sync)CsdaClient. We might consider refactoring the internals per endpoint into some "core" for URL and payload construction that each flavor uses - Write an
AsyncCsdaClientand use unasync to rewrite AST and create the(Sync)CsdaClientas part of development process (e.g., put it in CI).- This is what the official Python ElasticSearch client does
- Write the
AsyncCsdaClientand convert our(Sync)CsdaClientto delegate to it viaasyncio.run()(I think this can blow up in contexts with an existing event loop)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing SyncCsdaClient and the endpoint handling for /signup/api/users/{username}/. Compare the three proposed approaches—an AsyncCsdaClient, unasync generation, or asyncio.run() delegation—and check the response models needed by the STAC API use case. Done means an agreed implementation strategy and an async client that supports the required authorization calls without disrupting sync usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100