Skip to main content

License: MIT CodeQL Documentation Status

Simple Data Exchange server over HTTP

Overview

This package provides a function to launch a simple file server. Getting, putting, and deleting files on the server via the HTTP POST methods are available. The function setup_sidex() returns a flask instance. You can launch a simple file server by run().

from sidex import setup_sidex

target = '/path/to/directory'
app = setup_sidex(target)
app.run()

Otherwise, you can directly call sidex.server.

$ python -m sidex.server /path/to/directory

By default, only retrieving files (get) is available. The put and delete methods are enabled by setting a 'token' for each method. Of course, the get function can be restricted by a token.

The HTTP POST method is available to submit a request. Any request should contain the method field, which should be one of get, put, and delete. The token field may be required in some cases. The followings are samples with curl.

$ curl http://0.0.0.0:8080/path/to/file -F 'method=get'
$ curl http://0.0.0.0:8080/path/to/upload -F 'method=put' -F 'payload=@filename' -F 'token=foo'
$ curl http://0.0.0.0:8080/path/to/delete -F 'method=delete' -F 'token=bar'

The package provides a function, sidex_request(), which is a wrapper function of requests.post(). You can directly execute sidex.client.

$ python -m sidex.client http://0.0.0.0:8080/path/to/file
$ python -m sidex.client http://0.0.0.0:8080/path/to/file --ping
$ python -m sidex.client http://0.0.0.0:8080/path/to/upload -f upload_file
$ python -m sidex.client http://0.0.0.0:8080/path/to/delete -d

Dependencies

The library is developed on Python 3.9.9. The following packages are required:

flask>=2.0
requests>=2.27

Metadata

Release files for sidex 1.5.1

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

Source distribution (sdist)

Source distribution for sidex 1.5.1
File Size Uploaded Provenance
sidex-1.5.1.tar.gz 9.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sidex 1.5.1
File Interpreter ABI Platform
sidex-1.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / sidex-1.5.1.tar.gz

Download URL sidex-1.5.1.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6b44322d904fa070833e10ae1442f1321b925c987528cd4c69e1b3f32f2fdae5
BLAKE2b-256 checksum
How to use checksums
8cda62010aeced6b06d34976c9609b2895d6b8ff7530173d9cf88b5d17cf14a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / sidex-1.5.1-py3-none-any.whl

Download URL sidex-1.5.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa4eac4f017b28c1af31e6baad5ebed68c684d79b87b56fcccc84b7821d53a7a
BLAKE2b-256 checksum
How to use checksums
90f30f4b1feacaef033156bfd8416688487b10075ddfe8a850fa1267e087cbc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for sidex 1.5.1

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.

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