miniogre


Nameminiogre JSON
Version 0.11.5 PyPI version JSON
download
home_pagehttps://github.com/ogre-run/miniogre
Summaryminiogre: from source code to reproducible environment, in seconds.
upload_time2024-12-10 22:01:53
maintainerNone
docs_urlNone
authorWilder Lopes
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # miniogre

**miniogre** is a command-line tool that helps developers automate the process of setting up reproducible Python environments. It leverages AI to analyze a Python codebase and automatically generate necessary files such as `Dockerfile`, `requirements.txt`, and SBOM (Software Bill of Materials) files.  This simplifies packaging Python applications and significantly reduces the time spent on dependency management.  It can even update your README file to accurately reflect the current state of your project.

![miniogre_gif_33](https://github.com/ogre-run/miniogre/assets/6482944/0850dbb5-6634-4f08-80a9-6fd8e3ca8e03)

## Why miniogre?

Managing software dependencies is a tedious and time-consuming task for developers. This is especially problematic in AI/ML development, where rapidly evolving Python packages often have poor documentation or outdated configuration files.  miniogre addresses this issue by using AI to automate the dependency setup process. This reduces the time spent "dependency hunting" from hours to minutes, allowing developers to focus on writing code instead of wrestling with environments.

## How it Works

miniogre performs the following actions:

1. **Identifies the primary code language:**  miniogre analyzes the project directory. Currently optimized for Python projects.
2. **Reads the README file:** If a README exists, miniogre reads it to gather information about the project.
3. **Crawls the source code:**  The code is analyzed to identify import statements and extract a preliminary list of dependencies.
4. **Refines the requirements:**  miniogre leverages a Large Language Model (LLM) of your choice (OpenAI, Mistral, Groq, or OctoAI) to refine the dependency list and create a `requirements.txt` file.  The LLM helps to resolve complex dependencies and ensure compatibility. 
    * Note: current implementation uses `uv pip compile` to lock requirements, removing the need for an LLM cleaning step for dependency generation.
5. **Generates supporting files:** It generates a `Dockerfile` enabling containerization of your project and an SBOM (`sbom.json`) documenting all project dependencies.
6. **Builds a Docker image (optional):**  miniogre can build a Docker image of the application, facilitating easy deployment and sharing.
7. **Spins up a container (optional):**  miniogre can run the application in a Docker container.

## Requirements

- **Python 3.10 or higher:**  miniogre is written in Python and requires this version. [Download Python](https://www.python.org/downloads/).
- **Docker:**  Containerization platform for consistent environments. [Download Docker](https://docs.docker.com/get-docker/).
- **pipx (recommended) or pip:** Python package installers.  pipx is recommended for isolated installations.  [Download pipx](https://pipxproject.github.io/pipx/installation/).  [Download pip](https://pip.pypa.io/en/stable/installing/).
- **LLM API Key:** You need an API key for at least one of the following LLM providers:
    - **OpenAI:**  Set your API key using `export OPENAI_API_KEY=<YOUR_TOKEN>`.
    - **Mistral AI:** Set your API key using `export MISTRAL_API_KEY=<YOUR_TOKEN>`.
    - **Groq:** Set your API key using `export GROQ_SECRET_ACCESS_KEY=<YOUR_TOKEN>`.
    - **Ogre:** Set your token using `export OGRE_TOKEN=<YOUR_TOKEN>`.

## Installation

Miniogre can be installed using pipx or pip:

- With pipx (recommended): `pipx install miniogre`
- With pip: `pip install miniogre`

You can also build from source using Poetry: `poetry build && pipx install dist/*.whl` (or `pip install dist/*.whl`).  A helper script, `install.sh`, is provided in the repository to simplify this process.


## Usage

1. **Navigate to Project Directory:** Open your terminal and go to the root directory of your Python project.

2. **Run miniogre:** Use the following command to analyze your project and generate the reproducibility artifacts:

   ```bash
   miniogre run
   ```
By default, it will generate the `Dockerfile`, `requirements.txt`, and `sbom.json` in an `ogre_dir` directory, build a Docker image named `miniogre/<your_project_name>:latest`, and then start a container. You can customize the LLM provider, baseimage, port mapping and more using command-line options. If you don't want to build a container, simply add the `--no-container` flag.


### Commands
- `run`: Executes the full miniogre pipeline, generating required files, building a Docker image, and optionally spinning up a container.
- `readme`: Generates or updates the project's `README.md` file based on source code analysis.
- `eval`: Evaluates the quality of the project's README file on a scale of 1-10.
- `spinup`: Spins up a Docker container of the application if an image has already been built.
- `version`: Displays the installed version of miniogre.
- `build-ogre-image`: Builds a base Docker image with miniogre pre-installed (primarily for deployments to environments like Google Cloud Run).
- `cloud`: Sends the project folder as a tarball to a terminal server in the cloud (e.g. `terminal.ogre.run`).
- `ask`: Asks a question about the project or a code issue (still experimental).


## Contributing
Contributions are welcome!  For inquiries, contact [contact@ogre.run](mailto:contact@ogre.run).


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ogre-run/miniogre",
    "name": "miniogre",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Wilder Lopes",
    "author_email": "wilder@ogre.run",
    "download_url": "https://files.pythonhosted.org/packages/3a/46/6c8c537f4f34650bb0f0f5d03300b50f5aa3e2c917e0b1cbc8c7d6fb47c2/miniogre-0.11.5.tar.gz",
    "platform": null,
    "description": "# miniogre\n\n**miniogre** is a command-line tool that helps developers automate the process of setting up reproducible Python environments. It leverages AI to analyze a Python codebase and automatically generate necessary files such as `Dockerfile`, `requirements.txt`, and SBOM (Software Bill of Materials) files.  This simplifies packaging Python applications and significantly reduces the time spent on dependency management.  It can even update your README file to accurately reflect the current state of your project.\n\n![miniogre_gif_33](https://github.com/ogre-run/miniogre/assets/6482944/0850dbb5-6634-4f08-80a9-6fd8e3ca8e03)\n\n## Why miniogre?\n\nManaging software dependencies is a tedious and time-consuming task for developers. This is especially problematic in AI/ML development, where rapidly evolving Python packages often have poor documentation or outdated configuration files.  miniogre addresses this issue by using AI to automate the dependency setup process. This reduces the time spent \"dependency hunting\" from hours to minutes, allowing developers to focus on writing code instead of wrestling with environments.\n\n## How it Works\n\nminiogre performs the following actions:\n\n1. **Identifies the primary code language:**  miniogre analyzes the project directory. Currently optimized for Python projects.\n2. **Reads the README file:** If a README exists, miniogre reads it to gather information about the project.\n3. **Crawls the source code:**  The code is analyzed to identify import statements and extract a preliminary list of dependencies.\n4. **Refines the requirements:**  miniogre leverages a Large Language Model (LLM) of your choice (OpenAI, Mistral, Groq, or OctoAI) to refine the dependency list and create a `requirements.txt` file.  The LLM helps to resolve complex dependencies and ensure compatibility. \n    * Note: current implementation uses `uv pip compile` to lock requirements, removing the need for an LLM cleaning step for dependency generation.\n5. **Generates supporting files:** It generates a `Dockerfile` enabling containerization of your project and an SBOM (`sbom.json`) documenting all project dependencies.\n6. **Builds a Docker image (optional):**  miniogre can build a Docker image of the application, facilitating easy deployment and sharing.\n7. **Spins up a container (optional):**  miniogre can run the application in a Docker container.\n\n## Requirements\n\n- **Python 3.10 or higher:**  miniogre is written in Python and requires this version. [Download Python](https://www.python.org/downloads/).\n- **Docker:**  Containerization platform for consistent environments. [Download Docker](https://docs.docker.com/get-docker/).\n- **pipx (recommended) or pip:** Python package installers.  pipx is recommended for isolated installations.  [Download pipx](https://pipxproject.github.io/pipx/installation/).  [Download pip](https://pip.pypa.io/en/stable/installing/).\n- **LLM API Key:** You need an API key for at least one of the following LLM providers:\n    - **OpenAI:**  Set your API key using `export OPENAI_API_KEY=<YOUR_TOKEN>`.\n    - **Mistral AI:** Set your API key using `export MISTRAL_API_KEY=<YOUR_TOKEN>`.\n    - **Groq:** Set your API key using `export GROQ_SECRET_ACCESS_KEY=<YOUR_TOKEN>`.\n    - **Ogre:** Set your token using `export OGRE_TOKEN=<YOUR_TOKEN>`.\n\n## Installation\n\nMiniogre can be installed using pipx or pip:\n\n- With pipx (recommended): `pipx install miniogre`\n- With pip: `pip install miniogre`\n\nYou can also build from source using Poetry: `poetry build && pipx install dist/*.whl` (or `pip install dist/*.whl`).  A helper script, `install.sh`, is provided in the repository to simplify this process.\n\n\n## Usage\n\n1. **Navigate to Project Directory:** Open your terminal and go to the root directory of your Python project.\n\n2. **Run miniogre:** Use the following command to analyze your project and generate the reproducibility artifacts:\n\n   ```bash\n   miniogre run\n   ```\nBy default, it will generate the `Dockerfile`, `requirements.txt`, and `sbom.json` in an `ogre_dir` directory, build a Docker image named `miniogre/<your_project_name>:latest`, and then start a container. You can customize the LLM provider, baseimage, port mapping and more using command-line options. If you don't want to build a container, simply add the `--no-container` flag.\n\n\n### Commands\n- `run`: Executes the full miniogre pipeline, generating required files, building a Docker image, and optionally spinning up a container.\n- `readme`: Generates or updates the project's `README.md` file based on source code analysis.\n- `eval`: Evaluates the quality of the project's README file on a scale of 1-10.\n- `spinup`: Spins up a Docker container of the application if an image has already been built.\n- `version`: Displays the installed version of miniogre.\n- `build-ogre-image`: Builds a base Docker image with miniogre pre-installed (primarily for deployments to environments like Google Cloud Run).\n- `cloud`: Sends the project folder as a tarball to a terminal server in the cloud (e.g. `terminal.ogre.run`).\n- `ask`: Asks a question about the project or a code issue (still experimental).\n\n\n## Contributing\nContributions are welcome!  For inquiries, contact [contact@ogre.run](mailto:contact@ogre.run).\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "miniogre: from source code to reproducible environment, in seconds.",
    "version": "0.11.5",
    "project_urls": {
        "Homepage": "https://github.com/ogre-run/miniogre"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "abc1f30f476c7e1edd53b743e44721c05addc51d7c8923720ac5c83e3fdb1e7b",
                "md5": "1f6c08e07ca30ae69303db55e7f3eada",
                "sha256": "c422b23d3b436b15e767a82120dca9283b30084505ae449ca74d38a2ece1c759"
            },
            "downloads": -1,
            "filename": "miniogre-0.11.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f6c08e07ca30ae69303db55e7f3eada",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 803497,
            "upload_time": "2024-12-10T22:01:50",
            "upload_time_iso_8601": "2024-12-10T22:01:50.665171Z",
            "url": "https://files.pythonhosted.org/packages/ab/c1/f30f476c7e1edd53b743e44721c05addc51d7c8923720ac5c83e3fdb1e7b/miniogre-0.11.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a466c8c537f4f34650bb0f0f5d03300b50f5aa3e2c917e0b1cbc8c7d6fb47c2",
                "md5": "62cc6b72ccd1af6da5ee6e0b21ff2cb4",
                "sha256": "867278095115ab01fc43d593b8a0d12aeedc957537d11b1d259955d85ce559a1"
            },
            "downloads": -1,
            "filename": "miniogre-0.11.5.tar.gz",
            "has_sig": false,
            "md5_digest": "62cc6b72ccd1af6da5ee6e0b21ff2cb4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 803099,
            "upload_time": "2024-12-10T22:01:53",
            "upload_time_iso_8601": "2024-12-10T22:01:53.647515Z",
            "url": "https://files.pythonhosted.org/packages/3a/46/6c8c537f4f34650bb0f0f5d03300b50f5aa3e2c917e0b1cbc8c7d6fb47c2/miniogre-0.11.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-10 22:01:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ogre-run",
    "github_project": "miniogre",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "miniogre"
}
        
Elapsed time: 0.42174s