Skip to main content

A Python library to generate professional TIPE simulations using the Gemini API.

Project description

TIPE SIM

A Python library to generate professional, topic-aware simulations for TIPE projects using the power of the Gemini API.

Features

  • AI-Powered: Simply provide your TIPE topic (sujet).
  • Intelligent Design: The AI analyzes your topic and chooses the best visualization tools (graphs, 2D/3D canvas, etc.).
  • Professional Dashboards: Generates a single, complete HTML file with a modern dashboard layout.
  • Academically Rigorous: Includes real-time data, user controls, and correctly rendered mathematical explanations.

Installation

You can install the library using pip:

pip install tipe-sim

Usage
Here is an example of how a user can run your library. They can save this code as a Python file (e.g., run_simulation.py) and execute it from their terminal.

# test_simulation.py
# An interactive script to test your tipe_sim library.

from tipe_sim import tsim
import os

def main():
    """Main function to run the interactive test."""
    
    print("--- TIPE Simulation Generator ---")
    
    # 1. Get API Key from environment variables.
    api_key = os.environ.get("GEMINI_API_KEY")
    if not api_key:
        print("\nERROR: The GEMINI_API_KEY environment variable is not set!")
        print("Please set it before running the script.")
        return # Exit the script

    # 2. Get the TIPE topic from the user interactively.
    print("\nPlease enter your TIPE topic (sujet):")
    my_sujet = input("> ")

    if not my_sujet:
        print("Topic cannot be empty. Exiting.")
        return

    # 3. Ask the user for a filename.
    print("\nEnter a filename for the output simulation (e.g., my_simulation.html):")
    output_filename = input("> ")
    if not output_filename.endswith('.html'):
        output_filename += '.html'

    # 4. Generate the simulation.
    print(f"\nGenerating simulation for: '{my_sujet}'...")
    try:
        html_content = tsim(sujet=my_sujet, api_key=api_key, output_path=output_filename)
        
        if html_content:
            print(f"\n✅ Simulation generated successfully!")
            print(f"File saved to: {os.path.abspath(output_filename)}")
        else:
            print("\n❌ Simulation generation failed. Please check the error messages above.")

    except Exception as e:
        print(f"\nAn unexpected error occurred: {e}")

if __name__ == "__main__":
    main()

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

tipe_sim-1.2.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

tipe_sim-1.2.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file tipe_sim-1.2.1.tar.gz.

File metadata

  • Download URL: tipe_sim-1.2.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for tipe_sim-1.2.1.tar.gz
Algorithm Hash digest
SHA256 e40c6bf85cb3af449313b2ce20a54842829e33334d70146526461d40a9da2b92
MD5 f5b7ee392ed813a7f5ba1ffc8632ad3e
BLAKE2b-256 b53e1c0b59f14f0cf3a5d297be5aa71e69336231c1af9e52a39e6d70eebd29f8

See more details on using hashes here.

File details

Details for the file tipe_sim-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: tipe_sim-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for tipe_sim-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b12339c43c940694d60b3a27de760cfeabbba48def7f79764b30549db1bbc498
MD5 0511db2c838925832c41b7f5017e32cb
BLAKE2b-256 8cce33ae4a69c082c3fcb7c1708d151e74544a97427e66b7e312d381ad0a12f4

See more details on using hashes here.

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