keotl / jivago Goto Github PK
View Code? Open in Web Editor NEWThe highly-reflective object-oriented Python web framework
Home Page: https://docs.jivago.io
License: MIT License
The highly-reflective object-oriented Python web framework
Home Page: https://docs.jivago.io
License: MIT License
Each RoutingTable could know which filters have to be applied.
AS a user of the Stream class of Jivago I would like to have a first()
function to retrieve the first element of a given Stream.
Acceptance Criteria
a_list = [1,2,3]
first = Stream(a_list).first()
assertEqual(1, first)
an_empty_list = []
first = Stream(an_empty_list).first()
assertIsNone(first)
Note: A java Optional
equivalent could be implemented to handle second case.
Unit testing and end-to-end testing
'User' -> 'U', 's', 'e', 'r'
This causes issues when serving images, etc.
maybe
@GET
def search(self, q: str, limit: Optional[int]) -> Response:
Static file served from "/". When getting "/", the server returns 500 internal server error.
2019-01-24 10:29:52 [ExceptionFilter] [ERROR] Traceback (most recent call last):
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/error_handling/unknown_exception_filter.py", line 17, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/templating/template_filter.py", line 23, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/request/json_serialization_filter.py", line 17, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/request/http_form_deserialization_filter.py", line 16, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/body_serialization_filter.py", line 16, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/error_handling/application_exception_filter.py", line 27, in doFilter
raise e
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/error_handling/application_exception_filter.py", line 21, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 28, in doFilter
self.filters[0].doFilter(request, response, self.getNextChain())
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/system_filters/jivago_banner_filter.py", line 13, in doFilter
chain.doFilter(request, response)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/filter/filter_chain.py", line 20, in doFilter
gotten_response = invoker.invoke(request)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/invocation/rewrite/path_rewriting_route_handler_decorator.py", line 16, in invoke
return self.decorated.invoke(ModifiedPathFlyweightRequest(request, self.new_path))
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/invocation/resource_invoker.py", line 29, in invoke
function_return = method(*parameters)
File "/home/atreides/Documents/lecture-bingo/venv/lib/python3.6/site-packages/jivago/wsgi/routing/serving/static_file_serving_resource.py", line 12, in serve_file
with open(self.filepath, 'rb') as f:
IsADirectoryError: [Errno 21] Is a directory: '/home/atreides/Documents/lecture-bingo/web_ui/build/'
e.g. redirect "/" to "/index.html"
405 Method not allowed
count()
rotate()
clean shutdown
Add automated end-to-end testing before releases.
Add a way of creating a repeating sequence.
example :
Stream.infinite([1,2]).take(100)
log initialization steps
Add new RouterConfigRule which rewrites request to a background worker/routing table.
Might become a separate package. (i.e. jivago-websockets)
@Override
def get_filters(self, path: str) -> List[Type[Filter]]:
return [NoCorsFilter, DebugExceptionFilter] + super().get_filters(path)
Otherwise, it interferes with default exception mappers.
@Init
@PreInit
@PostInit
Stream.sum()
Stream.min()
Stream.max()
Stream.zip()
As a user of jivago's ObjectMapper
, I would like to be able to deserialize into typed Dict, SO that I can deserialize more complex objects.
Acceptance criteria:
This json
{
"stats": {
"0": {
"rank": 1,
"score": 41480
},
"1": {
"rank": 2,
"score": 40847
}
}
}
can be deserialized into
@Serializable
class AnyObject(object):
def __init__(self, stats: Dict[str, Stat)):
self.stats: Dict[str, Stat] = stats
class Stat(object):
def __init__(self, rank: int, score: int):
self.rank: int = rank
self.score: int = score
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
Additionally, for HTTP request methods that can cause side-effects on user data (in particular, for HTTP methods other than GET, or for POST usage with certain MIME types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with an HTTP OPTIONS request method, and then, upon "approval" from the server, sending the actual request with the actual HTTP request method. Servers can also notify clients whether "credentials" (including Cookies and HTTP Authentication data) should be sent with requests.
self.dep.do_stuff()
shows up as "Incorrect parameters" in the response body when self.dep is None.
def foobar(query_param: QueryParam[str]):
print(query_param)
When it is applied on a class, it has a proper module name, whereas the main script has a "main" module reference. (Might not fix)
Json, YAML, .properties
configuration "DTO"s
Remove "HTTP" from user-defined headers
At the moment, docs.jivago.io always matches master. 🤔
{
"name" : "my name"
}
@POST
def post_form(self, name: str) -> RenderedView:
return RenderedView("template.html", {"name": name})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.