Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,32 @@ on:
- pypi
- testpypi

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python 3.12
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
pip install build twine ruff

- name: Lint with ruff
run: ruff check src/ --target-version py310

- name: Build package
run: python -m build
Expand All @@ -43,10 +48,10 @@ jobs:

- name: Publish to TestPyPI
if: ${{ inputs.pypi_target == 'testpypi' }}
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI
if: ${{ inputs.pypi_target == 'pypi' || github.event_name == 'release' }}
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
uses: pypa/gh-action-pypi-publish@release/v1
29 changes: 29 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# datamorph

## Purpose
Batch data format converter — stream files between CSV, JSON, Parquet, YAML, Avro, and more. Includes schema inference and validation.

## Build & Test Commands
- Install: `pip install -e .` or `pip install datamorph-cli`
- Test: `pytest tests/` (or `python -m pytest tests/ -v --tb=short`)
- Lint: `ruff check .`
- Build: `pip install build twine && python -m build && twine check dist/*`
- CLI check: `datamorph --version && datamorph --help && datamorph formats`

## Architecture
Key directories:
- `src/datamorph/` — Main package (CLI, converters, schema inference, validation)
- `tests/` — Test suite
- `.github/workflows/` — CI/CD (auto-code-review.yml, ci.yml, pages.yml, publish.yml)
- `dist/` — Built distributions

## Conventions
- Language: Python 3.10+
- Test framework: pytest
- CI: GitHub Actions (lint + test matrix: Python 3.10, 3.11, 3.12, 3.13)
- Linting: ruff
- Build system: hatchling
- Package layout: src/ layout
- Dependencies: click, rich, faker, flask, requests, jsonschema, werkzeug, pandas, pyarrow
- CLI entry point: datamorph.cli:cli
- Default branch: master
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "CLI tool for batch converting between data formats (CSV, JSON, YA
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [{name = "Revenue Holdings"}]
authors = [{name = "DevForge"}]
keywords = ["data-converter", "csv", "json", "yaml", "parquet", "avro", "etl", "cli"]
classifiers = [
"Development Status :: 4 - Beta",
Expand Down
24 changes: 22 additions & 2 deletions src/datamorph/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
"""DataMorph CLI — Batch data format converter with streaming support."""
__version__ = "0.1.1"
"""DataMorph package — batch format converter with streaming."""
from .converters import (
ConversionResult,
ValidationResult,
convert,
convert_batch,
detect_format,
supported_formats,
validate,
)
from . import __version__

Check failure on line 11 in src/datamorph/__init__.py

View workflow job for this annotation

GitHub Actions / code-review / Automated code review

ruff (I001)

src/datamorph/__init__.py:2:1: I001 Import block is un-sorted or un-formatted help: Organize imports

Check failure on line 11 in src/datamorph/__init__.py

View workflow job for this annotation

GitHub Actions / code-review / Automated code review

ruff (I001)

src/datamorph/__init__.py:2:1: I001 Import block is un-sorted or un-formatted help: Organize imports

__all__ = [
"__version__",
"convert",
"convert_batch",
"validate",
"detect_format",
"supported_formats",
"ConversionResult",
"ValidationResult",
]
10 changes: 1 addition & 9 deletions src/datamorph/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ def cli() -> None:
Supports CSV, JSON, JSONL, YAML, Parquet, Avro (and Protobuf with
optional protobuf package).

Examples:

datamorph convert input.csv output.parquet

datamorph convert input.csv output.json --pretty

datamorph batch ./data/ --from csv --to parquet

datamorph schema input.parquet
Also try: batch, schema, formats, validate
"""


Expand Down
Loading