T-Service
T-Service is a tiny Python tool for starting a local static file server using Tornado. I use it for previewing sites before pushing them to GitHub Pages.
Installation
T-Service is on PyPI, install it with: pip install tservice.
Usage
T-Service installs a command line utility called tserve. tserve has one required parameter: the directory from which to serve files. For example, to start the server from a directory called build that’s in your current directory, use this command:
tserve build
The server starts on port 8000 by default, so you can look for your site at http://localhost:8000.
Specifying a Port
If port 8000 is in use, or you want to use a different port, use the -p/--port flag:
tserve --port 7654 build
Specifying a Prefix
If you need to run the server so that it serves the files from some prefix use the -f/--prefix flag:
tserve --prefix myusername build
That will cause the files to be served from http://localhost:8000/myusername/. (You may need to do this so that the local site matches where your site will be deployed, e.g. GitHub Pages or a university server.)
Stopping the Server
Type control-C at the command line to stop the server.
Why Not Use Python’s Server?
I’ve found I sometimes need to serve files with a prefix on the URL, and I don’t know how to do that with Python’s builtin server.
Metadata
Release files for tservice 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tservice-1.0.0.zip | 10.7 kB | Without provenance | Details for tservice-1.0.0.zip | |
| tservice-1.0.0.tar.gz | 6.7 kB | Without provenance | Details for tservice-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tservice-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for tservice-1.0.0-py2.py3-none-any.whl |
Total release size: 22.8 kB
Release files / tservice-1.0.0.zip
| Download URL | tservice-1.0.0.zip |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41f4cb2931824e157d903add3927eb42767eb9258e4da2917f8e3a5a163e76cb
|
|
BLAKE2b-256 checksum How to use checksums |
b8f011c16fc08d7a42a55d1d78e6ee9ad03decb6359fa94edc2215b1f1bb3876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tservice-1.0.0.tar.gz
| Download URL | tservice-1.0.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71033eb88078ab678933ff23a77daab78ac42625b5307732711c2afd38678717
|
|
BLAKE2b-256 checksum How to use checksums |
6310c7efd6b3761e8a63ca2418241906847e4062d7ed8d32714946981902b952
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tservice-1.0.0-py2.py3-none-any.whl
| Download URL | tservice-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7f5dc868859b9bb380d4f842aeaeb7ce603898d797ea6241e9c8009dcf8753e0
|
|
BLAKE2b-256 checksum How to use checksums |
3f3138788006fc245bd4cf75c935fab0b1cd60da151eb1e5abb14a305eeb2fcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tservice 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.