Skip to main content

Python library for the tracks API

Project description

fluidattacks-tracks

PyPI version

Fluid Attacks logo

This library provides convenient access to the Tracks API from any Python 3.11+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by httpx.

Usage

from datetime import datetime, UTC
from fluidattacks_tracks import Tracks
from fluidattacks_tracks.resources.event import Event

client = Tracks()
client.event.create(
    Event(
        action="CREATE",
        author="author",
        date=datetime.now(UTC),
        mechanism="API",
        metadata={"foo": "bar"},
        object="object",
        object_id="object_id",
    )
)

Async usage

Simply import AsyncTracks instead of Tracks and use await with each API call:

import asyncio
from datetime import datetime, UTC
from fluidattacks_tracks import Tracks
from fluidattacks_tracks.resources.event import Event

client = AsyncTracks()


async def main() -> None:
    await client.event.create(
        Event(
            action="CREATE",
            author="author",
            date=datetime.now(UTC),
            mechanism="API",
            metadata={"foo": "bar"},
            object="object",
            object_id="object_id",
        )
    )


asyncio.run(main())

Functionality between the synchronous and asynchronous clients is otherwise identical.

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

fluidattacks_tracks-0.5.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

fluidattacks_tracks-0.5.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file fluidattacks_tracks-0.5.0.tar.gz.

File metadata

  • Download URL: fluidattacks_tracks-0.5.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for fluidattacks_tracks-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9901de81403fd2977add01704082e09c9b149e4e661199dae7d0fb5bdc9c2824
MD5 1e1f7d1ded587940fc7722958173cca4
BLAKE2b-256 517f6160c5fe1da030deaae55dc9dfce604bc875e7d97d0707b75e29dabd4716

See more details on using hashes here.

File details

Details for the file fluidattacks_tracks-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fluidattacks_tracks-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30312a52dcb6a7d40a8b97f94b4c334a914914e04394b62cdaf5073028a6adc4
MD5 0b9f625cc639de6cb535191e503230cf
BLAKE2b-256 6db56a286631ea8a12aad4ec14403b46fce9d391e4ba8f8357ca3eaef5a96827

See more details on using hashes here.

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