generalanalysis


Namegeneralanalysis JSON
Version 0.2.4 PyPI version JSON
download
home_pageNone
SummaryPython SDK for General Analysis Guardrails
upload_time2025-09-01 23:37:55
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords ai api guardrails llm safety sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # General Analysis SDK

Python SDK for General Analysis AI Guardrails.

## Installation

```bash
pip install generalanalysis
```

## Quick Start

```python
import generalanalysis

# Uses GA_API_KEY env var by default
client = generalanalysis.Client()

# Check text against guard policies
result = client.guards.invoke(guard_id=1, text="Text to check")

if result.block:
    print("Blocked:", [p.name for p in result.policies if not p.passed])
```

## API Reference

### Guards Operations

```python
# List guards
guards = client.guards.list()

# Get guard details  
guard = client.guards.get(guard_id=1)

# Invoke guard
result = client.guards.invoke(guard_id=1, text="...")
print(f"Blocked: {result.block}, Latency: {result.latency_ms}ms")

# Generate policies from job
policies = client.guards.generate_policies_from_job(job_id=123)

# Get logs (paginated)
logs = client.guards.list_logs(guard_id=1, page=1, page_size=50)
```

## Async Support

```python
import asyncio
import generalanalysis

async def main():
    async with generalanalysis.AsyncClient() as client:
        results = await asyncio.gather(*[
            client.guards.invoke(guard_id=1, text=t) 
            for t in texts
        ])
```
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "generalanalysis",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "ai, api, guardrails, llm, safety, sdk",
    "author": null,
    "author_email": "General Analysis <support@generalanalysis.com>",
    "download_url": "https://files.pythonhosted.org/packages/81/66/8a361c7fe70dfef7da7479beb6f11846601ef74e88d3503d0c569b935a6d/generalanalysis-0.2.4.tar.gz",
    "platform": null,
    "description": "# General Analysis SDK\n\nPython SDK for General Analysis AI Guardrails.\n\n## Installation\n\n```bash\npip install generalanalysis\n```\n\n## Quick Start\n\n```python\nimport generalanalysis\n\n# Uses GA_API_KEY env var by default\nclient = generalanalysis.Client()\n\n# Check text against guard policies\nresult = client.guards.invoke(guard_id=1, text=\"Text to check\")\n\nif result.block:\n    print(\"Blocked:\", [p.name for p in result.policies if not p.passed])\n```\n\n## API Reference\n\n### Guards Operations\n\n```python\n# List guards\nguards = client.guards.list()\n\n# Get guard details  \nguard = client.guards.get(guard_id=1)\n\n# Invoke guard\nresult = client.guards.invoke(guard_id=1, text=\"...\")\nprint(f\"Blocked: {result.block}, Latency: {result.latency_ms}ms\")\n\n# Generate policies from job\npolicies = client.guards.generate_policies_from_job(job_id=123)\n\n# Get logs (paginated)\nlogs = client.guards.list_logs(guard_id=1, page=1, page_size=50)\n```\n\n## Async Support\n\n```python\nimport asyncio\nimport generalanalysis\n\nasync def main():\n    async with generalanalysis.AsyncClient() as client:\n        results = await asyncio.gather(*[\n            client.guards.invoke(guard_id=1, text=t) \n            for t in texts\n        ])\n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for General Analysis Guardrails",
    "version": "0.2.4",
    "project_urls": {
        "Documentation": "https://docs.generalanalysis.com/",
        "Homepage": "https://generalanalysis.com",
        "Repository": "https://github.com/General-Analysis/ga-sdk"
    },
    "split_keywords": [
        "ai",
        " api",
        " guardrails",
        " llm",
        " safety",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dba42e337c494296d9d073a0e28f8fc8bc3779295d4a8efba2de5296cc89bdd2",
                "md5": "118e7c8b155cf27a37ad35c103d601fc",
                "sha256": "dca4b1704abc7804f57e68afaf715ae03cf0b0615e3f108ee6088ba7a7c572f8"
            },
            "downloads": -1,
            "filename": "generalanalysis-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "118e7c8b155cf27a37ad35c103d601fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12317,
            "upload_time": "2025-09-01T23:37:53",
            "upload_time_iso_8601": "2025-09-01T23:37:53.981745Z",
            "url": "https://files.pythonhosted.org/packages/db/a4/2e337c494296d9d073a0e28f8fc8bc3779295d4a8efba2de5296cc89bdd2/generalanalysis-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "81668a361c7fe70dfef7da7479beb6f11846601ef74e88d3503d0c569b935a6d",
                "md5": "03d3fb75372479bbc88ea2b07a5db9ee",
                "sha256": "1a7c9605b7b54cb9639da53ffc56ce11c1575f3734f3d5e4f3a6e0dfe0bf2e61"
            },
            "downloads": -1,
            "filename": "generalanalysis-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "03d3fb75372479bbc88ea2b07a5db9ee",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 19000,
            "upload_time": "2025-09-01T23:37:55",
            "upload_time_iso_8601": "2025-09-01T23:37:55.092855Z",
            "url": "https://files.pythonhosted.org/packages/81/66/8a361c7fe70dfef7da7479beb6f11846601ef74e88d3503d0c569b935a6d/generalanalysis-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-01 23:37:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "General-Analysis",
    "github_project": "ga-sdk",
    "github_not_found": true,
    "lcname": "generalanalysis"
}
        
Elapsed time: 1.61580s