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.4.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.4.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fluidattacks_tracks-0.4.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.4.0.tar.gz
Algorithm Hash digest
SHA256 947f69e891c51243f9ce82a8a4c33439f1bb0e9c74413df49fa88c82f3fdd25a
MD5 8533116d0aea19a82645960ed27bbbc5
BLAKE2b-256 ef7bf58c215cd6c6a79817cbd2443a2a9fb2b5861a76baa6d7c548a50d8798d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fluidattacks_tracks-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6637ec808a3acccc3e650184a66e801900d049a6df1f104cbfb2c7738ebc2728
MD5 1c0d1ec90bd30dcbb96cdefa631e9289
BLAKE2b-256 ce5a6644a1ec51675c8c827ca2364621a18467b86a2eb480f313f1d8365cef86

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