Skip to main content

A tool to generate OpenAPI specifications using natural language

Project description

Spec-Pilot

Spec-Pilot is a command-line tool and Python package that helps generate, modify, and validate OpenAPI specifications using natural language processing (NLP). It simplifies the creation and management of OpenAPI projects, making it more accessible to developers and non-developers alike.

Features

  • Initialize new OpenAPI projects
  • Generate OpenAPI specifications
  • Modify OpenAPI specifications using natural language
  • Validate OpenAPI specifications
  • Create OpenAPI assets from templates

Installation

You can install Spec-Pilot using pip:

pip install spec_pilot

After installing Spec-Pilot, you also need to download the spaCy language model:

python -m spacy download en_core_web_sm

CLI Usage

To use Spec-Pilot as a command-line tool, run the following commands:

  • Initialize a new OpenAPI project:
spec_pilot --init project_name
  • Generate the OpenAPI specification for a specific project:
spec_pilot --generate project_name
  • Modify an existing OpenAPI specification using natural language:
spec_pilot --nlp "Add a new endpoint called 'get_users' with a GET method"
  • Validate an OpenAPI specification file:
spec_pilot --validate spec_file
  • Create a new OpenAPI asset from a template:
spec_pilot --create template asset_name output_path

Python Package Usage

You can also use Spec-Pilot as a Python package in your projects. Here's an example of how to use it:

from spec_pilot import init_project, generate_openapi_spec, process_natural_language_input, vacuum, render_template

# Initialize a new OpenAPI project
init_project("project_name")

# Generate the OpenAPI specification for a specific project
generate_openapi_spec("project_name")

# Modify an existing OpenAPI specification using natural language
modified_openapi_spec = process_natural_language_input("Add a new endpoint called 'get_users' with a GET method", openapi_spec)

# Validate an OpenAPI specification file
vacuum(["validate", "spec_file"])

# Create a new OpenAPI asset from a template
render_template("template", "asset_name", "output_path")

Limitations of NLP Functionality

Spec-Pilot's NLP functionality is currently limited and may not understand all possible natural language inputs. It can handle basic operations such as adding, updating, and removing endpoints, methods, and parameters. However, it might not handle complex operations or understand all possible variations of natural language expressions.

Roadmap

To improve the NLP functionality and make Spec-Pilot more complete, we plan to:

  1. Expand the range of natural language expressions that can be understood by the tool.
  2. Add support for more complex operations, such as modifying response schemas and security settings.
  3. Enhance error handling and provide better feedback to users when their input cannot be understood or processed.
  4. Integrate with more advanced NLP libraries or services to improve the overall performance and accuracy of the tool.

We encourage users to provide feedback and contribute to the development of Spec-Pilot to make it more robust and feature-rich.

License

Spec-Pilot is released under the GNU General Public License v3.0.

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

spec_pilot-0.2.0.tar.gz (18.5 kB view hashes)

Uploaded Source

Built Distribution

spec_pilot-0.2.0-py3-none-any.whl (19.5 kB view hashes)

Uploaded Python 3

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