Skip to main content

Masonite IDE Helper

Masonite IDE Helper is a utility for generating Python type hinting stub files (.pyi) for Masonite ORM models. It automates the process of extracting relevant information such as class names, properties, and methods with their return types from model files.

Installation

You can install the Masonite IDE Helper via pip:

pip install masonite-ide-helper

Usage

To use the Masonite IDE Helper, follow these steps:

  1. Import the library:

    from masonite_ide_helper import IdeHelper
    
  2. Instantiate the IdeHelper class:

    ide_helper = IdeHelper(models_dir="path/to/models")
    

    If the models_dir parameter is not provided, it defaults to the "application/models" directory.

  3. Call the make_pyi_files method:

    ide_helper.make_pyi_files()
    

    This will generate .pyi files for the models located in the specified directory.

Example

from masonite_ide_helper import IdeHelper

# Instantiate IdeHelper with optional models directory parameter
ide_helper = IdeHelper(models_dir="path/to/models")

# Generate .pyi files for the models
ide_helper.make_pyi_files()

Documentation

IdeHelper class

__init__(self, models_dir: str | None = None)

Initializes an instance of IdeHelper.

  • models_dir (str | None): The directory path containing the model files. If not provided, defaults to the "application/models" directory.

make_pyi_files(self)

Generates Python type hinting stub files (.pyi) for the models located in the specified directory.

get_models(self)

Retrieves the list of model files from the specified directory and extracts relevant information such as class name, module path, properties, and methods with their return types.

Notes

  • This library assumes a standard Masonite project structure where models reside in the "application/models" directory. If your project structure differs, you may need to adjust the models_dir parameter accordingly.
  • If any error occurs during the generation of stubs for a model, the error message will be printed, and the process will continue for other models.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contribution

Contributions are welcome! If you find any issues or want to improve the library, feel free to open a pull request or create an issue in the repository.

Metadata

Release files for masonite-ide-helper 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 masonite-ide-helper 0.1.0
File Size Uploaded Provenance Actions
masonite-ide-helper-0.1.0.tar.gz 7.9 kB Without provenance Details for masonite-ide-helper-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for masonite-ide-helper 0.1.0
File Interpreter ABI Platform Actions
masonite_ide_helper-0.1.0-py3-none-any.whl Python 3 none any Details for masonite_ide_helper-0.1.0-py3-none-any.whl

Total release size: 16.2 kB

Release files / masonite-ide-helper-0.1.0.tar.gz

Download URL masonite-ide-helper-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8e2718b4fb4e76fae0882855b7f02c9ed0829e3f2d88f9318d79149cd10ae830
BLAKE2b-256 checksum
How to use checksums
dac3f7dedd81b288c6eab05ee2fde0c66ad5b841e8024aed8a41b8238390289b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

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

Download URL masonite_ide_helper-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd61679da3a963f1b3b3d6398a1c7ff9db922d966e3908df26b5970751bb8ba5
BLAKE2b-256 checksum
How to use checksums
31de3a8151a78ba01a851b347b7494227866c058d8d06a818ad77b23048b6bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Security for masonite-ide-helper 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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