View.py

Latest version: v1.0.0a10

Safety actively analyzes 634963 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.0.0alpha10

- Added the `view docs` command
- Reworked internal logging API and changed default logger format
- Added the `websocket` router
- Made hijack optional in fancy mode
- Added a startup message
- Added support for `daphne` and `hypercorn` as servers
- Added documentation for `view.env` and added environment variables to configuration
- Removed dead file `src/view/nodes.py` and `src/view/compiler.py`
- Added `patterns` loader to `view init`
- Updated internal C API structure
- Added `build` to config
- Added the `build_app` and `build_steps` functions
- `Route.__call__` is now used internally over `Route.func`
- Added the `to_response` function
- Improved type checking on functions decorated with a router function
- Added preset values to the `view.toml` generated by `view init`
- Fixed fancy logging not exiting after a `KeyboardInterrupt`
- Added prettier input prompts to `view init`
- Added `HTML.from_file`
- **Breaking Change:** Middleware functions must now take `call_next`

1.0.0alpha9

- Fixed `template` attribute with the `view` template renderer
- Added the `context` decorator and the `Context` type
- Added the `headers` parameter to functions on `TestingContext`
- Modified some behavior of automatic route inputs
- Fixed syntax errors in `view init`
- Added `Route.middleware`
- Routes with equivalent paths but different methods now return `405 Method Not Allowed` when accessed
- Added `route` and `App.route`
- Added docstrings to router functions
- Added the `JSON` response class
- Added the `custom` body translate strategy
- Made `method` a keyword-only parameter in `path`
- Added the `extract_path` utility
- Added the `view build` command
- Added `App.template`
- Route errors now display the error message when `dev` is `True`
- Changed exception rendering in route errors to use the `rich` renderer
- Added `compile_type` and `TCValidator`
- Added `markdown` and `App.markdown`
- Added the `Error` class
- Added the `error_class` parameter to both `new_app` and `App`
- Added the `ERROR_CODES` constant
- Completely rewrote docs
- **Breaking Change:** The `body` parameter in `Response` is now required

1.0.0alpha8

- Added optional dependencies for `databases` and `templates`
- Added environment prefixes for database configuration
- Added `templates` and `TemplatesConfig` to config
- Added the `templates` function
- Added support for `attrs` in type validation
- Added documentation for caching
- Added the `cache_rate` parameter to routers
- Removed `psutil` and `plotext` as a global dependency
- Added `fancy` optional dependencies
- Fixed route inputs with synchronous routes
- **Breaking Change:** Route inputs are now applied in the order of the decorator call as it appears in code

1.0.0alpha7

**Quick Patch Release**

- Remerged new `view init` command.

1.0.0alpha6

- Added `get_app`
- Added documentation generation
- Added database support (NOT FINISHED)
- Removed `attempt_import` and `MissingLibraryError`
- Added support for lists in type validation
- Added support for implicit query parameters
- Renamed `debug` to `enable_debug`
- Added `debug`, `info`, `warning`, `error`, and `critical` logging functions
- Added `InvalidRouteError`, `DuplicateRouteError`, `ViewInternalError`, and `ConfigurationError`
- Renamed `EnvironmentError` to `BadEnvironmentError`
- Added logging functions to `App`
- Changed environment prefixes for configuration
- Rewrote documentation
- Added `patterns` loader
- Added handling of relative paths in the configuration setting `loader_path`
- Added exists validation to `loader_path`
- Add path to `PATH` environment variable during loading
- Upgraded `view init`

1.0.0alpha5

- Added `app.query` and `app.body`
- Patched warning with starting app from incorrect filename
- Updated `__all__` for `routing.py`
- Added `view.Response` and `view.HTML`
- Fixed `__view_result__`
- Added support for `__view_body__` and `__view_construct__`
- Added support for Pydantic, `NamedTuple`, and dataclasses for type validation
- Support for direct union types (i.e. `str | int`, `Union[str, int]`) on type validation
- Added support for non async routes

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.