NASA-IMPACT / NASA-IMPACT/csda-client

Async flavored client

Open
#147 3 comments 0 reactions 0 assignees View on GitHub

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:

  1. Write an AsyncCsdaClient alongside the (Sync)CsdaClient. We might consider refactoring the internals per endpoint into some "core" for URL and payload construction that each flavor uses
  2. Write an AsyncCsdaClient and use unasync to rewrite AST and create the (Sync)CsdaClient as part of development process (e.g., put it in CI).
  3. Write the AsyncCsdaClient and convert our (Sync)CsdaClient to delegate to it via asyncio.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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.