Skip to main content

Typed Python client for the EasyVista Service Manager REST API

Project description

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

pip install easyvista-python-client

Usage (sync)

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

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)

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 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 for development setup and quality checks.

License

MIT — see LICENSE.

Sponsoring

The development of this package is indirectly supported by Novahé & Constellation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyvista_python_client-0.1.0.tar.gz (89.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easyvista_python_client-0.1.0-py3-none-any.whl (68.4 kB view details)

Uploaded Python 3

File details

Details for the file easyvista_python_client-0.1.0.tar.gz.

File metadata

  • Download URL: easyvista_python_client-0.1.0.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for easyvista_python_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 57be272e1df43f94b298c288f4738b5e60df5152ea3e0136374f38408fae0124
MD5 c1d40a97c4e74f2c4e415c2967f19bd0
BLAKE2b-256 30d7733680c9b2ae7e20234a233797855b20e52bc88ed0e8a55896da8f0585d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for easyvista_python_client-0.1.0.tar.gz:

Publisher: release.yml on baraline/easyvista_python_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file easyvista_python_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for easyvista_python_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d4c4e9cc2586f295e474247c393f6b3006ea24196cebb559261914d83955f66
MD5 db32921e2e23ba329db5b8effcdea9d6
BLAKE2b-256 209c0757d8c08b0bd28979dbb216db7b3a11f6eb9da7bc986384279eaf472b84

See more details on using hashes here.

Provenance

The following attestation bundles were made for easyvista_python_client-0.1.0-py3-none-any.whl:

Publisher: release.yml on baraline/easyvista_python_client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page