Skip to main content

High-performance web service framework

Project description

Summary

Smisk is a simple, high-performance and scalable web service framework written in C, but controlled by Python.

It is designed to widen the common bottle necks in heavy-duty web services.

More information at the Smisk website

Getting Started

Examples

This is a minimal Smisk service:

from smisk.core import Application
class MyApp(Application):
  def service(self):
    self.response.headers = ['Content-Type: text/plain']
    self.response("Hello World!")

MyApp().run()

And here we have a WSGI compatible application:

from smisk.wsgi import *
def hello_app(env, start_response):
  start_response("200 OK", [('Content-Type', 'text/plain')])
  return ["Hello, World!"]

main(hello_app)

More examples available here…

Authors & Contributors

Changes

1.1.2

  • Inter-process communication module smisk.ipc, providing a shared dictionary which can be concurrently manipulated by a set of processes.

  • Berkely DB module smisk.core.bsddb

  • Benchmark utility module smisk.util.benchmark exposes an iterator which can be used to easily benchmark snippets of code.

  • The key-value store example application now uses the shared dictionary provided by smisk.ipc.

  • smisk.core.Request have two soft limits – max_multipart_size and max_formdata_size – for limiting automatically handled input data size. These soft limits can also be used to disable the automated parsing of Smisk.

  • smisk.util.cache has a new function – app_shared_key – returning a byte string which can be used to uniqely identify the application. The key is based on the entry file (the python file in which __name__ == “__main__”).

  • smisk.util.type exposes MutableMapping – in Python >=2.6 this is collections.MutableMapping, in Python >=2.3 it is UserDict.DictMixin.

  • Serializers no longer emit warning.warn-messages when no suiting implementations are available. Now they are simply not registered whitout as much as a whisper.

  • In the C library, the macro SMISK_PyString_Check has changed name to SMISK_STRING_CHECK (however it still does the exact same thing as before, just that in preparation for porting Smisk to Python 3, we need to sort out the different meanings of “bytes strings” and “character strings”)

  • In the C library, we use PyBytes instead of PyString and NUMBER_* instead of some PyInt-functions, having macros for Python <2.5. This is a step toward the Python 3 port.

  • smisk.core is now stored as _smisk and imported by smisk/core/__init__.py. This follows the naming custom of other machine-native modules as well as provides better name (i.e. _smisk.so instead of core.so) in various listings.

  • Fixed a bug in smisk.core where a www-form-urlencoded request with incorrect content length and the first key was longer than the provided content length, smisk would induce strange errors (because trying to set NULL into a python dict).

1.1.1

  • Fully unicode on the inside – request.get, .post, .cookies, etc return unicode values and where dictionary keys are used, which have been translated from the outside world, they are guranteeded to be encoded as UTF-8. (Dictionary keys used as keyword arguments must be str in Python <=2.5)

  • YAML read/write-serialization #21 [a72dc2f0855b]

  • Handles and reconnects dead MySQL-connections. #23 [49cb2034a8b1]

  • No longer stores empty parts as None from multipart messages. #15 [d9920fb75ca2]

  • Makes full use of HTTP 1.1 request methods (OPTIONS, GET, HEAD, PUT, POST, DELETE). See example application: examples/mvc/key-value-store/

  • smisk.mvc.model no longer disposes SA/Elixir sessions for each request, but tries to reuse a session as long as no error occur.

  • redirect_to() respects and retains explicit request format, denoted by path extension in the original request.

  • smisk.test.live introduces “live” tests, running a server and a client, measuring communication and effects.

1.1.0

  • MVC module – smisk.mvc.

  • Better unicode support.

  • Compatible with Debian Etch.

  • Host server URL rewrites now propagating correctly.

1.0.1

  • Full WSGI support – passes the wsgiref validation tests.

  • Iterable request makes reading input data simple.

  • Stream implements writelines for optimized sending of chunks of strings.

  • Response implements a Stream.writelines proxy, automatically calling begin().

  • Callable response makes responses simpler. Based on writelines.

  • Fixed a bug where smisk_multipart_parse_file would try to fclose a uninitialized fd. [11c4ffae718f]

1.0.0

  • First stable version

License

Copyright (c) 2007-2009 Rasmus Andersson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Download

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smisk-1.1.2.tar.gz (833.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page