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.3.0.tar.gz (24.8 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.3.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: odyn-0.3.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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.3.0.tar.gz
Algorithm Hash digest
SHA256 c5f7734a7057a1a87447aec36d131890bceb331747632666ad57af1d23186830
MD5 4fcebb0b249b9747b093da5fdc5a6bc6
BLAKE2b-256 8ab747c381fce76b308ed9d6c1fbb0956a05dea1f397ac39841a539b664f29cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: odyn-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acb4a93f8bafae2c691808f5a61d22c437087ddc3057be98971df3dd2eae33b0
MD5 52fab14c77af172863c34b4cd10ca5ae
BLAKE2b-256 f51e170304c46d5f84f40ded61598cbf5ad65b1854e889d4925e900edfcfcd0e

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