hfsapi
English | 中文
Python API client for HFS (HTTP File Server): login, file listing, upload, config, and permissions.
Install
Global CLI (recommended) — install so the hfs command is available everywhere:
uv tool install hfsapi
# or (system / user level)
pip install hfsapi
As a project dependency (e.g. for import hfsapi in your code):
pip install hfsapi
# or in a uv-managed project
uv add hfsapi
From source:
uv sync
# or
pip install -e .
Quick start
from hfsapi import HFSClient, entry_size, entry_created, entry_modified
with HFSClient("http://127.0.0.1:8280", username="abct", password="abc123") as client:
data = client.get_file_list(uri="/data")
for e in data.get("list", []):
print(e["n"], entry_size(e), entry_created(e), entry_modified(e))
# Create folder (same as “New folder” in the web UI)
client.create_folder("data", "myfolder")
# Upload
client.upload_file("data", b"content", filename="hello.txt", use_put=True)
CLI
After installing (e.g. uv tool install hfsapi or pip install hfsapi), the hfs command is available. Log in once to save credentials locally; all other commands then use them (or pass --base-url if not logged in).
hfs login --base-url http://127.0.0.1:8280 -u abct -p abc123
hfs list /data
hfs upload ./local.txt --folder data
hfs upload ./mydir --folder data # folder: upload contents into --folder (rclone-style)
hfs upload ./file.txt -f data -u -p # -u print link after upload (resolves server-renamed name), -p progress
hfs mkdir data/myfolder
hfs download data/foo.txt -o ./foo.txt
hfs delete data/foo.txt
hfs config get
hfs vfs
hfs info
hfs logout
Path or URL: For list, upload --folder, download, mkdir, and delete, you can pass either a path (e.g. data/foo.txt) or a full URL (e.g. http://127.0.0.1:8280/data/foo.txt). A URL is parsed to use that server and path for that command.
See hfs --help and hfs <command> --help for options.
Core API
| Method / function | Description |
|---|---|
| HFSClient(base_url, username, password, timeout) | Client; use with or call close() when done. |
| login() | Establish session via URL params (alternative or complement to Basic auth). |
| get_file_list(uri, offset, limit, search, request_c_and_m) | Get directory listing, current user permissions, and entry metadata. |
| list_entries(uri, ...) | Returns only the list array from get_file_list. |
| upload_file(folder, file_content, filename, use_put, put_params, use_session_for_put) | Upload a file to the given folder. |
| upload_folder(parent_folder, local_path, on_file_progress, on_progress) | Recursively upload directory contents (rclone-style). |
| get_resource_url(path, human_readable) / get_uploaded_file_url(folder, filename, response) | Build URL for a path; resolve real filename after upload (e.g. when server renames). |
| create_folder(parent_folder, new_name, use_put) | Create a new folder under the parent (same as “New folder” in the web UI). |
| delete_file(folder, filename) | Delete a file under the given folder. |
| get_config(only, omit) / set_config(values) | Read/write HFS config; e.g. VFS and permissions. |
| get_vfs() | Get current VFS tree (including permission structure). |
| entry_size(e) / entry_created(e) / entry_modified(e) / entry_permissions(e) | Helpers for list entry metadata and permission abbreviations. |
In list responses: n = name, s = size, c/m = created/modified time; can_archive, can_upload, can_delete, etc. indicate the current user’s permissions for that directory.
More details (permission mapping, testing, publishing, upload options and roots) in HELP.md.
Legal: DISCLAIMER.md — no warranty, no liability, use at your own risk.
Metadata
Release files for hfsapi 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hfsapi-0.1.10.tar.gz | 27.8 kB | With provenance | Details for hfsapi-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hfsapi-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for hfsapi-0.1.10-py3-none-any.whl |
Total release size: 45.5 kB
Release files / hfsapi-0.1.10.tar.gz
| Download URL | hfsapi-0.1.10.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54a13fa141466f80003cf81cac76451b5b81a8299e910c3c32ab16469412f5e0
|
|
BLAKE2b-256 checksum How to use checksums |
d933ff7124426624911ac470cefd714d31fa750e80cfe47bea327046c4bd53ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 7, 2026.
Transparency logRelease files / hfsapi-0.1.10-py3-none-any.whl
| Download URL | hfsapi-0.1.10-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
442e722c629a8fed53353ab2f8839fd125fcedd0047984ea6545f82be36cfef4
|
|
BLAKE2b-256 checksum How to use checksums |
99019508b236c5ddc5e137461e6993a1ce1cc36c73ad5a6efbdf5cbfad050657
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 7, 2026.
Transparency logSecurity for hfsapi 0.1.10
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for hfsapi-0.1.10.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 7, 2026.
Transparency logA 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.