Skip to main content

newmount

CI CodeQL OpenSSF Scorecard PyPI License: 0BSD

Dependency-free ctypes bindings for the Linux mount API: the classic mount(2)/umount2(2) calls, and the new mount API (kernel 5.2+) built on fsopen, fsconfig, fsmount, open_tree, move_mount, fspick and mount_setattr.

Requires Python 3.10+ and Linux. Mounting needs CAP_SYS_ADMIN; an unprivileged process gets there inside a user+mount namespace (unshare -Urm).

Install

pip install newmount

Example: classic bind mount

import newmount

# bind recursively, then remount read-only
newmount.bind("/srv/data", "/mnt/data", readonly=True)

Example: clone, reconfigure and attach with the new API

import newmount

# clone the tree, flip the clone read-only, attach it
with newmount.open_tree_clone("/srv/data") as tree:
    tree.apply_attrs(set=newmount.MOUNT_ATTR_RDONLY)
    tree.attach("/mnt/data")

# or build a fresh filesystem from scratch
with newmount.FsContext("tmpfs") as ctx:
    ctx.set("size", "16m")
    ctx.create()
    with ctx.mount() as mnt:
        mnt.attach("/mnt/scratch")

Development

uv sync --group dev
make check

License: 0BSD. Quad4 Software, https://quad4.io

Metadata

Release files for newmount 0.1.0

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

Source distribution (sdist)

Source distribution for newmount 0.1.0
File Size Uploaded
newmount-0.1.0.tar.gz 72.1 kB Details

Built distribution (wheel)

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

Total release size: 85.1 kB

Release files / newmount-0.1.0.tar.gz

Download URL newmount-0.1.0.tar.gz
Size 72.1 kB
Tags Source
SHA-256 checksum
How to use checksums
53ad54182c5dc8dc88d42c99081ce2d150331b9910a0c898c5d0fd3a36571edd
BLAKE2b-256 checksum
How to use checksums
f93e83b5d48e671bf10afdc080f683612e7cec61026143dcc92f16bb6c24ef48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 22, 2026.

Transparency log

Release files / newmount-0.1.0-py3-none-any.whl

Download URL newmount-0.1.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4909fd873d0626afa91b1f553c6ecdd336bde342064dcfa39d51d466b90edbbf
BLAKE2b-256 checksum
How to use checksums
58dbf4617700a1637d196b91ce93e6849efbe50b0f5ff8476ce3e979856c6ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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