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
Generate and save your OpenAPI components using the corresponding functions
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:
- Expand the range of natural language expressions that can be understood by the tool.
- Add support for more complex operations, such as modifying response schemas and security settings.
- Enhance error handling and provide better feedback to users when their input cannot be understood or processed.
- 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
Built Distribution
File details
Details for the file spec_pilot-0.2.1.tar.gz
.
File metadata
- Download URL: spec_pilot-0.2.1.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 269ed8744d32246416246158260e48852b525bf6efc3f584b3d14d76e883ad0c |
|
MD5 | f4f48ffae7b4055486cb0d15e64c4129 |
|
BLAKE2b-256 | f784be6523ce8972eb8c2842d97320e5bb931d4d2ba8aaadc7cb837102d59707 |
File details
Details for the file spec_pilot-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: spec_pilot-0.2.1-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba1bbb62efbaf84414c0267f4ce565a63149277020fd7380796da4a24e6dc01f |
|
MD5 | 74f99f74fcbc2eb379c9876390f8d5e6 |
|
BLAKE2b-256 | 374db7eccd19099a122ef9b33a90859da804876315928d7522ce2e5c7a9e9c1e |