Skip to content

norwegian-geotechnical-institute/field-manager-python-client

Repository files navigation

Field Manager Python Client 🚀

A lightweight, Pythonic library for interacting with the Field Manager API — quickly retrieve project data, manage locations, and automate workflows, all from Python.

✨ Why Use This Client?

  • Easy Integration: Each endpoint is ready to use—no manual HTTP calls needed.
  • Seamless Authentication: Built-in OAuth2/OIDC authentication with automatic token management.
  • Auto-Generated & Up-to-Date: Always in sync with the latest Field Manager API updates.
  • Full Coverage: Access every endpoint and model the Field Manager platform provides.

⚙️ Installation & Setup

  1. Install the package with authentication support:

    pip install field-manager-python-client python-keycloak
  2. Authenticate: Use the built-in authentication functions for seamless access:

    from field_manager_python_client import get_prod_client
    
    # Authenticate with your Field Manager account
    client = get_prod_client(email="[email protected]")

🚀 Quick Example

Here's how to fetch project information using the authenticated client:

from field_manager_python_client import get_prod_client
from field_manager_python_client.api.projects import get_project_projects_project_id_get

# Authenticate and get client
client = get_prod_client(email="[email protected]")

# Use the client to fetch project data
project_id = "your-project-id"
project_info = get_project_projects_project_id_get.sync(client=client, project_id=project_id)

print(f"Project Name: {project_info.name}")

🔐 Authentication Options

The client supports multiple authentication methods:

  1. Integrated Authentication (Recommended):

    from field_manager_python_client import authenticate, get_prod_client
    
    client = authenticate(environment="prod", email="[email protected]")
    # or
    client = get_prod_client(email="[email protected]")
  2. Manual Token Setup:

    from field_manager_python_client import AuthenticatedClient
    
    client = AuthenticatedClient(
        base_url="https://app.fieldmanager.io/api/location",
        token="your-access-token"
    )
  3. Service Account Authentication (for automated workflows):

📂 Explore More Examples

Check out the examples folder for scripts demonstrating how to:

  • Authentication: Multiple ways to authenticate with the API
  • Organizations: Fetch and manage organization data
  • Projects: Retrieve project details and metadata
  • Locations: Manage field locations and associated data
  • Data Export: Export project data in various formats
  • Advanced Usage: Async operations, bulk operations, and more

📚 Documentation

For comprehensive documentation, see the ./doc/ directory:

🏗️ For Developers

If you want to learn more about this library, contribute, or understand the internals, visit the main repository: https://github.com/norwegian-geotechnical-institute/field-manager-python-client

The actual client package is auto-generated from the Field Manager API specification and includes:

  • Full type hints and IDE support
  • Comprehensive error handling
  • Both synchronous and asynchronous operations
  • Advanced customization options

🤝 Contributing

We welcome issues, bug reports, and feature requests! Please check our contributing guidelines and feel free to open an issue or submit a pull request.


Have fun building with the Field Manager Python Client! If you have questions or need help, feel free to open an issue. Happy coding! ✨

About

The Field Manager (FM) Python client is a library designed to provide developers with programmatic access to the Field Manager API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages