Skip to main content

Explore Python modules deeper than dir()

Project description

get_module_underlying

Explore Python modules deeper than dir().

Installation

pip install get_module_underlying

Usage

from get_module_underlying import ModuleExplorer

# Explore a module
explorer = ModuleExplorer('sys')

# Get all attributes (excluding __xxx__)
print(explorer.get_all_attrs())

# Get only public attributes
print(explorer.get_public_attrs())

# Get private attributes (single underscore)
print(explorer.get_private_attrs())

# Get dunder attributes (__xxx__)
print(explorer.get_dunder_attrs())

# Get callable methods/functions
print(explorer.get_callable_attrs())

# Get non-callable attributes (variables, constants)
print(explorer.get_non_callable_attrs())

# Get attributes with their values
print(explorer.get_attrs_with_values())

# Get attributes with their types
print(explorer.get_attrs_with_types())

# Get all classes
print(explorer.get_classes())

# Get all functions
print(explorer.get_functions())

# Get all builtins
print(explorer.get_builtins())

# Get all submodules
print(explorer.get_modules())

# Get detailed module info
print(explorer.get_module_info())

# Get statistics summary
print(explorer.get_stats())

# Get Python system info
print(explorer.get_sys_info())

# Get module file info
print(explorer.get_file_info())

# Get everything at once
print(explorer.get_everything())

Methods Reference

Method Return Type Description
get_all_attrs() {'valid': bool, 'data': list} All attributes except dunder (__xxx__)
get_public_attrs() {'valid': bool, 'data': list} Attributes not starting with _
get_private_attrs() {'valid': bool, 'data': list} Attributes with single _ prefix
get_dunder_attrs() {'valid': bool, 'data': list} Dunder attributes (__xxx__)
get_callable_attrs() {'valid': bool, 'data': list} Callable functions/methods
get_non_callable_attrs() {'valid': bool, 'data': list} Non-callable variables/constants
get_attrs_with_values() {'valid': bool, 'data': dict} Attribute names with their values
get_attrs_with_types() {'valid': bool, 'data': dict} Attribute names with their types
get_classes() {'valid': bool, 'data': list} All classes in the module
get_functions() {'valid': bool, 'data': list} All functions in the module
get_builtins() {'valid': bool, 'data': list} All built-in functions
get_modules() {'valid': bool, 'data': list} All submodules imported
get_module_info() {'valid': bool, 'data': dict} Module metadata (name, file, doc, etc.)
get_stats() {'valid': bool, 'data': dict} Statistical summary of all attributes
get_sys_info() {'valid': bool, 'data': dict} Python system information
get_file_info() {'valid': bool, 'data': dict} Module source file information
get_everything() {'valid': bool, 'data': dict} All information combined

Return Format

All methods return a dictionary with the following structure:

{
    'valid': True,          # bool: True if module is valid, False otherwise
    'data': ...             # The actual data (list or dict)
}

If the module is not valid, the method will:

  • Emit a ValidNotTrueWarning warning
  • Return {'valid': False}

Dependencies

  • Python 3.6+
  • absence library (automatically installed)

License

MIT

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

get_module_underlying-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

get_module_underlying-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: get_module_underlying-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/43.0 requests/2.32.4 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.68.4 importlib-metadata/8.5.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.5

File hashes

Hashes for get_module_underlying-0.0.1.tar.gz
Algorithm Hash digest
SHA256 29e3a5815cc3b7f45806c0897a9ff1ca06393276bfbafdd266d53684e64fa65f
MD5 e71716a906650e5fc995b530ee7619d3
BLAKE2b-256 6c078284a2a49ea848d9a770cbf3c164485c4c1b797228c84f3beea241f267b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: get_module_underlying-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/43.0 requests/2.32.4 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.68.4 importlib-metadata/8.5.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.8.5

File hashes

Hashes for get_module_underlying-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4da5a48e55d4c24372bb17c49a99b94cd0c2f3a30553ab70e4963c4e9463c0db
MD5 e7378acb318689a6a7e1e36e1f903ba5
BLAKE2b-256 cf325c37072a850c5adb7f070808d952bd921dd0475c96d1e748e5ca4597d732

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