Skip to main content

Public Python client for the Instituto Forest open-data API.

Project description

forest-data

Public Python client for the Instituto Forest open-data API.

The package wraps https://institutoforest.org/api/v1. The API returns metadata, official source URLs, and profiling results. Dataset bytes are downloaded from the official source listed in each item source_url. Forest does not mirror raw dataset files in Supabase.

Install

pip install forest-data

Basic Use

import forest_data

client = forest_data.Client()

for dataset in client.list_datasets():
    print(dataset.id, dataset.title)

manifest = client.get_dataset("inpe_bdqueimadas_focos")
for item in manifest.items:
    print(item.period, item.source_url, item.profile_status, item.row_count)

Download From Official Sources

import forest_data

client = forest_data.Client()
paths = client.download("inpe_bdqueimadas_focos", path="./data")

download() follows item source_url values. If an item has sha256, the SDK verifies it by default. If an item does not have sha256, the SDK downloads it without checksum verification.

URL Discovery

import forest_data

client = forest_data.Client()
urls = client.get_source_urls("inpe_bdqueimadas_focos")

Use get_dataset_items() or iter_items() when your pipeline needs profile metadata before deciding what to download:

for item in client.iter_items("inpe_bdqueimadas_focos"):
    if item.profile_status == "ok" and item.row_count:
        print(item.filename, item.row_count, item.source_url)

Profile Fields

profiled_at is the UTC time when Forest finished profiling the item.

profile_status describes the profiling result:

  • ok: download and expected profiling metrics succeeded.
  • partial: the resource was downloaded, but some metrics are incomplete.
  • failed: the URL was discovered, but download or parsing failed.
  • skipped: profiling was intentionally not attempted.

profile_warnings contains public-safe warning objects with code and message. Use these warnings to decide whether an item is fit for automated ingestion.

Configuration

Default base URL: https://institutoforest.org/api/v1.

Override with Client(base_url=...) or FOREST_API_BASE_URL.

Full API documentation: https://institutoforest.org/docs/api/v1

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

forest_data-0.1.0a0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

forest_data-0.1.0a0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file forest_data-0.1.0a0.tar.gz.

File metadata

  • Download URL: forest_data-0.1.0a0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for forest_data-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 49f6c60c629b1bf3f1b0903b22dc9eae549516ee9cab5824198899004159e014
MD5 09c8087e1cd70b6050da4b4b73421076
BLAKE2b-256 2488b9d8b724cad2cb535e0c99e508693f01c70ed8d823af259d3bd4f784879b

See more details on using hashes here.

File details

Details for the file forest_data-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: forest_data-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for forest_data-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 92b4323df1b9bcf55e360a3a5f783cd062fceb989994fe7eea943855dbef3542
MD5 4c9c5726186198acb460f275aff7ef93
BLAKE2b-256 29f38023afbf0f2f1f05fdf49378a4174e1dc7912dbdff4f624d1b731e9f87f2

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