Skip to content

Commit f49c0d4

Browse files
committed
Initial commit of the ModuleX Python SDK, including essential files such as README, LICENSE, and configuration for development. Added .env.example for integration tests, .gitignore for ignoring unnecessary files, and a Makefile for build and test automation. Introduced CHANGELOG, CODE_OF_CONDUCT, and CONTRIBUTING guidelines to support community engagement. Implemented CI/CD workflows for testing and publishing to PyPI, along with various documentation snippets for API usage.
0 parents  commit f49c0d4

112 files changed

Lines changed: 11963 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Required for integration tests
2+
MODULEX_API_KEY=mx_live_your_key_here
3+
MODULEX_ORG_ID=your-org-uuid
4+
MODULEX_BASE_URL=your-base-url
5+
6+
# Optional — needed for execution/deployment/schedule tests
7+
MODULEX_TEST_WORKFLOW_ID=optional-workflow-uuid
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Bug Report
2+
description: Report a bug in the ModuleX Python SDK
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for reporting a bug! Please fill out the sections below.
10+
11+
- type: input
12+
id: sdk-version
13+
attributes:
14+
label: SDK Version
15+
description: Output of `pip show modulex | grep Version`
16+
placeholder: "0.1.0"
17+
validations:
18+
required: true
19+
20+
- type: input
21+
id: python-version
22+
attributes:
23+
label: Python Version
24+
description: Output of `python --version`
25+
placeholder: "3.12.0"
26+
validations:
27+
required: true
28+
29+
- type: dropdown
30+
id: os
31+
attributes:
32+
label: Operating System
33+
options:
34+
- macOS
35+
- Linux
36+
- Windows
37+
- Other
38+
validations:
39+
required: true
40+
41+
- type: input
42+
id: endpoint
43+
attributes:
44+
label: API Endpoint (if applicable)
45+
description: Which API endpoint is involved?
46+
placeholder: "POST /workflows/run"
47+
48+
- type: textarea
49+
id: description
50+
attributes:
51+
label: Description
52+
description: A clear and concise description of the bug.
53+
validations:
54+
required: true
55+
56+
- type: textarea
57+
id: expected
58+
attributes:
59+
label: Expected Behavior
60+
description: What did you expect to happen?
61+
validations:
62+
required: true
63+
64+
- type: textarea
65+
id: actual
66+
attributes:
67+
label: Actual Behavior
68+
description: What actually happened? Include error messages and tracebacks.
69+
validations:
70+
required: true
71+
72+
- type: textarea
73+
id: reproduction
74+
attributes:
75+
label: Steps to Reproduce
76+
description: Minimal code to reproduce the issue.
77+
render: python
78+
validations:
79+
required: true
80+
81+
- type: textarea
82+
id: context
83+
attributes:
84+
label: Additional Context
85+
description: Any other context, logs, or screenshots.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Feature Request
2+
description: Suggest a new feature or improvement
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for suggesting an improvement! Please fill out the sections below.
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem Statement
15+
description: What problem does this feature solve? Is it related to a frustration?
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: solution
21+
attributes:
22+
label: Proposed Solution
23+
description: Describe the solution you'd like. Include API examples if relevant.
24+
render: python
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: alternatives
30+
attributes:
31+
label: Alternatives Considered
32+
description: Any alternative solutions or workarounds you've considered.
33+
34+
- type: dropdown
35+
id: area
36+
attributes:
37+
label: Area
38+
description: Which part of the SDK does this relate to?
39+
options:
40+
- Core client
41+
- Resource methods
42+
- Type definitions
43+
- SSE streaming
44+
- Error handling
45+
- Retry logic
46+
- Documentation
47+
- Other
48+
49+
- type: textarea
50+
id: context
51+
attributes:
52+
label: Additional Context
53+
description: Any other context, use cases, or screenshots.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Description
2+
3+
<!-- A clear description of what this PR does. -->
4+
5+
## Related Issue
6+
7+
<!-- Link to the GitHub issue, e.g. Fixes #123 -->
8+
9+
## Type of Change
10+
11+
- [ ] Bug fix (non-breaking change that fixes an issue)
12+
- [ ] New feature (non-breaking change that adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
14+
- [ ] Documentation update
15+
- [ ] Refactoring (no functional changes)
16+
- [ ] Dependency update
17+
18+
## Checklist
19+
20+
- [ ] `make check` passes (lint + typecheck + tests)
21+
- [ ] New code has type annotations
22+
- [ ] Tests added/updated for changes
23+
- [ ] Documentation updated (if public API changed)
24+
- [ ] CHANGELOG.md updated (if user-facing change)

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- run: pip install -e ".[dev]"
21+
- run: ruff check .
22+
- run: ruff format --check .
23+
- run: mypy src/
24+
- run: pytest --cov=modulex --cov-report=xml -v

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment: pypi
11+
permissions:
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- run: pip install build
19+
- run: python -m build
20+
- name: Publish to PyPI
21+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
__pycache__/
2+
*.py[cod]
3+
*$py.class
4+
*.so
5+
dist/
6+
build/
7+
*.egg-info/
8+
*.egg
9+
.eggs/
10+
.mypy_cache/
11+
.pytest_cache/
12+
.ruff_cache/
13+
htmlcov/
14+
.coverage
15+
coverage.xml
16+
*.cover
17+
.env
18+
.venv/
19+
venv/
20+
env/
21+
.idea/
22+
.vscode/
23+
.DS_Store
24+
coverage/
25+
*.swp
26+
*.swo
27+
*~
28+
PUBLISHING_GUIDE.md
29+
SDK_PROMPT_PYTHON.md
30+
SDK_REFERENCE.md

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
3+
All notable changes to the ModuleX Python SDK will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2026-03-09
9+
10+
### Added
11+
12+
- Initial release of the ModuleX Python SDK
13+
- Full coverage of all 125 ModuleX API endpoints
14+
- Async-first client with `httpx`
15+
- SSE streaming support for workflow execution, chat, and composer events
16+
- Automatic retry with exponential backoff for transient errors
17+
- Auto-pagination iterators for list endpoints
18+
- File upload support for knowledge base documents
19+
- Complete type definitions for all request/response schemas
20+
- Exception hierarchy mapping all HTTP error codes
21+
- Organization ID resolution (per-request override or client default)

CODE_OF_CONDUCT.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment:
15+
16+
- Using welcoming and inclusive language
17+
- Being respectful of differing viewpoints and experiences
18+
- Gracefully accepting constructive criticism
19+
- Focusing on what is best for the community
20+
- Showing empathy towards other community members
21+
22+
Examples of unacceptable behavior:
23+
24+
- The use of sexualized language or imagery and unwelcome sexual attention
25+
- Trolling, insulting or derogatory comments, and personal or political attacks
26+
- Public or private harassment
27+
- Publishing others' private information without explicit permission
28+
- Other conduct which could reasonably be considered inappropriate
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of
33+
acceptable behavior and will take appropriate and fair corrective action in
34+
response to any behavior that they deem inappropriate, threatening, offensive,
35+
or harmful.
36+
37+
## Scope
38+
39+
This Code of Conduct applies within all community spaces, and also applies when
40+
an individual is officially representing the community in public spaces.
41+
42+
## Enforcement
43+
44+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
45+
reported to the community leaders responsible for enforcement at
46+
**contact@modulex.dev**.
47+
48+
All complaints will be reviewed and investigated promptly and fairly.
49+
50+
## Attribution
51+
52+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
53+
version 2.1, available at
54+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

0 commit comments

Comments
 (0)