Skip to main content

A decorator that inspects functions. Logs function name, args and kwargs.

Project description

inspector_mils

CodeFactor travis codecov python3.6 python3.6 python3.6

Inspect functions' arguments and keywords arguments at runtime using decorator.

Installation

To download inspector-mils, either fork this github repo or simply use Pypi via pip

pip install inspector-mils

Usage

Import inspect decorator.

from inspector_mils.inspector import inspect

Add @inspect to your function.

@inspect
def my_func_sample1(a, b):
  pass

my_func_sample1("param1", "param2")

Output

[2022-11-04 02:42:45.151303] Starting inspect..
[2022-11-04 02:42:45.151888] my_func_sample1() called..
[2022-11-04 02:42:45.151937] args: ('param1', 'param2')
[2022-11-04 02:42:45.151978] kwargs: {}
[2022-11-04 02:42:45.152060] Ending inspect..

License

MIT License

Copyright (c) 2022

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

inspector_mils-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

inspector_mils-0.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file inspector_mils-0.0.1.tar.gz.

File metadata

  • Download URL: inspector_mils-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.3

File hashes

Hashes for inspector_mils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 37b7355f15f65393d467a76677ee0626b29b415b8e45acfc8c6df8100e91d0c1
MD5 1787cf2b7c74c98d3bece982584d3e30
BLAKE2b-256 876ab483d8960a3370d8a25b3730b35311bd8ab0135d017bf7c888ee5c6985e2

See more details on using hashes here.

File details

Details for the file inspector_mils-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for inspector_mils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 89a463d927390ce35257d2612d1633420d92010cbc920eae665e22d27ebed562
MD5 9894949dc0f765177f92a58b24a715e6
BLAKE2b-256 8c2b6f47c678f65213cd0254504949e9f76d68c77b90a04b2374251c89373563

See more details on using hashes here.

Supported by

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