Skip to main content

A tiny experimental server-side express-like library

Project description

Threadsnake

Threadsnake is an experimental server side library. It was created as an educational (self-educational) project in order to explain how does HTTP/1.1 works (I'm lying, it was to understand it).

import asyncio
from threadsnake.turbo import Application, HttpRequest, HttpResponse

app = Application(8080)

@app.get('/')
def main(app:Application, req:HttpRequest, res:HttpResponse):
    res.end('Served by threadsnake!')

asyncio.run(app.run())

The previous example sets a server wich listens at port 8080 and responds to every get resquest to the path /

Threadsnake is designed to be lightweight and simple, yet able to serve hypertext and other resources sucessfully. Futhermore, as it was build over the The Python Standard Library, it has no third party dependencies.

Features

As I said, threadsnake is an academic project, not intended to be used as an fully production tool. However, it actually has some interesting capacities out of the box:

...And much more. In fact, I'm compiling a lot of examples in order to show how can you use all those options to make a feature-rich and fully functional web server.

Installing threadsnake

Installing through pip

The main way to get threadsnake is using pip:

pip install threadsnake

If you did it well, the python package manager will download and install threadsnake on your system. If not, well... That means something went wrong. Check this link in order to solve the pip installation method. Those other links may be helpful:

Downloading from Pypi

Yes, i know it's redundant, but you always can go to pypi and download the package directly (The 'directly' part is the actual link to pypi. However, as all we know, we feel more comfortable by clicking the literal link, so, here you have it: https://pypi.org/project/threadsnake/#files).

Downloading from the repository ...if still here

If Murphy is obsessed with you (Seriously, if you're still reading, it have to be true) and all the above fails, then you have no option than going to the repository at github.

Documentation and Issues

Wow... You're still reading. You have to be some sort of... Anime Archetype.

Well, as you can see right now we lack of a proper documentation. You have to understand, it's a new and small project. That said, once I finish uploading the examples, I'm planning to publish the documentation in this link and the bugs tracking to this other link. Till then... you know. Don't let your dreams be dreams. JU5T D0 1T (I don't know anything about trademarks, so i wrote the phrase that way cause i don't want that ancient-greek sneakers-maker goddess to get mad at me).

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

threadsnake-1.0.12.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

threadsnake-1.0.12-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file threadsnake-1.0.12.tar.gz.

File metadata

  • Download URL: threadsnake-1.0.12.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for threadsnake-1.0.12.tar.gz
Algorithm Hash digest
SHA256 25e153d6c3d2509f47f0e83b9780606e8466e43aa35bd4fbfdb37c7d9d4d56b4
MD5 8d14bda6fcda09a430983b23b1e26b28
BLAKE2b-256 dab2e4ceb51a1d4fea594c124fd2d894890408e3faae9f5436a2d7f4fea7e0bf

See more details on using hashes here.

File details

Details for the file threadsnake-1.0.12-py3-none-any.whl.

File metadata

  • Download URL: threadsnake-1.0.12-py3-none-any.whl
  • Upload date:
  • Size: 43.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for threadsnake-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6667c32ee8c51a1af0478e2f6d4cd255b243e02f0fe8fa463d9337cf0d35f6ee
MD5 02e39b33266f1770d21697b88f31dfd4
BLAKE2b-256 7a90f89cb9868b6f176b0d78c3d5a9efef4a9c6f99ab148e23b55d578e7241a3

See more details on using hashes here.

Supported by

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