guardrails-api


Nameguardrails-api JSON
Version 0.0.5 PyPI version JSON
download
home_pageNone
SummaryGuardrails API
upload_time2024-11-12 19:57:18
maintainerNone
docs_urlNone
authorNone
requires_python<4,>=3.8
license## THE FOLLOWING LICENSE HAS BEEN ADOPTED FROM THE ELSSTIC LICENSE ## Acceptance By using the software, you agree to all of the terms and conditions below. Copyright License The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below. Limitations You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software. You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key. You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law. Patents The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company. Notices You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms. If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software. No Other Rights These terms do not imply any licenses other than those expressly granted in these terms. Termination If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently. No Liability As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim. Definitions The licensor is the entity offering these terms, and the software is the software the licensor makes available under these terms, including any portion of it. you refers to the individual or entity agreeing to these terms. your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect. your licenses are all the licenses granted to you for the software under these terms. use means anything you do with the software requiring one of your licenses. trademark means trademarks, service marks, and similar rights.
keywords guardrails guardrails ai guardrails api guardrails api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # guardrails-poc
Docker compose stub of Guardrails as a Service

## Setting Up
We strongly encourage you to use a virtual environment when developing in python.
To set one up for this project run the following:
```bash
python3 -m venv ./.venv
source ./.venv/bin/activate
```
Your terminal should now show that you are working from within the virtual environment.
Now you can install the dependencies:
```bash
make install
```

And start the dev server:
```bash
make start
```

Once the service has launched, you should be able to navigate to the Swagger documenation for the guardrails-api at http://localhost:8000


### Local Infrastructure
By default, the server will start with an in-memory store for Guards.  As of June 4th, 2024 this store does not support write operations via the API.  In order to utilize all CRUD operations you will need a postgres database running locally and you will need to provide the following environment variables (sane defaults included for demonstration purposes):

```sh
export PGPORT=5432
export PGDATABASE=postgres
export PGHOST=localhost
export PGUSER=${PGUSER:-postgres}
export PGPASSWORD=${PGPASSWORD:-changeme}
```

You can create this database however you wish, but we do have a docker-compose configuration to stand up the database as well as a local opentelemetry stack.
To use this make sure you have docker installed, then run:

`docker compose --profile db up --build`
to run just the database.

`docker compose --profile infra up --build`
to run the database and opentelemetry infrastructure

or
`docker compose --profile all up --build`
to run everything including the guardrails-api


The last option is useful when checking that everything will work as planned in a more productionized environment.  When developing, it's generally faster to just run the minimum infrastructure you need via docker and run the api on a bare process with the `make start` command.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "guardrails-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": null,
    "keywords": "Guardrails, Guardrails AI, Guardrails API, Guardrails API",
    "author": null,
    "author_email": "Guardrails AI <contact@guardrailsai.com>",
    "download_url": "https://files.pythonhosted.org/packages/2c/05/ed0a3402df2125cb6fa2bffee9a248c7ad92fc7217464c8891b1131af323/guardrails_api-0.0.5.tar.gz",
    "platform": null,
    "description": "# guardrails-poc\nDocker compose stub of Guardrails as a Service\n\n## Setting Up\nWe strongly encourage you to use a virtual environment when developing in python.\nTo set one up for this project run the following:\n```bash\npython3 -m venv ./.venv\nsource ./.venv/bin/activate\n```\nYour terminal should now show that you are working from within the virtual environment.\nNow you can install the dependencies:\n```bash\nmake install\n```\n\nAnd start the dev server:\n```bash\nmake start\n```\n\nOnce the service has launched, you should be able to navigate to the Swagger documenation for the guardrails-api at http://localhost:8000\n\n\n### Local Infrastructure\nBy default, the server will start with an in-memory store for Guards.  As of June 4th, 2024 this store does not support write operations via the API.  In order to utilize all CRUD operations you will need a postgres database running locally and you will need to provide the following environment variables (sane defaults included for demonstration purposes):\n\n```sh\nexport PGPORT=5432\nexport PGDATABASE=postgres\nexport PGHOST=localhost\nexport PGUSER=${PGUSER:-postgres}\nexport PGPASSWORD=${PGPASSWORD:-changeme}\n```\n\nYou can create this database however you wish, but we do have a docker-compose configuration to stand up the database as well as a local opentelemetry stack.\nTo use this make sure you have docker installed, then run:\n\n`docker compose --profile db up --build`\nto run just the database.\n\n`docker compose --profile infra up --build`\nto run the database and opentelemetry infrastructure\n\nor\n`docker compose --profile all up --build`\nto run everything including the guardrails-api\n\n\nThe last option is useful when checking that everything will work as planned in a more productionized environment.  When developing, it's generally faster to just run the minimum infrastructure you need via docker and run the api on a bare process with the `make start` command.\n",
    "bugtrack_url": null,
    "license": "## THE FOLLOWING LICENSE HAS BEEN ADOPTED FROM THE ELSSTIC LICENSE ##  Acceptance By using the software, you agree to all of the terms and conditions below.  Copyright License The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.  Limitations You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.  You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.  You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor\u2019s trademarks is subject to applicable law.  Patents The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.  Notices You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.  If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.  No Other Rights These terms do not imply any licenses other than those expressly granted in these terms.  Termination If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.  No Liability As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.  Definitions The licensor is the entity offering these terms, and the software is the software the licensor makes available under these terms, including any portion of it.  you refers to the individual or entity agreeing to these terms.  your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.  your licenses are all the licenses granted to you for the software under these terms.  use means anything you do with the software requiring one of your licenses.  trademark means trademarks, service marks, and similar rights.",
    "summary": "Guardrails API",
    "version": "0.0.5",
    "project_urls": null,
    "split_keywords": [
        "guardrails",
        " guardrails ai",
        " guardrails api",
        " guardrails api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0149bd2cd8e193dd1f555fad82f06ccd47cd0666eb71274b76222cd71a73070e",
                "md5": "f98eff0452f10928b52194338ccbe3ed",
                "sha256": "42f9f97396d6e7472315f53eb6365d6ce11134a62510c051f10717b0bc551c75"
            },
            "downloads": -1,
            "filename": "guardrails_api-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f98eff0452f10928b52194338ccbe3ed",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 46789,
            "upload_time": "2024-11-12T19:57:16",
            "upload_time_iso_8601": "2024-11-12T19:57:16.351597Z",
            "url": "https://files.pythonhosted.org/packages/01/49/bd2cd8e193dd1f555fad82f06ccd47cd0666eb71274b76222cd71a73070e/guardrails_api-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c05ed0a3402df2125cb6fa2bffee9a248c7ad92fc7217464c8891b1131af323",
                "md5": "7d36fd021cf9a99c7ff69c30093f16eb",
                "sha256": "56a9fad7c9ceb5b8835c07ad870b8ed11e46978318c49061083ead9138f30695"
            },
            "downloads": -1,
            "filename": "guardrails_api-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "7d36fd021cf9a99c7ff69c30093f16eb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 36247,
            "upload_time": "2024-11-12T19:57:18",
            "upload_time_iso_8601": "2024-11-12T19:57:18.220566Z",
            "url": "https://files.pythonhosted.org/packages/2c/05/ed0a3402df2125cb6fa2bffee9a248c7ad92fc7217464c8891b1131af323/guardrails_api-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-12 19:57:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "guardrails-api"
}
        
Elapsed time: 0.35589s