mount
=====
|pythonver|
|license|
|black|
|lint|
|mypy|
Simple python wrapper around ``sys/mount.h``'s ``mount`` and ``umount2`` libc functions.
Installation
------------
This package is available on PyPI, so it can be installed with `pip` or
another regular package manager you use:
.. code:: sh
python3 -m pip install mount
Usage
-----
This library is a tiny wrapper around ``mount`` and ``umount2`` functions, so
most information about them you can find in ``man 2 mount`` and ``man 2 umount``.
Generally there are only 4 objects provided by this package:
- ``mount.mount`` function that is wrapper around ``mount`` libc function.
- ``mount.umount`` function that is wrapper around ``umount2`` libc function.
- ``mount.MountFlag`` enum with available mount flags.
- ``mount.UmountFlag`` enum with available umount flags.
``mount`` and ``umount`` functions raises ``OSError`` on errors.
Here is a simple script that will mount in-memory 1G temporary filesystem
with `NOEXEC` and `NOSYMFOLLOW` flags in temporary created directory:
.. code:: python
from tempfile import TemporaryDirectory
from mount import mount, MountFlag
if __name__ == "__main__":
target = TemporaryDirectory()
mount("tmpfs", target.name, "tmpfs", MountFlag.NOEXEC | MountFlag.NOSYMFOLLOW, "size=1G")
print("Mounted to: ", target)
.. |lint| image:: https://github.com/TitaniumHocker/mount/workflows/lint/badge.svg
.. |mypy| image:: https://github.com/TitaniumHocker/mount/workflows/mypy/badge.svg
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
.. |pythonver| image:: https://img.shields.io/pypi/pyversions/mount
:alt: PyPI - Python Version
.. |license| image:: https://img.shields.io/pypi/l/mount
:alt: PyPI - License
Raw data
{
"_id": null,
"home_page": "https://github.com/titaniumhocker/mount",
"name": "mount",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Ivan Fedorov",
"author_email": "inbox@titaniumhocker.ru",
"download_url": "https://files.pythonhosted.org/packages/2b/1d/573e15d724b3a8dedec8ef07d48df03c0283a903c4bfcb18e2e42c0b53c3/mount-1.0.0.tar.gz",
"platform": null,
"description": "mount\n=====\n\n|pythonver|\n|license|\n|black|\n\n|lint|\n|mypy|\n\n\nSimple python wrapper around ``sys/mount.h``'s ``mount`` and ``umount2`` libc functions.\n\n\nInstallation\n------------\n\nThis package is available on PyPI, so it can be installed with `pip` or\nanother regular package manager you use:\n\n.. code:: sh\n\n python3 -m pip install mount\n\n\nUsage\n-----\n\nThis library is a tiny wrapper around ``mount`` and ``umount2`` functions, so\nmost information about them you can find in ``man 2 mount`` and ``man 2 umount``.\n\nGenerally there are only 4 objects provided by this package:\n\n- ``mount.mount`` function that is wrapper around ``mount`` libc function.\n- ``mount.umount`` function that is wrapper around ``umount2`` libc function.\n- ``mount.MountFlag`` enum with available mount flags.\n- ``mount.UmountFlag`` enum with available umount flags.\n\n``mount`` and ``umount`` functions raises ``OSError`` on errors.\n\nHere is a simple script that will mount in-memory 1G temporary filesystem\nwith `NOEXEC` and `NOSYMFOLLOW` flags in temporary created directory:\n\n.. code:: python\n\n from tempfile import TemporaryDirectory\n from mount import mount, MountFlag\n\n\n if __name__ == \"__main__\":\n target = TemporaryDirectory()\n mount(\"tmpfs\", target.name, \"tmpfs\", MountFlag.NOEXEC | MountFlag.NOSYMFOLLOW, \"size=1G\")\n print(\"Mounted to: \", target)\n\n\n.. |lint| image:: https://github.com/TitaniumHocker/mount/workflows/lint/badge.svg\n\n.. |mypy| image:: https://github.com/TitaniumHocker/mount/workflows/mypy/badge.svg\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n\n.. |pythonver| image:: https://img.shields.io/pypi/pyversions/mount\n :alt: PyPI - Python Version\n\n.. |license| image:: https://img.shields.io/pypi/l/mount\n :alt: PyPI - License\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Wrapper around sys/mount.h",
"version": "1.0.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "521bb0c4b0ebb3a8f0673b3596befd820836a2529f8495d5fa99455708782c6b",
"md5": "3389017f5fe225b4d02701f3b6971db6",
"sha256": "ed87c97be0e49afc04f7e973fc7dfb23155f7865eaac312db4b47bc1fada9f39"
},
"downloads": -1,
"filename": "mount-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3389017f5fe225b4d02701f3b6971db6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 6110,
"upload_time": "2023-04-14T21:35:45",
"upload_time_iso_8601": "2023-04-14T21:35:45.312262Z",
"url": "https://files.pythonhosted.org/packages/52/1b/b0c4b0ebb3a8f0673b3596befd820836a2529f8495d5fa99455708782c6b/mount-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2b1d573e15d724b3a8dedec8ef07d48df03c0283a903c4bfcb18e2e42c0b53c3",
"md5": "522ee3a0550e08895bd3dc8cb9a0fade",
"sha256": "4510eaf4282a9634ace9982705da7c70857d1b09f73f589118f5a0c648e71ece"
},
"downloads": -1,
"filename": "mount-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "522ee3a0550e08895bd3dc8cb9a0fade",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 5315,
"upload_time": "2023-04-14T21:35:47",
"upload_time_iso_8601": "2023-04-14T21:35:47.119370Z",
"url": "https://files.pythonhosted.org/packages/2b/1d/573e15d724b3a8dedec8ef07d48df03c0283a903c4bfcb18e2e42c0b53c3/mount-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-14 21:35:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "titaniumhocker",
"github_project": "mount",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mount"
}