Skip to main content

Fast, modern, and open-source OpenAPI SDK Generator

Project description

Damascus Logo

Damascus - OpenAPI SDK Generator

License Python

Damascus is a powerful Python-based SDK generator that transforms OpenAPI specifications into elegant, type-safe client libraries. Generate professional client SDKs for your API with minimal effort.

Key Features

  • Full Response Models: Converts API schemas into proper Python dataclasses
  • Type Safety: Comprehensive type annotations for modern Python development
  • Authentication Support: Handles API key, Bearer token and other auth methods
  • Multiple Input Sources: Generate from local JSON files or remote URLs
  • Template-Based: Easily customizable code generation via Jinja2 templates
  • Python Version Targeting: Generate code optimized for specific Python versions

Installation

Using pip:

pip install damascus

Using uv (recommended):

uv pip install damascus

Requirements

  • Runtime: Python 3.8+
  • Development: Python 3.10+ recommended for modern type hints
  • Dependencies: Jinja2 for templating

Quick Start

CLI Usage

Generate an SDK from an OpenAPI specification:

# From a local file
damascus generate ./path/to/openapi.json --output my_sdk

# From a URL
damascus generate https://api.example.com/openapi.json --output my_sdk

# With custom headers (for protected specs)
damascus generate https://api.example.com/openapi.json --header "Authorization: Bearer token123" --output my_sdk

SDK Usage

Once generated, using the SDK is straightforward:

from my_sdk import Client

# Initialize client
client = Client(
    base_url="https://api.example.com",
    api_key="your-api-key"
)

# Call API methods - responses are typed objects
response = client.get_user(user_id=123)
print(f"User name: {response.name}")

Documentation

Comprehensive documentation is available in the docs/ directory:

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

Damascus is licensed under the GNU General Public License v3.0 (GPLv3) - see the LICENSE file for details.

About

Damascus is created and maintained by Beshu Limited, a UK company based in London, established in 2017.

Beshu Limited is best known for:

  • ReadonlyREST: Security for Elasticsearch and Kibana
  • Anaphora: Automated reporting and alerting for Kibana

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

damascus-0.1.3.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

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

damascus-0.1.3-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

Details for the file damascus-0.1.3.tar.gz.

File metadata

  • Download URL: damascus-0.1.3.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for damascus-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e1d2b57d9be83de66aca87480f8bf85d2027ed29b98552acda0ca532eec6fe79
MD5 985a50dc9baeba9cb8873c89a038b724
BLAKE2b-256 84adc99bf80da3417cac4fd9c140a4f8a2d064c9320d8c2b1242ca6f0d969e48

See more details on using hashes here.

File details

Details for the file damascus-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: damascus-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for damascus-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 98577a08cc2082628b4f658b5d9e06e6c3a929287aae0961113b7afac5c7bfca
MD5 364efdeaa6cf447c24e2a08d56ffed98
BLAKE2b-256 3c42bde3dcb0e9afb08420273b1463b21a23d19908cd2df083014038bc5adac7

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