https://github.com/norwegian-geotechnical-institute/field-manager-python-client
The Field Manager (FM) Python client is a library designed to provide developers with programmatic access to the Field Manager API.
https://github.com/norwegian-geotechnical-institute/field-manager-python-client
api client field-manager openapi python
Last synced: 13 days ago
JSON representation
The Field Manager (FM) Python client is a library designed to provide developers with programmatic access to the Field Manager API.
- Host: GitHub
- URL: https://github.com/norwegian-geotechnical-institute/field-manager-python-client
- Owner: norwegian-geotechnical-institute
- Created: 2024-11-19T10:16:12.000Z (over 1 year ago)
- Default Branch: trunk
- Last Pushed: 2025-03-13T13:50:38.000Z (about 1 year ago)
- Last Synced: 2025-03-13T14:36:22.010Z (about 1 year ago)
- Topics: api, client, field-manager, openapi, python
- Language: Python
- Homepage: https://pypi.org/project/field-manager-python-client/
- Size: 1020 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Field Manager Python Client 🚀
**A lightweight, Pythonic library for interacting with the [Field Manager API](https://app.fieldmanager.io/developer) — 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:
```bash
pip install field-manager-python-client python-keycloak
```
2. **Authenticate**: Use the built-in authentication functions for seamless access:
```python
from field_manager_python_client import get_prod_client
# Authenticate with your Field Manager account
client = get_prod_client(email="your.email@example.com")
```
## 🚀 Quick Example
Here's how to fetch project information using the authenticated client:
```python
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="your.email@example.com")
# 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):
```python
from field_manager_python_client import authenticate, get_prod_client
client = authenticate(environment="prod", email="user@example.com")
# or
client = get_prod_client(email="user@example.com")
```
2. **Manual Token Setup**:
```python
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):
- See the [Authentication Guide](./doc/AUTHENTICATION_GUIDE.md) for details
- Also covered in the [Advanced User Guide](./doc/ADVANCED_USER_GUIDE.md)
## 📂 Explore More Examples
Check out the [examples folder](./examples/examples/) 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/`](./doc/) directory:
- **[Authentication Guide](./doc/AUTHENTICATION_GUIDE.md)**: Complete guide to all authentication methods
- **[Advanced User Guide](./doc/ADVANCED_USER_GUIDE.md)**: In-depth coverage of sync/async operations and customizations
- **[Troubleshooting Guide](./doc/TROUBLESHOOTING.md)**: Solutions for common issues, including Windows long path support
- **[Examples Overview](./examples/EXAMPLES_OVERVIEW.md)**: Detailed overview of all available examples
## 🏗️ 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](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](./doc/MAINTAINERS_GUIDE.md) 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! ✨