Skip to content
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

SDK for python #250

Merged
merged 1 commit into from
Jan 5, 2025
Merged

SDK for python #250

merged 1 commit into from
Jan 5, 2025

Conversation

lllama
Copy link
Contributor

@lllama lllama commented Nov 26, 2024

Adds an SSE event generator for Python. Given that python has many different frameworks and no standard request/response objects, this SDK provides a low-level class for using with whatever approach a framework has for SSE.

@lllama lllama force-pushed the python-sdk branch 2 times, most recently from e915345 to a9d1a13 Compare November 28, 2024 08:23
@lllama lllama changed the title WIP: v0.20 SDK for python WIP: v0.21 SDK for python Dec 15, 2024
@lllama lllama force-pushed the python-sdk branch 2 times, most recently from 698df02 to d178d0b Compare December 16, 2024 17:09
@lllama lllama changed the title WIP: v0.21 SDK for python v0.21 SDK for python Dec 16, 2024
@lllama lllama changed the title v0.21 SDK for python SDK for python Dec 16, 2024
@lllama lllama marked this pull request as ready for review December 16, 2024 17:10
Copy link
Contributor

@anastygnome anastygnome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dalito dalito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions for the pyproject.toml file.

@bencroker
Copy link
Collaborator

Any update on this, @lllama?

@lllama
Copy link
Contributor Author

lllama commented Dec 23, 2024

I think it's good to go from the Python side @bencroker. Does it need anything from the DataStar side?

@bencroker
Copy link
Collaborator

Not as far as I can tell. There appear to be a few comments above that you haven’t addressed.

@lllama lllama force-pushed the python-sdk branch 3 times, most recently from 0a0e9a9 to 4474d37 Compare December 28, 2024 16:45
@lllama
Copy link
Contributor Author

lllama commented Dec 28, 2024

Yeah @bencroker. Thanks to @dalito and @anastygnome for the help.

@bencroker
Copy link
Collaborator

@lllama can you move the examples into the /examples folder (outside the sdk folder), along with the other ones?
https://github.com/starfederation/datastar/tree/develop/examples

@lllama lllama force-pushed the python-sdk branch 4 times, most recently from 83e0f2e to 0c20fa8 Compare January 2, 2025 22:07
@lllama
Copy link
Contributor Author

lllama commented Jan 2, 2025

Moved the examples @bencroker. Thanks again to @dalito for spotting the Markdown issues.

@bencroker
Copy link
Collaborator

@lllama please update to use the v1.0.0-beta.1 syntax.

Python constants are created using the QuickTemplate build pipeline.

The SSE generator is a class with `classmethod`s which perform the
various SDK functions. The use of classmethods will allow users to
extend the class if needed. (Thanks to Tom D.
<[email protected]> for the suggestion for this, plus the
use of `__slots__`.)

Also provides helpers and examples for the following frameworks:

* Sanic
* FastAPI
* Django
* Quart

pyproject updates as suggested by dalito
@lllama
Copy link
Contributor Author

lllama commented Jan 4, 2025

Done @bencroker !

@bencroker
Copy link
Collaborator

Thanks!

@bencroker bencroker merged commit 3c6c29f into starfederation:develop Jan 5, 2025
1 check failed
@bencroker
Copy link
Collaborator

bencroker commented Jan 5, 2025

@lllama next up is to create the code samples for the guide.
See https://github.com/starfederation/datastar/tree/develop/site/static/code_snippets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants