Skip to content

Commit 4c79087

Browse files
committed
first commit
0 parents  commit 4c79087

11 files changed

+2518
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = false
9+
max_line_length = 100
10+
tab_width = 2
11+
12+
[{*.py,*.pyw}]
13+
indent_size = 4
14+
max_line_length = 120
15+
tab_width = 4

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/ci.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches: [ "main" ]
4+
pull_request:
5+
branches: [ "main" ]
6+
workflow_call:
7+
8+
permissions:
9+
contents: read
10+
11+
name: CI
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os:
18+
- 'ubuntu-latest'
19+
python-version:
20+
- '3.10'
21+
- '3.11'
22+
- '3.12'
23+
fail-fast: false
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install the project
31+
run: uv sync --all-extras --dev
32+
- uses: chartboost/ruff-action@v1
33+
- name: Run tests
34+
# For example, using `pytest`
35+
run: uv run pytest

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
.venv/
3+
__pycache__/
4+
uv.lock

LICENSE

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
MIT License
2+
3+
Copyright (c) 2023 innoQ Deutschland GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
24+
Open Source Licenses for Dependencies
25+
26+
This project utilizes the following open-source libraries, each of which has its own respective license:
27+
28+
1. github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
29+
License: MIT License
30+
License URL: https://github.com/pkg/browser/blob/main/LICENSE
31+
32+
2. github.com/qri-io/jsonschema v0.2.1
33+
License: MIT License
34+
License URL: https://github.com/qri-io/jsonschema/blob/main/LICENSE
35+
36+
3. github.com/urfave/cli/v2 v2.25.7
37+
License: MIT License
38+
License URL: https://github.com/urfave/cli/blob/v2.25.7/LICENSE
39+
40+
4. gopkg.in/yaml.v3 v3.0.1
41+
License: Apache License 2.0
42+
License URL: https://gopkg.in/yaml.v3/blob/v3.0.1/LICENSE
43+
44+
Please review and comply with the terms and conditions of each respective license when using this software.
45+
46+
The complete text of each license can be found in the provided License URLs. Ensure that you adhere to the terms and obligations outlined in these licenses when using the dependencies in your project.
47+
48+
It is your responsibility to understand and comply with the licensing terms of these dependencies as specified by the respective licenses.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include datacontract-specification-json-schema-v1.1.0.json

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Data Contract Specification (Python)
2+
3+
The pip module `datacontract-specification`.
4+
5+
## Installation
6+
7+
```bash
8+
pip install datacontract-specification
9+
```
10+
11+
## Usage
12+
13+
```python
14+
from datacontract_specification import DataContractSpecification
15+
16+
# Load a data contract specification from a file
17+
data_contract = DataContractSpecification.from_file('path/to/your/data_contract.yaml')
18+
print(data_contract.to_yaml())
19+
20+
# Load a data contract specification from a string
21+
data_contract_str = """
22+
dataContractSpecification: 1.1.0
23+
id: urn:datacontract:checkout:orders-latest
24+
info:
25+
title: Orders Latest
26+
version: 2.0.0
27+
description: |
28+
Successful customer orders in the webshop.
29+
All orders since 2020-01-01.
30+
Orders with their line items are in their current state (no history included).
31+
owner: Checkout Team
32+
status: active
33+
contact:
34+
name: John Doe (Data Product Owner)
35+
url: https://teams.microsoft.com/l/channel/example/checkout
36+
"""
37+
data_contract = DataContractSpecification.from_string(data_contract_str)
38+
print(data_contract.to_yaml())
39+
```

0 commit comments

Comments
 (0)