Skip to main content

🚀 Python vibe: Unleash the Magic of AI-Powered Coding Wizardry! 🌟

Project description

vibepython: AI-Powered Interactive Python Code Generator

vibepython is an interactive command-line tool that uses AI to generate executable Python code from user prompts. Powered by OpenAI or alternative providers, it allows you to create, run, and capture code outputs while maintaining a contextual history stored in JSON. Ideal for developers, experimenters, and AI enthusiasts looking for a seamless coding experience.

Features

  • Interactive Prompting: Enter your ideas and receive AI-generated Python code.
  • AI Code Generation: Leverages AI models with prompt history for accurate scripts.
  • Safe Code Execution: Run generated code and capture stdout/stderr outputs.
  • Persistent History: Uses Pydantic models to store interactions in JSON for ongoing context.
  • Customization via Environment Variables: Adjust settings for personalized control.
  • Docker Support: Easy deployment in containerized environments.

Installation

From PyPI

  1. Install the package:
    pip install vibepython
    
  2. Run the tool:
    vibepython
    

From Source

  1. Clone the repository:
    git clone https://github.com/OldTyT/vibepython.git
    
  2. Navigate to the directory:
    cd vibepython
    
  3. Install dependencies:
    pip install -r requirements.txt
    
  4. Launch the application:
    python3 main.py
    

Using Docker

Run the container with this command:

docker run --rm -ti -e HISTORY_PATH=/history/history.json -v my_history:/history ghcr.io/oldtyt/vibepython
  • Set your OpenAI API key via the OPENAI_API_KEY environment variable (required for the 'openai' provider).

Usage

Start the tool and follow the prompts:

  • Enter a prompt (e.g., "Write a function to calculate factorial").
  • The AI generates code based on your input and history.
  • Choose to execute the code (Y/N) and view captured outputs.
  • All interactions are logged to history for context.

To exit, press Ctrl+C.

Environment Variables

Customize the tool using these environment variables:

  • HISTORY_PATH: Path to the JSON history file. Default: history.json.
  • HISTORY_SIZE: Number of past interactions to include in AI context. Default: 7.
  • OPENAI_API_KEY: Required for the 'openai' provider; your OpenAI API key.
  • PROVIDER: AI provider to use. Supports 'gpt4free' (default) and 'openai'.
  • MODEL_NAME: Model to use with the provider. For 'gpt4free': 'gpt-4o'. For 'openai': 'gpt-5-mini'.

Example configuration:

export PROVIDER=openai
export OPENAI_API_KEY=your-api-key
export MODEL_NAME=gpt-5-mini
export HISTORY_SIZE=10
python3 main.py

Dependencies

  • Python 3.10+ (Compatible up to 3.13).
  • Required libraries: openai, pydantic, loguru, and others listed in requirements.txt.

Contributing

Have suggestions? Open an issue or submit a pull request to help improve the project. Contributions are welcome!

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

vibepython-0.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

vibepython-0.0.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file vibepython-0.0.3.tar.gz.

File metadata

  • Download URL: vibepython-0.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vibepython-0.0.3.tar.gz
Algorithm Hash digest
SHA256 40a0344bde3484e1d759a608d1a9eead7cb0e143d1a6d225d8b92fa57581e08a
MD5 014d46a5d06151677ec3d4ff85bd8638
BLAKE2b-256 24aec663434f064ca36ae1d1035a4152e5f6a4a5c6b560461cce8acdf8831aa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibepython-0.0.3.tar.gz:

Publisher: publish.yml on OldTyT/vibepython

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibepython-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: vibepython-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vibepython-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8fb68a128224114631829165e9d3d9160e769ab7f129203cffb1f13defcc7115
MD5 27550bae6b21ab35c200879977e9a3d7
BLAKE2b-256 c8849b15022f586c293efb9a9bc11ad401a576f07c05f9e6be5a0a9e68c3e955

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibepython-0.0.3-py3-none-any.whl:

Publisher: publish.yml on OldTyT/vibepython

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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