Skip to main content

Python library for the tracks API

Project description

fluidattacks-tracks

PyPI version

logo

The Tracks Python 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
from fluidattacks_tracks import Tracks
from fluidattacks_tracks.resources.event import Event

client = Tracks()
client.event.create(
    Event(
        action="CREATE",
        author="author",
        date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
        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
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.fromisoformat("2019-12-27T18:11:19.117"),
            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.3.0.tar.gz (7.5 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.3.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fluidattacks_tracks-0.3.0.tar.gz
Algorithm Hash digest
SHA256 487ad31f877b2b2dcf08f2f5eed2dba87b8e9da704da8c5d9a71a0f28a18855c
MD5 8551bebe59a58da6290f98184d215b94
BLAKE2b-256 ba9127760a98ed5e53c6b01c1e137bf409c40569320ea10c85dc22c06494198e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fluidattacks_tracks-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcd19efa9349450e41dd3295beb2e2cc5ee895b26f3f2143ed07e489b771bab5
MD5 0e07e77e51fc927f0389ffb7004cfd3b
BLAKE2b-256 6c26128321d4d21398bcd7591295d11c6c410754b19c991d52a831baff3930a7

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