Skip to main content

Odyn is a python client for Business Central Web Services API.

Project description

Odyn

Odyn is a modern, async-first Python client for Microsoft Dynamics 365 Business Central Web Services. It provides a high-level interface for extracting and interacting with data from Business Central using OData, handling the complexities of authentication, rate limiting, and data transformation.

Project Scope

This project was designed for personal use and follows an opinionated structure. It currently supports Business Central OData Web Services specifically. It is not intended for use with the standard Business Central API v2.0 endpoints.

Problem Solved

Integrating with Business Central Web Services often involves significant boilerplate for authentication, manual construction of OData queries, complex pagination logic, and data conversion. Odyn eliminates this overhead by providing a type-safe, fluent API that returns native Polars DataFrames, designed specifically for data engineering and high-performance integration tasks.

Capabilities

  • Async Execution: Built on httpx for high-performance asynchronous I/O.
  • Polars Integration: Native support for Polars DataFrames for efficient data processing.
  • Query Builder: Type-safe OData query builder with support for filters, expansions, and ordering.
  • Caching: Persistent Parquet-based caching with configurable TTL to reduce API load.
  • Resilience: Automatic retries with exponential backoff and configurable rate limiting (via aiolimiter).
  • Data Handling: Automatic pagination, streaming, and efficient batching for large datasets.

Dependencies

  • Python 3.12+
  • httpx
  • polars
  • aiolimiter

Installation

pip install odyn

Quick Example

import asyncio
from odyn import BCWebServiceClient, BasicAuth
from odyn.query import ODataQuery, F

async def main():
    async with BCWebServiceClient.create(
        server="https://bc-server:7048",
        instance="BC200",
        auth=BasicAuth("user", "password"),
        company="CRONUS",
    ) as client:
        # Fetch customers with balance > 1000
        query = ODataQuery().filter(F.Balance > 1000)
        df = await client.get("customers", query=query)
        print(df)

if __name__ == "__main__":
    asyncio.run(main())

Documentation

Comprehensive documentation is available in the docs/ directory:

Examples

Refer to the examples/ directory for functional examples covering various use cases:

License

MIT

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

odyn-0.4.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

odyn-0.4.0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file odyn-0.4.0.tar.gz.

File metadata

  • Download URL: odyn-0.4.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odyn-0.4.0.tar.gz
Algorithm Hash digest
SHA256 622e4d77e4d8845deab649efe88cd80db3d83716773e1c82f8d03e544521c4fe
MD5 30e13fdd00e596465c93f85d112ba786
BLAKE2b-256 11cf7e03905eec70ff9a7ef4c50921d83f4d8c78698fef9e87d0b2bfe587d475

See more details on using hashes here.

File details

Details for the file odyn-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: odyn-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odyn-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7ad751566dacf47d96e7ae1244dcbe396675723be4c2def354e7c4500d5dd4
MD5 2b31d32eee6a923d0fa88e8239fc29e8
BLAKE2b-256 13f0e10aa66bd954d7dc12f8391f61c8b929a5871a2ab8445a0151f7793902c1

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