field-manager-python-client
A client library for accessing Field Manager Data API
🚀 Quick Start
Installation
pip install field_manager_python_client python-keycloak
Authentication
The easiest way to get started for scripting is using the built-in device-code helper:
from field_manager_python_client import get_prod_device_code_client
client = get_prod_device_code_client()
Basic Usage
from field_manager_python_client.api.projects import get_project_projects_project_id_get
# Use the authenticated client
project_info = get_project_projects_project_id_get.sync(client=client, project_id="your-project-id")
print(f"Project: {project_info.name}")
🔐 Authentication Options
1. Device Code Authentication (Recommended)
from field_manager_python_client import authenticate_with_device_code
client = authenticate_with_device_code(environment="prod")
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 (for automation)
Use a dedicated Keycloak client created for your integration See the main repository for service account setup.
📖 API Usage Patterns
Synchronous Operations
from field_manager_python_client.api.organizations import get_organizations_organizations_get
# Simple request - returns data or None
organizations = get_organizations_organizations_get.sync(client=client)
# Detailed request - returns Response object with status code, headers, etc.
from field_manager_python_client.types import Response
response: Response = get_organizations_organizations_get.sync_detailed(client=client)
if response.status_code == 200:
organizations = response.parsed
Asynchronous Operations
import asyncio
from field_manager_python_client.api.organizations import get_organizations_organizations_get
async def fetch_organizations():
# Simple async request
organizations = await get_organizations_organizations_get.asyncio(client=client)
# Detailed async request
response = await get_organizations_organizations_get.asyncio_detailed(client=client)
return response.parsed
# Run async function
organizations = asyncio.run(fetch_organizations())
🛠️ Advanced Features
SSL Configuration
from field_manager_python_client import AuthenticatedClient
# Custom certificate bundle
client = AuthenticatedClient(
base_url="https://internal.example.com/api", token="token", verify_ssl="/path/to/certificate_bundle.pem"
)
# Disable SSL verification (not recommended for production)
client = AuthenticatedClient(base_url="https://internal.example.com/api", token="token", verify_ssl=False)
Custom HTTP Configuration
from field_manager_python_client import AuthenticatedClient
def log_request(request):
print(f"Request: {request.method} {request.url}")
def log_response(response):
print(f"Response: {response.status_code}")
client = AuthenticatedClient(
base_url="https://api.example.com",
token="token",
httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
)
📚 Learn More
For comprehensive documentation, examples, and contribution guidelines, visit the main repository: https://github.com/norwegian-geotechnical-institute/field-manager-python-client
The repository includes:
- 📖 Complete authentication guide
- 🔧 Advanced usage examples
- 🚀 Real-world code samples
- 🤝 Contributing guidelines
- 📋 Issue tracking and support
🔍 API Reference
Every endpoint becomes a Python function with four variants:
sync: Blocking request returning parsed data orNonesync_detailed: Blocking request returning fullResponseobjectasyncio: Async version ofsyncasyncio_detailed: Async version ofsync_detailed
All path/query parameters and request bodies become function arguments.
Functions are organized by API tags in field_manager_python_client.api.* modules.
Metadata
Release files for field-manager-python-client 4.7.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| field_manager_python_client-4.7.16.tar.gz | 236.0 kB | Without provenance | Details for field_manager_python_client-4.7.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| field_manager_python_client-4.7.16-py3-none-any.whl | Python 3 | none | any | Details for field_manager_python_client-4.7.16-py3-none-any.whl |
Total release size: 1.0 MB
Release files / field_manager_python_client-4.7.16.tar.gz
| Download URL | field_manager_python_client-4.7.16.tar.gz |
|---|---|
| Size | 236.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6b0d1be2ae6725b013602f5f4a8b7f166f432c0b21677d949ca94e15ead3c46
|
|
BLAKE2b-256 checksum How to use checksums |
a99baef615be9020b601ddc83d513ddb233071dc5ecd3b46a806c24428154f66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.14 Linux/6.17.0-1022-azure
|
Release files / field_manager_python_client-4.7.16-py3-none-any.whl
| Download URL | field_manager_python_client-4.7.16-py3-none-any.whl |
|---|---|
| Size | 770.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78c4769d9c9fbf9041e97913b1828a82a2595aef0bcf57722edd76024a98147a
|
|
BLAKE2b-256 checksum How to use checksums |
daf1be6c913dec66af6f402ce033ed9577f33b83056ca94fec5febb8f9e2f025
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.14 Linux/6.17.0-1022-azure
|
Security for field-manager-python-client 4.7.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.