Metadata-Version: 2.4
Name: easyvista-python-client
Version: 0.1.0
Summary: Typed Python client for the EasyVista Service Manager REST API
Project-URL: Homepage, https://github.com/baraline/easyvista_python_client
Project-URL: Documentation, https://easyvista-python-client.readthedocs.io/en/latest/
Project-URL: Issues, https://github.com/baraline/easyvista_python_client/issues
Project-URL: Source, https://github.com/baraline/easyvista_python_client
Author: easyvista-python-client contributors
License-Expression: MIT
License-File: LICENSE
Keywords: api,client,easyvista,itsm,rest,service-manager
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.8
Requires-Dist: tenacity>=8.2
Requires-Dist: typing-extensions>=4.7; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: numpydoc>=1.8; extra == 'dev'
Requires-Dist: pre-commit>=4.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'dev'
Requires-Dist: sphinx<8.2,>=7.2; extra == 'dev'
Requires-Dist: tokenize-rt==6.2.0; extra == 'dev'
Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'dev'
Requires-Dist: twine>=5.1; extra == 'dev'
Requires-Dist: unasync==0.6.0; extra == 'dev'
Requires-Dist: vulture>=2.11; extra == 'dev'
Provides-Extra: docs
Requires-Dist: numpydoc>=1.8; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'docs'
Requires-Dist: sphinx<8.2,>=7.2; extra == 'docs'
Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'docs'
Description-Content-Type: text/markdown

# easyvista-python-client

Typed Python client for the EasyVista Service Manager REST API. Sync + async,
Pydantic models, Bearer or Basic auth.

While the package is preparing for 1.0, alot of potential breaking change might happen between versions. A deprecation policy will be put in place once 1.0 is out and the package have been stabilized.

## Documentation

Full documentation: https://easyvista-python-client.readthedocs.io/

Build it locally with `pip install -e ".[docs]"` then
`sphinx-build -b html -W docs docs/_build/html`.

## Install

```bash
pip install easyvista-python-client
```

## Usage (sync)

```python
from easyvista_python_client import (
    EasyvistaClient,
    EasyvistaConfig,
    PostRequest,
    ev_equals_filter,
)

config = EasyvistaConfig(server="https://my.easyvista.com", account="12345", token="...")
with EasyvistaClient(config) as client:
    # catalog_code, the *_id values and the close status_guid are instance-specific.
    ticket = client.create_ticket(
        PostRequest(
            catalog_code="INC_STANDARD",
            title="Printer down",
            description="The 3rd-floor printer is offline",
            origin=7,
            department_id=9,
            urgency_id=8,
            impact_id=28,
        )
    )
    fetched = client.get_ticket(ticket.rfc_number)
    open_status = ev_equals_filter("STATUS_ID", 3)
    results = client.search_tickets(search=open_status, max_rows=50)

    # page through everything with the iterator (follows the API's offset paging)
    for t in client.iter_tickets(search=open_status, page_size=100, max_records=1000):
        ...  # async: `async for t in client.iter_tickets(...)`

    # close it with your instance's "closed" status GUID
    client.close_ticket(
        ticket.rfc_number,
        status_guid="{00000000-0000-0000-0000-000000000000}",
        delete_actions=1,
        comment="Resolved",
    )
```

> Minimum fields for a create are catalog-specific (server-side). `catalog_code` + `title`
> work for incident catalogs; a missing mandatory field raises `EasyvistaValidationError`
> (HTTP 590, code 2013) — it is not retried.

## Assets and documents

```python
from pathlib import Path
from easyvista_python_client import (
    EasyvistaClient,
    EasyvistaConfig,
    PostAsset,
    ev_equals_filter,
)

with EasyvistaClient(EasyvistaConfig.from_env()) as client:
    asset = client.create_asset(PostAsset(catalog_id=3153, asset_tag="LAPTOP-001"))
    tag_filter = ev_equals_filter("ASSET_TAG", "LAPTOP-001")
    found = client.search_assets(search=tag_filter, max_rows=50)

    # attach a file to a ticket (uploaded as base64 inside the JSON body)
    pdf = Path("report.pdf")
    client.add_document("I240101_0001", filename=pdf.name, content=pdf.read_bytes())
    attachments = client.list_documents("I240101_0001")
```

## Usage (async)

```python
from easyvista_python_client import AsyncEasyvistaClient, EasyvistaConfig

async with AsyncEasyvistaClient(EasyvistaConfig.from_env()) as client:
    ticket = await client.get_ticket("I240101_0001")
```

## Configuration via environment

Set `EASYVISTA_URL` (or `EASYVISTA_SERVER`), `EASYVISTA_ACCOUNT`, and either
`EASYVISTA_TOKEN` / `EASYVISTA_TOKEN_FILE` or `EASYVISTA_LOGIN` + `EASYVISTA_PASSWORD`,
then call `EasyvistaConfig.from_env()`.

## Agent skills

`skills/` holds Agent Skills for driving this client from an AI agent — one per
domain (client setup, search syntax, tickets, actions, documents, assets,
directory, reporting and context). Each is a directory with a `SKILL.md`
following the Agent Skills specification; see [skills/README.md](skills/README.md)
for the index.

They are source-tree material: present in the git repository and the source
distribution, absent from the installed wheel.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and quality checks.

## License

MIT — see [LICENSE](LICENSE).

## Sponsoring

The development of this package is indirectly supported by
[Novahé](https://www.novahe.fr/) & [Constellation](https://www.constellation.fr/).
