### Start Tangram Server with uv Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Starts the Tangram server using the uv run command, specifying the virtual environment created for installing wheel files and providing the configuration file. ```shell uv run --python .venv_whl tangram serve --config tangram.example.toml ``` -------------------------------- ### Install Tangram System Plugin Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_system/readme.md Installs the tangram-system plugin and tangram-core using either the 'uv' command-line tool or 'pip'. This setup is necessary to utilize the system monitoring features. ```sh # cli via uv uv tool install --with tangram-system tangram-core # with pip pip install tangram-core tangram-system ``` -------------------------------- ### Developer Setup and Build Commands Source: https://context7.com/open-aviation/tangram/llms.txt Provides essential commands for setting up the Tangram development environment. Includes cloning the repository, installing frontend and Python dependencies, running the development server, serving documentation, and formatting code across multiple languages. ```bash # Clone repository git clone https://github.com/open-aviation/tangram.git cd tangram # Install frontend dependencies and build pnpm i pnpm build # Install Python packages in editable mode uv sync --all-packages --all-groups --all-extras # Run development server uv run tangram serve --config tangram.example.toml # Run documentation server uv run mkdocs serve # Format all code (Rust, Python, JavaScript) just fmt ``` -------------------------------- ### Start Tangram Server Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Starts the Tangram server with a specified configuration file. This command assumes the configuration file path is provided. ```shell tangram serve --config /path/to/your/tangram.toml ``` -------------------------------- ### Install tangram-ship162 and tangram-core Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_ship162/readme.md Instructions for installing the tangram-ship162 plugin and the core tangram library using either the 'uv' command-line tool or 'pip'. Ensure both 'tangram-core' and 'tangram-ship162' are installed for full functionality. ```sh # cli via uv uv tool install --with tangram-ship162 tangram-core # with pip pip install tangram-core tangram-ship162 ``` -------------------------------- ### Install Tangram Packages from Wheel Files Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Creates a new virtual environment and installs the Tangram packages from the generated wheel files. This ensures a clean installation separate from development environments. ```shell uv venv .venv_whl uv pip install --python .venv_whl dist/tangram*.whl ``` -------------------------------- ### Install Tangram Core with System Plugin using uv Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs both tangram_core and the tangram_system plugin using 'uv'. This enables system monitoring features. ```shell uv tool install --with tangram_system tangram_core ``` -------------------------------- ### Install Tangram Core and Plugins in Editable Mode Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs the core tangram application and all plugins in editable mode using uv. This command also installs developer utilities and builds Rust-based packages. ```sh uv sync --all-packages --all-groups --all-extras ``` -------------------------------- ### Install Tangram System Plugin using pip Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs the tangram_system plugin using 'pip'. This assumes tangram_core is already installed in the active virtual environment. ```shell # assuming you have an active virtual environment with tangram_core installed pip install tangram_system ``` -------------------------------- ### Install Tangram Core with Plugins (Bash) Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_core/readme.md Demonstrates how to install tangram-core along with specific plugins like tangram-jet1090 and tangram-system using the 'uv' or 'pip' package managers. This is the typical method for setting up a tangram environment. ```bash # with uv uv tool install --with tangram-jet1090 --with tangram-system tangram-core # with pip pip install tangram-core tangram-jet1090 tangram-system # launch! tangram serve --config /path/to/your/tangram.toml ``` -------------------------------- ### Install Tangram History Plugin Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_history/readme.md Installs the tangram_history plugin and tangram_core using either the uv CLI or pip. This is the primary method for setting up the historical data persistence framework. ```shell # cli via uv uv tool install --with tangram-history tangram-core # with pip pip install tangram-core tangram-history ``` -------------------------------- ### Clone Tangram Repository and Install Dependencies Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Clones the tangram repository from GitHub and installs all project dependencies using pnpm. This step sets up the project structure and downloads necessary packages. ```sh git clone https://github.com/open-aviation/tangram.git cd tangram pnpm i ``` -------------------------------- ### Tangram TOML Configuration Example Source: https://github.com/open-aviation/tangram/blob/main/docs/configuration.md An example of the `tangram.toml` file, illustrating how to configure core settings like Redis URL and plugins, server and channel details, map styles, and plugin-specific parameters. This file serves as the central configuration hub for the Tangram platform. ```toml [core] redis_url = "redis://localhost:6379" plugins = [ "tangram_system", "tangram_jet1090", "my_awesome_package" ] [server] host = "127.0.0.1" port = 2346 [channel] host = "127.0.0.1" port = 2347 jwt_secret = "a-better-secret-than-this" [map] style = "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json" [[map.styles]] name = "Dark Matter" id = "dark-matter" version = 8 sources = { openmaptiles = { type = "vector", url = "https://d17gef4m69t9r4.cloudfront.net/planet.json" } } sprite = "https://openmaptiles.github.io/dark-matter-gl-style/sprite" glyphs = "https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf" [plugins.tangram_jet1090] jet1090_channel = "jet1090" state_vector_expire = 20 topbar_order = 50 sidebar_order = 50 [plugins.tangram_ship162] topbar_order = 100 sidebar_order = 100 ``` -------------------------------- ### Tangram Plugin Enablement (TOML) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/frontend.md The `tangram.toml` configuration file is used to enable installed plugins. By listing the plugin's name (e.g., `my_tangram_plugin`) under the `[core]` section's `plugins` key, Tangram will load and integrate the plugin when it starts. ```toml [core] plugins = ["my_tangram_plugin"] ``` -------------------------------- ### Install Tangram Core using uv Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs the tangram_core package using the 'uv' package manager. This is a prerequisite for end users and developers. ```shell uv tool install tangram_core ``` -------------------------------- ### Install Tangram Jet1090 Plugin using pip Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs the tangram_jet1090 plugin using 'pip'. This assumes tangram_core is already installed in the active virtual environment. ```shell # assuming you have an active virtual environment with tangram_core installed pip install tangram_jet1090 ``` -------------------------------- ### Install Tangram Jet1090 Plugin Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_jet1090/readme.md Installation instructions for the tangram_jet1090 plugin using either the uv CLI or pip. This ensures the necessary tangram core and jet1090 components are available. ```sh # cli via uv uv tool install --with tangram-jet1090 tangram-core # with pip pip install tangram-core tangram-jet1090 ``` -------------------------------- ### Tangram Configuration File (tangram.toml) Example Source: https://context7.com/open-aviation/tangram/llms.txt An example TOML configuration file for Tangram, detailing settings for the core, server, channel, map, and specific plugins like tangram_jet1090. ```toml [core] redis_url = "redis://127.0.0.1:6379" plugins = ["tangram_system", "tangram_jet1090"] log_level = "INFO" [server] host = "127.0.0.1" port = 2346 [channel] host = "127.0.0.1" port = 2347 jwt_secret = "a-better-secret-than-this" jwt_expiration_secs = 315360000 [map] style = "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json" center_lat = 48.0 center_lon = 7.0 zoom = 4 [plugins.tangram_jet1090] jet1090_channel = "jet1090" state_vector_expire = 20 topbar_order = 50 sidebar_order = 50 ``` -------------------------------- ### Install Tangram Core with Jet1090 Plugin using uv Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs tangram_core, tangram_system, and tangram_jet1090 plugins using 'uv'. This enables both system monitoring and live aircraft data features. ```shell uv tool install --with tangram_system --with tangram_jet1090 tangram_core ``` -------------------------------- ### Install Tangram Core using uv or pip Source: https://context7.com/open-aviation/tangram/llms.txt Installs the tangram_core package using either the uv tool or pip. uv is recommended for faster installations. Ensure you are in a virtual environment when using pip. ```bash # Using uv (recommended) uv tool install tangram_core # Using pip python3 -m venv .venv source .venv/bin/activate pip install tangram_core ``` -------------------------------- ### Install Development Tools (Unix-based) Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs essential development tools like uv, Rust, and Node.js/pnpm using curl scripts. These are prerequisites for building and running the tangram project. ```sh curl -LsSf https://astral.sh/uv/install.sh | sh curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh curl -fsSL https://fnm.vercel.app/install | bash fnm install --latest npm install -g corepack corepack enable pnpm ``` -------------------------------- ### Install Tangram Weather Plugin (CLI) Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_weather/readme.md Installs the tangram-weather plugin and tangram-core using the uv CLI tool. This command ensures both the core framework and the weather plugin are available for use. ```shell # cli via uv uv tool install --with tangram-weather tangram-core ``` -------------------------------- ### Install Tangram Core using pip Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Installs the tangram_core package using 'pip' within a Python virtual environment. This method is suitable for end users. ```shell python3 -m venv .venv source .venv/bin/activate pip install tangram_core ``` -------------------------------- ### Install Tangram Weather Plugin (pip) Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_weather/readme.md Installs the tangram-weather plugin and tangram-core using pip. This method is suitable for projects already managed with pip for dependency management. ```shell # with pip pip install tangram-core tangram-weather ``` -------------------------------- ### Run Tangram Server with Redis Source: https://context7.com/open-aviation/tangram/llms.txt Commands to start the Redis server using Podman and then launch the Tangram server with a specified configuration file. ```bash # Start Redis (required) podman run -d --rm -p 6379:6379 --name redis redis:8-alpine # Start tangram server tangram serve --config /path/to/tangram.toml ``` -------------------------------- ### Visualize DataFrames with Tangram Explore (Python) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/explore.md This example demonstrates how to use the tangram_explore plugin to visualize dataframes. It covers both interactive use within a Jupyter environment and script-based execution. The plugin converts dataframes to Parquet bytes for rendering with deck.gl. ```python from tangram_explore import Explore import polars as pl # Create a sample dataframe df = pl.DataFrame({ "latitude": [10, 20, 30, 40, 50], "longitude": [10, 20, 30, 40, 50], "value": [1, 2, 3, 4, 5], }) # Initialize the Explore plugin explore = Explore() # Add the dataframe to the map explore.add_dataframe(df, latitude="latitude", longitude="longitude", color="value") # Display the map (in an interactive environment like Jupyter) explore.show() ``` -------------------------------- ### Run Tangram Server Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Starts the tangram server, including the FastAPI application, channel service, and enabled backend plugins. The application will be accessible at http://localhost:2346. ```sh uv run tangram serve --config tangram.example.toml ``` -------------------------------- ### Plugin Entry Point Registration (TypeScript) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/frontend.md The `index.ts` file serves as the plugin's entry point. It must export an `install` function that receives the `TangramApi` object. This API is used to register new widget components with the core Tangram application using their unique IDs. ```typescript import type { TangramApi } from "@open-aviation/tangram-core/api"; import MyWidget from "./MyWidget.vue"; export function install(api: TangramApi) { // use the API to register a new widget component. // the first argument is a unique ID for your widget. // the second is the Vue component itself. api.registerWidget("my-widget", MyWidget); } ``` -------------------------------- ### Initialize and Run Tangram Runtime in Python Source: https://context7.com/open-aviation/tangram/llms.txt Python code demonstrating how to initialize the Tangram Runtime from a configuration file, start its backend services, interact with Redis, and manage its lifecycle. ```python import asyncio import tangram_core async def main(): # Create runtime from config file runtime = tangram_core.Runtime("tangram.toml") # Start the backend (Redis, HTTP clients, plugins, server) await runtime.start() # Access backend state for custom operations state = runtime.state await state.redis_client.publish("custom:channel", "Hello from runtime") # Wait for server to complete (blocks until shutdown) await runtime.wait() # Clean shutdown await runtime.stop() # Alternative: use as async context manager async def main_context(): async with tangram_core.Runtime("tangram.toml") as runtime: print(f"Server running at {runtime.state.base_url}") await runtime.wait() asyncio.run(main()) ``` -------------------------------- ### Hatchling Build Configuration (TOML) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/frontend.md The `pyproject.toml` file, specifically the `[tool.hatch.build.targets.wheel.force-include]` section, is used to ensure that the compiled frontend assets (the `dist-frontend` directory) are included in the Python wheel package. This makes the plugin's frontend accessible when the package is installed. ```toml [tool.hatch.build.targets.wheel.force-include] "dist-frontend" = "my_plugin/dist-frontend" ``` -------------------------------- ### Run Jet1090 Service with Redis Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Starts the jet1090 service, which provides live aircraft data, and connects it to a Redis instance. It uses a public feed URL. ```shell # connects to a public feed. jet1090 --redis-url redis://127.0.0.1:6379 ws://feedme.mode-s.org:9876/40128@EHRD ``` -------------------------------- ### Run Redis Container Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Starts a Redis 8 instance in a detached container using Podman. This is required for Tangram to function. ```shell podman run -d --rm -p 6379:6379 --name redis redis:8-alpine ``` -------------------------------- ### Manage Tangram Core Runtime in Interactive Environments (Python) Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_core/readme.md Illustrates how to manually start, interact with, and stop the tangram_core runtime in interactive Python environments like Jupyter notebooks. This approach is suitable for multi-cell execution where explicit control over the server lifecycle is needed. ```python # %% import tangram_core runtime = tangram_core.Runtime() await runtime.start() # %% await runtime.state.redis_client.set("my_key", "value") # %% await runtime.stop() # %% ``` -------------------------------- ### Publish Redis Messages (Python and Rust) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/backend.md Demonstrates how to publish messages to Redis channels from backend services for inter-component communication. This functionality is crucial for real-time updates between the frontend, backend, and other Tangram modules. Examples are provided for both Python and Rust. ```python # from within a service function redis_client = backend_state.redis_client await redis_client.publish("to:system:update", "Hello from plugin") ``` ```rust let redis_client = redis::Client::open("redis://localhost:6379").unwrap()?; let mut con = redis_client.get_multiplexed_async_connection().await?; con.publish("to:system:update", "Hello from plugin").await?; ``` -------------------------------- ### Configure Tangram Plugin Entry Point (TOML) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/backend.md Defines the entry point for a Tangram backend plugin in the `pyproject.toml` file. This configuration makes the plugin discoverable by the Tangram core at runtime. It requires specifying the package name, version, dependencies, and the `tangram_core.plugins` entry point. ```toml [project] name = "my-tangram-plugin" version = "0.1.0" dependencies = ["tangram_core>=0.2.1"] [project.entry-points."tangram_core.plugins"] my_plugin = "my_plugin:plugin" ``` -------------------------------- ### Get Ship Trajectory (Bash) Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves the complete historical trajectory for a specific vessel identified by its MMSI. This is achieved by sending a GET request to the /ship162/data/{mmsi} endpoint. ```bash # Get trajectory data for ship with MMSI "123456789" curl -X GET "http://localhost:2346/ship162/data/123456789" # Response: JSON array of AIS position reports ``` -------------------------------- ### Creating Background Services Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/backend.md Explains how to create persistent background tasks using the `@plugin.register_service` decorator. These services can access core components like the Redis client. ```APIDOC ## Creating Background Services To run persistent background tasks, use the `@plugin.register_service` decorator. The decorated function will be started as a background task when `tangram serve` runs. The service function receives a `tangram_core.BackendState` object, which provides access to core components like the Redis client. ### Code Example ```py import asyncio import tangram_core plugin = tangram_core.Plugin() @plugin.register_service() async def run_periodic_task(backend_state: tangram_core.BackendState): """A background service that publishes a message every 10 seconds.""" redis_client = backend_state.redis_client while True: await redis_client.publish("my-plugin:status", "alive") await asyncio.sleep(10) ``` ``` -------------------------------- ### Get Connected Sensors Data (Bash) Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves a list of connected ADS-B receivers or sensors from the jet1090 service. This is done via a simple GET request to the /jet1090/sensors endpoint. ```bash curl -X GET "http://localhost:2346/jet1090/sensors" # Response: Array of connected ADS-B receivers/sensors ``` -------------------------------- ### Launch Tangram Core Programmatically (Python) Source: https://github.com/open-aviation/tangram/blob/main/packages/tangram_core/readme.md Shows how to launch and manage the tangram_core runtime from a Python script. It utilizes an async context manager for safe server configuration and indefinite execution until interrupted. This method provides direct access to backend state like the Redis client. ```python import tangram_core async def main() -> None: async with tangram_core.Runtime() as runtime: await runtime.state.redis_client.set("my_key", "value") await runtime.wait() # required to run the server indefinitely if __name__ == "__main__": import asyncio asyncio.run(main()) ``` -------------------------------- ### Get Route Data for a Callsign (Bash) Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves flight route information for a specific aircraft callsign using a GET request to the jet1090 API. The response is a JSON object containing plane details and route data. ```bash # Get route data for a callsign curl -X GET "http://localhost:2346/jet1090/route/RYR1234" # Response: Route information from OpenSky # {"planes": [{"callsign": "RYR1234", "route": [...]}]} ``` -------------------------------- ### Plugin Anatomy and Entry Point Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/backend.md Defines the basic structure of a Tangram backend plugin, including the pyproject.toml entry point and the main Plugin object. ```APIDOC ## Plugin Anatomy and Entry Point A Tangram plugin is a standard Python package that exposes its functionality through an entry point and a `tangram_core.Plugin` object. ### 1. The `pyproject.toml` Entry Point Your `pyproject.toml` must declare an entry point under the `tangram_core.plugins` group to make your package discoverable. ```toml [project] name = "my-tangram-plugin" version = "0.1.0" dependencies = ["tangram_core>=0.2.1"] [project.entry-points."tangram_core.plugins"] my_plugin = "my_plugin:plugin" ``` ### 2. The `Plugin` Object The entry point must point to an instance of the `tangram_core.Plugin` class, which serves as the central hub for registering plugin components. ```py import tangram_core plugin = tangram_core.Plugin( # ... component registrations go here ... ) ``` ``` -------------------------------- ### Get Sensors Data Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves connected sensor information from jet1090. ```APIDOC ## GET /jet1090/sensors ### Description Retrieves a list of connected ADS-B receivers or sensors from the jet1090 service. ### Method GET ### Endpoint `/jet1090/sensors` ### Response #### Success Response (200) - Returns an array of connected ADS-B receivers/sensors. ### Response Example ```json [ { "id": "sensor-001", "status": "connected" } ] ``` ``` -------------------------------- ### Build Tangram Documentation Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Builds the project documentation using mkdocs. This command serves the documentation locally, allowing developers to preview changes. ```sh uv run mkdocs serve ``` -------------------------------- ### GET /my-plugin/status Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves the current status and a counter value for the plugin. ```APIDOC ## GET /my-plugin/status ### Description Returns the current status of the plugin and an associated counter value. ### Method GET ### Endpoint /my-plugin/status ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (str) - The current status of the plugin (e.g., "running"). - **count** (int) - The current value of the counter. #### Response Example ```json { "status": "running", "count": 150 } ``` ``` -------------------------------- ### GET /weather/wind Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/weather.md Retrieves wind data (U and V components) for a specified isobaric pressure level from the ARPEGE weather model. ```APIDOC ## GET /weather/wind ### Description Retrieves wind data (U and V components) for a specified isobaric pressure level from the ARPEGE weather model. This endpoint is used to fetch meteorological data for visualization purposes, such as wind field displays. ### Method GET ### Endpoint /weather/wind ### Parameters #### Query Parameters - **isobaric** (integer) - Required - The isobaric pressure level in hectopascals (hPa) for which to retrieve wind data (e.g., 300 for 300 hPa). ### Request Example ``` GET /weather/wind?isobaric=300 ``` ### Response #### Success Response (200) - **time** (string) - The timestamp of the weather data. - **level** (integer) - The isobaric pressure level in hPa. - **data** (object) - An object containing the wind data. - **u** (array) - Array of U-component wind speeds. - **v** (array) - Array of V-component wind speeds. #### Response Example ```json { "time": "2023-10-27T12:00:00Z", "level": 300, "data": { "u": [ 10.5, 11.2, 10.8, ... ], "v": [ -5.2, -4.8, -5.5, ... ] } } ``` ``` -------------------------------- ### Build Tangram Project Assets Source: https://github.com/open-aviation/tangram/blob/main/docs/contribute.md Builds the frontend assets and Python packages for distribution. Requires Node.js and pnpm for frontend, and uv for Python packages. Executes from the repository root. ```shell # from the repository root pnpm i pnpm build uv build --all-packages ``` -------------------------------- ### Get Ship Trajectory Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/ship162.md Fetches the full, time-ordered trajectory for a specific ship identified by its MMSI. ```APIDOC ## GET /data/ship/{mmsi} ### Description Retrieves the complete historical trajectory data for a given ship, identified by its Maritime Mobile Service Identity (MMSI). ### Method GET ### Endpoint /data/ship/{mmsi} ### Parameters #### Path Parameters - **mmsi** (string) - Required - The Maritime Mobile Service Identity of the ship. ### Response #### Success Response (200) - **trajectory** (array) - An array of historical position data points for the ship. - **timestamp** (string) - The timestamp of the position data. - **latitude** (number) - The latitude of the ship. - **longitude** (number) - The longitude of the ship. #### Response Example ```json { "trajectory": [ { "timestamp": "2023-10-27T10:00:00Z", "latitude": 34.0522, "longitude": -118.2437 }, { "timestamp": "2023-10-27T10:05:00Z", "latitude": 34.0530, "longitude": -118.2445 } ] } ``` ``` -------------------------------- ### Get Ship Trajectory Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves the full historical trajectory for a specific vessel by MMSI. ```APIDOC ## GET /ship162/data/{mmsi} ### Description Retrieves the historical trajectory data for a vessel identified by its MMSI. ### Method GET ### Endpoint `/ship162/data/{mmsi}` ### Parameters #### Path Parameters - **mmsi** (string) - Required - The Maritime Mobile Service Identity of the vessel (e.g., 123456789). ### Response #### Success Response (200) - Returns a JSON array of AIS position reports for the specified vessel. ### Response Example ```json [ { "timestamp": "2023-10-27T10:00:00Z", "latitude": 51.5074, "longitude": -0.1278 } ] ``` ``` -------------------------------- ### Get Route Data for a Callsign Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves route information for a specific aircraft callsign from jet1090. ```APIDOC ## GET /jet1090/route/{callsign} ### Description Retrieves route data for a given aircraft callsign. ### Method GET ### Endpoint `/jet1090/route/{callsign}` ### Parameters #### Path Parameters - **callsign** (string) - Required - The callsign of the aircraft (e.g., RYR1234). ### Response #### Success Response (200) - **planes** (array) - An array of plane objects, each containing callsign and route information. - **callsign** (string) - The aircraft's callsign. - **route** (array) - The flight route data. ### Response Example ```json { "planes": [ { "callsign": "RYR1234", "route": [...] } ] } ``` ``` -------------------------------- ### Verify Built Packages Source: https://github.com/open-aviation/tangram/blob/main/docs/quickstart.md Lists the contents of the dist/ directory after building to verify the creation of wheel (.whl) and source distribution (.tar.gz) files for Tangram packages. ```shell ls -sh1 dist/ ``` -------------------------------- ### Get Wind Field Data Source: https://context7.com/open-aviation/tangram/llms.txt Retrieves wind field data at a specified isobaric pressure level. ```APIDOC ## GET /weather/wind ### Description Retrieves wind field data as a PNG image for a given isobaric pressure level. ### Method GET ### Endpoint `/weather/wind` ### Parameters #### Query Parameters - **isobaric** (integer) - Required - The isobaric pressure level in hPa (e.g., 300). ### Response #### Success Response (200) - **imageDataUri** (string) - Base64 encoded PNG image data URI. - **bounds** (array) - The geographic bounds of the image [minLon, minLat, maxLon, maxLat]. - **imageUnscale** (array) - Scaling factors for the image data. ### Response Example ```json { "imageDataUri": "data:image/png;base64,iVBORw0KGgo...", "bounds": [-180, -90, 180, 90], "imageUnscale": [-70.0, 70.0] } ``` ``` -------------------------------- ### Load and Access Tangram Configuration in Python Source: https://context7.com/open-aviation/tangram/llms.txt Demonstrates loading Tangram configuration from a TOML file and accessing its various sections programmatically. Also shows how to create a Config object programmatically. ```python from tangram_core.config import Config, CoreConfig, ServerConfig, MapConfig # Load from file config = Config.from_file("tangram.toml") # Access configuration sections print(config.core.redis_url) # "redis://127.0.0.1:6379" print(config.core.plugins) # ["tangram_system", "tangram_jet1090"] print(config.server.host) # "127.0.0.1" print(config.server.port) # 2346 print(config.map.center_lat) # 48.0 print(config.plugins) # {"tangram_jet1090": {...}} # Programmatic configuration config = Config( core=CoreConfig( redis_url="redis://localhost:6379", plugins=["tangram_system"], log_level="DEBUG" ), server=ServerConfig(host="0.0.0.0", port=8080), map=MapConfig(center_lat=52.0, center_lon=4.0, zoom=6) ) ``` -------------------------------- ### Initialize Tangram Plugin Object (Python) Source: https://github.com/open-aviation/tangram/blob/main/docs/plugins/backend.md Initializes the core `tangram_core.Plugin` object in the plugin's `__init__.py` file. This object serves as the central registration point for the plugin's components and functionality. The entry point defined in `pyproject.toml` must point to an instance of this class. ```python import tangram_core plugin = tangram_core.Plugin( # ... component registrations go here ... ) ```