Skip to content

SmartForest-no/forestsens-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ForestSensAPI

ForestSensAPI is a Python client for interacting with Smartforests ForestSens platform API utilizing the OCI SDK for efficient file uploads. It allows users to manage batch jobs, upload files, retrieve results, and monitor processing status through a simple and extensible interface.

Currently under development with our partners, the API will be available for public use in the near future. For questions or contributions, please contact us at forestsens@nibio.no.

🚀 Features

  • Initialize and start batch jobs
  • Upload files to OCI Object Storage using PAR URLs
  • Retrieve and download batch results
  • Monitor batch status
  • Supports configuration via JSON and OCI config files

📦 Installation

pip install -r requirements.txt

⚙️ Configuration

Create a config file at ~/.forestsens/config.json:

{
    "base_url": "https://forestsens.api.url",
    "apitoken": "your_api_token"
}

Ensure your OCI config is available at ~/.oci/config or passed as a dictionary.

🧪 Usage Example

from ForestSensAPI import ForestSensAPI

# Initialize the API client
api = ForestSensAPI()

# Run a batch
batch = api.run_batch(
    algorithm=26,
    input_path="path/to/data",
    name="MyBatch"
)
print(batch["status"])

# Download results
api.download_results(batch_id=batch["id"], output_dir="results")

About

Python client for ForestSens API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages