miniogre


Nameminiogre JSON
Version 0.11.1 PyPI version JSON
download
home_pagehttps://github.com/ogre-run/miniogre
Summaryminiogre: from source code to reproducible environment, in seconds.
upload_time2024-11-15 21:30:52
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/c0/45/ed00efa69eba8154afbbd0e27f796d16c4da234ba89d33a0615d3e14e4de/miniogre-0.11.1.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.1",
    "project_urls": {
        "Homepage": "https://github.com/ogre-run/miniogre"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd863d2ec2cda32661e92bc56dce5795625eef739698cd1ad5fa8d62d71a7ef6",
                "md5": "ff8e0d49c532dca90bda20497754b35a",
                "sha256": "0edb6c88045e402636007c2c2be094a6956dedc140b8c4b595c2f028771cd95d"
            },
            "downloads": -1,
            "filename": "miniogre-0.11.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff8e0d49c532dca90bda20497754b35a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 803264,
            "upload_time": "2024-11-15T21:30:50",
            "upload_time_iso_8601": "2024-11-15T21:30:50.795443Z",
            "url": "https://files.pythonhosted.org/packages/bd/86/3d2ec2cda32661e92bc56dce5795625eef739698cd1ad5fa8d62d71a7ef6/miniogre-0.11.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c045ed00efa69eba8154afbbd0e27f796d16c4da234ba89d33a0615d3e14e4de",
                "md5": "0c0ac956492b1cd3c57448c58f3b0212",
                "sha256": "e817af9dc2176f6c74f891a9a9215596a79015b41b183cd1ff713797ffcf80b0"
            },
            "downloads": -1,
            "filename": "miniogre-0.11.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0c0ac956492b1cd3c57448c58f3b0212",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 802903,
            "upload_time": "2024-11-15T21:30:52",
            "upload_time_iso_8601": "2024-11-15T21:30:52.931647Z",
            "url": "https://files.pythonhosted.org/packages/c0/45/ed00efa69eba8154afbbd0e27f796d16c4da234ba89d33a0615d3e14e4de/miniogre-0.11.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 21:30:52",
    "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: 1.77825s