Skip to main content

parrot is a simple HTTP server that responds to any valid GET request with the file specified on the command line.

It is useful during testing (e.g. to mock out a server application), or to do client testing. Both text and binary files are handlded correctly.

Its only dependency is the excellent python-magic library for mime type guessing. It works on Python 3.

$ pip install python-parrot

Usage

$ parrot port filename

The following arguments are required:

  • port: Port to listen on

  • filename: Filename of the data to send in response to all requests

Sample

Start the parrot server:

$ echo 'This is a test' > test.txt
$ parrot 8000 test.txt
parrot/1.0.0 listening on 0.0.0.0:8000 with file test.txt (text/plain)

In another terminal (assuming 10.1.1.1 is a valid IP on the server):

$ echo 'GET /anything HTTP/1.0' | nc 10.1.1.1 8000
HTTP/1.0 200 OK
Server: parrot/1.0.0 Python/3.4.2
Date: Thu, 24 Sep 2015 00:27:56 GMT
Content-Type: text/plain

This is a test

Metadata

Release files for python-parrot 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-parrot 1.0.2
File Size Uploaded Provenance Actions
python-parrot-1.0.2.tar.gz 2.2 kB Without provenance Details for python-parrot-1.0.2.tar.gz

Release files / python-parrot-1.0.2.tar.gz

Download URL python-parrot-1.0.2.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e1b1e08a323ade03fe533ee6703ef3096909cba5e2479d64ba7b616b1b95b2d2
BLAKE2b-256 checksum
How to use checksums
49519b67c5ebcf72aba400932e6446c3c1b4cb7b7cfaaac8ad94643ed30cddef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for python-parrot 1.0.2

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.

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page