-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/Changed README.md and add pypi index
- Loading branch information
1 parent
08c7104
commit ad8c2bf
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,44 @@ | ||
# Starlette Responses Kit | ||
**starlette-responses-kit** is an extension for Starlette, providing a collection of custom responses designed to enhance and simplify the development of web applications and APIs. This toolkit expands on Starlette's built-in responses, offering more flexibility and functionality to handle various content types and response patterns more efficiently. | ||
|
||
# Roadmap | ||
- [ ] Custom File Responses: Simplify the process of serving files with enhanced control over content-disposition and content types. | ||
- [ ] JSON File Response: Serve JSON content from files directly, optimizing for speed and memory usage. | ||
- [x] Text and Bytes File Response: Offer explicit responses for text and binary content, providing a clear and concise way to handle different file types. | ||
- [x] Async Support: Fully asynchronous responses, ensuring high performance and non-blocking I/O operations. | ||
- [x] Easy Integration: Designed to seamlessly integrate with existing Starlette applications or FastAPI projects that use Starlette internally. | ||
- [ ] Flexible and Extensible: Easily extend the kit with custom response types to suit your specific needs. | ||
|
||
# Installation | ||
Install starlette-responses-kit using pip: | ||
|
||
|
||
```bash | ||
pip install starlette-responses-kit | ||
``` | ||
|
||
# Quick Start | ||
Here's how to use one of the custom responses in a Starlette application: | ||
|
||
```python | ||
from starlette.applications import Starlette | ||
from starlette.responses import PlainTextResponse | ||
from starlette_responses_kit import TextFileResponse | ||
from starlette.routing import Route | ||
|
||
async def json_file_endpoint(request): | ||
return TextFileResponse("some-text") | ||
|
||
app = Starlette( | ||
debug=True, | ||
routes=[ | ||
Route("/text", json_file_endpoint), | ||
], | ||
) | ||
``` | ||
|
||
# Contributing | ||
Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome. | ||
|
||
# License | ||
starlette-responses-kit is released under the MIT License. See the bundled LICENSE file for details. |
This file contains 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