Skip to main content

secure module interface

Project description

secmod

A simple module proxy for python. Avoids importing the module but gives an interface like ModuleType.

This useful when you want to examine the contents of the module without executing it. For example so safe the docstring or code in a database.

Install

pip install secmod

or install it from github

pip install git+https://github.com/cloasdata/secmod.git

or just clone it

usage

from pathlib import Path
from secmod import ModuleProxy

fp_module = Path("some_module.py")
module = ModuleProxy(fp_module)

print(module.__doc__)

Copyright © 2022 Simon Bauer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secmod-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secmod-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file secmod-0.1.0.tar.gz.

File metadata

  • Download URL: secmod-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for secmod-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bafc3d5117d7ce67b84d1ba4dbecf0dc8ebe1fe4f7bd471b947dd4c09a128242
MD5 77e40f8a4e56a7c55cac6f9c85cafc6f
BLAKE2b-256 e4a4a5a2c095e43fbb1e52a9679f233e11bfc3b140301a4142487dd667224a28

See more details on using hashes here.

File details

Details for the file secmod-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: secmod-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for secmod-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08f6c2548c13260e70777844bce2ffd3112611f90492dad793b4eaf34de86238
MD5 fa93f363162f1d3b190fdd2a2cf97e63
BLAKE2b-256 662fd479af6e3c6b69dd0ce18979125dadcd6e5b76d80060f38ec6650fb0c1c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page