or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/fiona@1.10.x
tile.json

tessl/pypi-fiona

tessl install tessl/pypi-fiona@1.10.0

Fiona reads and writes spatial data files

Agent Success

Agent success rate when using this tile

88%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.1x

Baseline

Agent success rate without this tile

80%

task.mdevals/scenario-9/

DateTime Field Capability Checker

Build a utility that analyzes GIS file formats to determine their support for advanced datetime field features.

Problem Description

Different GIS file formats (drivers) have varying levels of support for datetime fields. Some formats support timezone-aware datetime values, while others only support naive datetime. Similarly, some formats can store millisecond precision in time values, while others are limited to second precision.

Your task is to create a tool that:

  1. Takes a list of driver names as input
  2. For each driver, creates a test dataset with datetime fields
  3. Attempts to write datetime values with timezone information and millisecond precision
  4. Reads back the data to verify what was actually preserved
  5. Reports which capabilities each driver supports

Requirements

Input

  • A list of driver names (e.g., ['GeoJSON', 'GPKG', 'ESRI Shapefile'])

Output

  • For each driver, report:
    • Whether timezone information is preserved in datetime fields
    • Whether millisecond precision is preserved in time fields
    • Any errors encountered during testing

Implementation Details

Your solution should:

  1. For each driver, create a temporary in-memory dataset with a schema containing a Point geometry, a datetime field, and a time field
  2. Write a test feature with timezone-aware datetime and time values that include microsecond precision
  3. Read back the written feature and check if timezone and precision were preserved
  4. Handle errors gracefully for drivers that don't support certain operations
  5. Return results as a dictionary with driver names as keys

Test Cases

  • Checking GeoJSON format preserves timezone-aware datetime values @test
  • Checking GeoPackage format handles millisecond precision in time fields @test
  • Checking that the function handles unsupported drivers without crashing @test
  • Checking that results include both timezone and precision information for each driver @test

@generates

API

from typing import Dict, List
from datetime import datetime, time, timezone

def check_datetime_capabilities(drivers: List[str]) -> Dict[str, Dict[str, bool]]:
    """
    Check datetime field capabilities for specified GIS drivers.

    Parameters:
    - drivers: List of driver names to test (e.g., ['GeoJSON', 'GPKG'])

    Returns:
    Dictionary with driver names as keys, each containing:
        - 'supports_timezone': bool indicating if timezone info is preserved
        - 'supports_milliseconds': bool indicating if millisecond precision is preserved
        - 'error': str or None if the driver test encountered an error

    Example:
    {
        'GeoJSON': {
            'supports_timezone': True,
            'supports_milliseconds': True,
            'error': None
        },
        'GPKG': {
            'supports_timezone': False,
            'supports_milliseconds': True,
            'error': None
        }
    }
    """

Dependencies { .dependencies }

fiona { .dependency }

Provides GIS data format reading and writing capabilities.