Centipede icon

Centipede For Linux

  n/a
BSD License    

A WSGI microframework with a simple decorator based router. #WSGI microframework  #Decorator router  #WSGI  #Microframework  #Decorator  #Router  

Description

changelog

Free Download

Centipede is a WSGI microframework with a simple decorator based router. It's strength is that it models the technology in use and tries not to confuse developers with complex patterns and tricks. It inherits strongly from urlrelay.

pip install centipede

With Centipede you expose functions to urls. Functions either return a string or a tuple. A string is treated as the document body, http status is set to 200 OK and returned to the browser. Should you return a tuple, status code, body and headers are expected. The expose decorator also supports a few arguments.

from centipede import expose, app

@expose('^/$') def index(request):  """ Simple Hello IgglePigglePartyPants  """  return 'Hello IgglePigglePartyPants!'

@expose('^/google$') def index(request):  """ A redirect  """  return (307, '', {'Location':'http://google.com'})

import json

@expose('^/twitter$', 'GET', content_type='application/json') def twitter(request):  """ Return your twitter status  """  return json.dumps({  'status' : 'My awesome and insightful twitter status. #blah'  })

application = app()

The expose decorator looks like this:

expose(url_pattern, method=None, content_type='text/html', charset='UTF-8')

The parameter passed to the functions exposed - in the examples above named request - is the WSGI environ dictionary.

I would recommend keeping your html templates static on the client side and use a javascript template library. But if you really need some server side templating, have a look at mako.

Deployment

For deployment it is a good idea to run your centipede application behind a good WSGI server. There is a bunch. Gunicorn is good. I usually end up running uwsgi behind nginx.

System requirements

What's new in Centipede 0.2.5:

  • Separated query string params and form data
  • Form data in data key
  • Query string params in params key
  • Improved error handling for unpacking params (needs more work)
Read the full changelog

Centipede 0.2.5

add to watchlist add to download basket send us an update REPORT
  runs on:
Linux
  filename:
centipede-0.2.5.tar.gz
  main category:
Internet
  developer:
  visit homepage

IrfanView 4.67

With support for a long list of plugins, this minimalistic utility helps you view images, as well as edit and convert them using a built-in batch mode
IrfanView

Bitdefender Antivirus Free 27.0.35.146

Feather-light and free antivirus solution from renowned developer that keeps the PC protected at all times from malware without requiring user configuration
Bitdefender Antivirus Free

calibre 7.9.0

Effortlessly keep your e-book library thoroughly organized with the help of the numerous features offered by this efficient and capable manager
calibre

7-Zip 23.01 / 24.04 Beta

An intuitive application with a very good compression ratio that can help you not only create and extract archives, but also test them for errors
7-Zip

Windows Sandbox Launcher 1.0.0

Set up the Windows Sandbox parameters to your specific requirements, with this dedicated launcher that features advanced parametrization
Windows Sandbox Launcher

ShareX 16.0.1

Capture your screen, create GIFs, and record videos through this versatile solution that includes various other amenities: an OCR scanner, image uploader, URL shortener, and much more
ShareX

4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655

Export your favorite YouTube videos and playlists with this intuitive, lightweight program, built to facilitate downloading clips from the popular website
4k Video Downloader

Zoom Client 6.0.2.37566

The official desktop client for Zoom, the popular video conferencing and collaboration tool used by millions of people worldwide
Zoom Client

Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work

Effortlessly chat, collaborate on projects, and transfer files within a business-like environment by employing this Microsoft-vetted application
Microsoft Teams

paint.net 5.0.13 (5.13.8830.42291)

Packed with an array of options and an intuitive interface, this application enables you to create professional-looking photographs
paint.net

% discount
Zoom Client
  • Zoom Client
  • Microsoft Teams
  • paint.net
  • IrfanView
  • Bitdefender Antivirus Free
  • calibre
  • 7-Zip
  • Windows Sandbox Launcher
  • ShareX
  • 4k Video Downloader
essentials


User Comments
This enables Disqus, Inc. to process some of your data. Disqus privacy policy