Listing Thumbnail

    PyDocStrGen: Context-Aware Python Docstring Generator using GenAI

     Info
    Deployed on AWS
    Automate high quality PEP 257 compliant Python docstring generation with PyDocStrGen. This solution uses Amazon Bedrock Inline Agents to intelligently pull context from READMEs or a Bedrock Knowledge Base. It easily process source code archives from S3 and receive documented files back in the same format.

    Overview

    Open image

    Forgeahead's PyDocStrGen is a customer deployed command-line interface (CLI) tool designed to revolutionize Python code documentation within your existing AWS environment. It leverages advanced AI/ML capabilities through Amazon Bedrock foundation models (e.g.Nova, Anthropic Claude) to intelligently suggest and update PEP 257 compliant docstrings across your Python codebases, ensuring consistency and adherence to specified standards like Google, NumPy and PEP 257. PyDocStrGen goes beyond basic generation, providing context-aware docstrings by utilizing information from your README.md files or Amazon Bedrock Knowledge Base IDs. KEY BENEFITS AND USE CASES: PyDocStrGen acts as an intelligent assistant, helping development teams overcome the common hurdles of writing and maintaining high-quality, consistent, and up-to-date documentation:

    1. Modernize Legacy Code: Introduce high-quality documentation to aging codebases quickly and efficiently.

    2. Enforce Consistency: Ensure uniform documentation styles across development teams, promoting readability and maintainability.

    3. Improve Onboarding: Enhance code readability to significantly reduce the learning curve for engineers.

    4. Achieve Release Readiness: Guarantee documentation coverage for SDKs, public releases and audit compliance requirements.

    5. Automate Research Code Documentation: Automatically document machine learning or research code during early development stages, freeing up valuable developers time. HOW IT WORKS: The solution operates on simple "S3 in, S3 out" model. Provide your source code archives (e.g. .zip, .tar, .tar.gz, .tar.bz2, .tar.xz files) in an S3 bucket and PyDocStrGen processes them, uploading the documented version back to the same S3 bucket and path in the original format. KEY FEATURES:

    6. Context-Aware Docstrings: Generates accurate context-rich docstrings by leveraging your README.md files and other supporting documentation or an Amazon Bedrock Knowledge Base ID.

    7. Secure In-Account Execution: All code processing and execution occurs entirely within your AWS account ensuring no code leaves your cloud perimeter beyond the Bedrock API call.

    8. Flexible Style Adherence: Supports multiple docstring styles, including Google, NumPy, and PEP 257, dynamically applying them based on user input.

    9. Developer-Friendly CLI: Offers a simple, standalone command-line interface (CLI) that requires no complex CI/CD pipeline or third-party tool integration. PyDocStrGen safely parses code to extract classes, methods, parameters and existing docstrings, enriches context using uploaded documentation like README.md, and uses Amazon Bedrock for AI inference to generate and inject high-quality, contextual docstrings back into source files replacing only when improvements are needed. DEPLOYMENT OVERVIEW Deployment is streamlined via an AWS CloudFormation template, orchestrating the launch of a single EC2 instance into your AWS account. This instance comes pre-configured with the PyDocStrGen CLI tool, Python 3.13, AWS SDKs and a pre-configured IAM Role for secure, least-privilege access to necessary AWS services (e.g., S3, Bedrock).

    10. Deployment Options: The standard model is a single EC2 instance in one Availability Zone suitable for its on-demand, batch-processing nature. Multi-AZ or Multi-Region deployments are not applicable as it's a CLI-based single-instance tool. The CloudFormation template supports deployment into either a new VPC or an existing customer-managed VPC and private subnets ensuring no direct internet ingress to core components.

    11. Network Security: A dedicated Security Group denies all inbound traffic. All outbound HTTPS (port 443) traffic to AWS service endpoints (like Amazon Bedrock and Amazon S3) is allowed via a NAT Gateway.

    12. Data Protection: The solution prioritizes data confidentiality. All data in transit between the EC2 instance and AWS services (SSM, Bedrock, S3, CloudWatch) is encrypted using TLS 1.2 or higher. Server-side encryption (SSE-S3 AES-256) is enforced for new S3 buckets. While the root EBS volume is not encrypted by default to offer flexibility, customers can easily enable encryption using AWS default or custom KMS keys. Customer source code is processed entirely within their secure AWS environment with strict controls to prevent unauthorized egress.

    OPERATIONAL EXCELLENCE:

    1. Monitoring: Health is monitored via Amazon CloudWatch which collects application logs (streamed from /var/log/pydocstrgen/app.log) and custom metrics like files processed and Bedrock API latency.
    2. Upgrades & Patching: Software upgrades involve subscribing to new AMI versions and updating the CloudFormation stack. Automated OS patching is recommended via AWS Systems Manager Patch Manager.
    3. Backup & Recovery: The EC2 instance is stateless, allowing recovery by launching a new instance from the CloudFormation template without data loss. Customers are responsible for managing versioning and backups for their source code in S3.

    Highlights

    • Context-Aware Docstring Generation: Leverages your README.md files or Amazon Bedrock knowledge bases to generate accurate, context-rich docstrings for deeper understanding of your codebase.
    • Developer Friendly & Flexible CLI: Offers a simple, standalone command-line interface with dynamic support for Google, NumPy and PEP 257 docstring styles, requiring no complex CI/CD or third-party tools.
    • Secure In-Account Execution: All code processing and data operations occur entirely within your AWS account, ensuring no code leaves your cloud perimeter.

    Details

    Delivery method

    Delivery option
    AWS Marketplace - PyDocStrGen AI Solution with optional VPC deployment

    Latest version

    Operating system
    Ubuntu 24.04

    Deployed on AWS

    Unlock automation with AI agent solutions

    Fast-track AI initiatives with agents, tools, and solutions from AWS Partners.
    AI Agents

    Features and programs

    Financing for AWS Marketplace purchases

    AWS Marketplace now accepts line of credit payments through the PNC Vendor Finance program. This program is available to select AWS customers in the US, excluding NV, NC, ND, TN, & VT.
    Financing for AWS Marketplace purchases

    Pricing

    PyDocStrGen: Context-Aware Python Docstring Generator using GenAI

     Info
    Pricing is based on actual usage, with charges varying according to how much you consume. Subscriptions have no end date and may be canceled any time.
    Additional AWS infrastructure costs may apply. Use the AWS Pricing Calculator  to estimate your infrastructure costs.

    Usage costs (1)

     Info
    Dimension
    Cost/hour
    t3.medium
    $0.00

    Vendor refund policy

    Currently we do not support refunds, but you can cancel your subscription at any time.

    Custom pricing options

    Request a private offer to receive a custom quote.

    How can we make this page better?

    We'd like to hear your feedback and ideas on how to improve this page.
    We'd like to hear your feedback and ideas on how to improve this page.

    Legal

    Vendor terms and conditions

    Upon subscribing to this product, you must acknowledge and agree to the terms and conditions outlined in the vendor's End User License Agreement (EULA) .

    Content disclaimer

    Vendors are responsible for their product descriptions and other product content. AWS does not warrant that vendors' product descriptions or other product content are accurate, complete, reliable, current, or error-free.

    Usage information

     Info

    Delivery details

    AWS Marketplace - PyDocStrGen AI Solution with optional VPC deployment

    Please refer to the deployment guide for detailed description

    CloudFormation Template (CFT)

    AWS CloudFormation templates are JSON or YAML-formatted text files that simplify provisioning and management on AWS. The templates describe the service or application architecture you want to deploy, and AWS CloudFormation uses those templates to provision and configure the required services (such as Amazon EC2 instances or Amazon RDS DB instances). The deployed application and associated resources are called a "stack."

    Version release notes

    Second Release

    Additional details

    Usage instructions

    Deploy & Use PyDocStrGen

    PyDocStrGen is easy to deploy and use. Follow these steps to get started in your AWS account:

    Step 1: Subscribe on AWS Marketplace Go to the PyDocStrGen Marketplace listing. Click "Continue to Subscribe", review, and accept terms. Then "Continue to Configuration", select "CloudFormation", choose your preferred AWS Region, and "Continue to Launch".

    Step 2: Launch with CloudFormation You'll be redirected to the CloudFormation console. Provide a Stack name (e.g., pydocstrgen-stack). In "Parameters", configure:

    1. Network: Create new VPC or use existing (VPC/private subnet IDs).
    2. Storage: Create new S3 bucket or use existing (S3BucketName).
    3. Compute: AMIId pre-filled. Optionally set InstanceType, RootVolumeSize, InstanceName, KeyPairName.
    4. Tagging: Optional Application & CostCenter tags. Review, acknowledge IAM resources, then click "Create stack".

    Step 3: Wait for Deployment CloudFormation sets up resources (5-7 mins). Monitor status until CREATE_COMPLETE.

    Step 4: Access Your EC2 Instance Access PyDocStrGen via SSM Session Manager. Go to EC2 Console, find your instance (e.g., PyDocStrGen-Instance), select it, click "Connect", choose "Session Manager", then "Connect". A terminal tab opens.

    Step 5: Run Your First Command Verify installation: pydocstrgen --help. PyDocStrGen uses an S3 in/out model. Upload your zipped Python code (e.g., .zip) to your configured S3 bucket. Run: pydocstrgen --s3-url s3://your-bucket-name/your-code.zip --docstr-style google (Replace URL). Options: docstr-style, kb-id, local-path. Tool processes and uploads updated code back to S3.

    Configuration & Bedrock Access PyDocStrGen uses inline agents with AWS Bedrock foundation models. Your model choice significantly impacts quality, processing time, & cost.

    Config file: /etc/default/pydocstrgen.json. Key settings:

    log_level: Sets log verbosity. bedrock: Configures Bedrock integration. model_inference_profile_id: This crucial LLM setting (e.g., us.anthropic.claude-3-5-haiku-20241022-v1:0). Find others in AWS Bedrock documentation. Important: Before use, ensure you have access to your chosen model. Some models require manual access via the Amazon Bedrock console. region_name: AWS region for Bedrock. PyDocStrGen is extensively tested with Claude 3.5 Haiku, though it supports other recent models.

    For more comprehensive steps, config, or troubleshooting, see the PyDocStrGen Deployment Guide.

    Support

    Vendor support

    Have a question or want to speak to one of our experts?

    Contact Forgeahead at:

    Website: https://forgeahead.io/contact-us/  Email: support-pydocstrgen@forgeahead.io 

    AWS infrastructure support

    AWS Support is a one-on-one, fast-response support channel that is staffed 24x7x365 with experienced and technical support engineers. The service helps customers of all sizes and technical abilities to successfully utilize the products and features provided by Amazon Web Services.

    Customer reviews

    Ratings and reviews

     Info
    0 ratings
    5 star
    4 star
    3 star
    2 star
    1 star
    0%
    0%
    0%
    0%
    0%
    0 AWS reviews
    No customer reviews yet
    Be the first to review this product . We've partnered with PeerSpot to gather customer feedback. You can share your experience by writing or recording a review, or scheduling a call with a PeerSpot analyst.