Skip to content

Commit 16881dc

Browse files
Merge pull request #1 from datalogics-kam/pdfcloud-1340-initial-api
PDFCLOUD-5351 Initial Python API for pdfRest
2 parents d5fde6f + 72b2c10 commit 16881dc

49 files changed

Lines changed: 13370 additions & 2 deletions

Some content is hidden

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

.editorconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
root = true
2+
3+
4+
[*]
5+
charset = utf-8
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 2
9+
10+
[*.md]
11+
indent_size = 2
12+
max_line_length = 80
13+
14+
[{*.py,*.ipynb}]
15+
indent_size = 4
16+
max_line_length = 88
17+
18+
[*.sh]
19+
# like -i=4
20+
indent_style = space
21+
indent_size = 4
22+
23+
shell_variant = bash # --language-variant
24+
binary_next_line = true
25+
switch_case_indent = true # --case-indent
26+
space_redirects = true
27+
keep_padding = false
28+
function_next_line = true # --func-next-line

.editorconfig-checker.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"Version": "v3.4.0",
3+
"Verbose": false,
4+
"Debug": false,
5+
"IgnoreDefaults": false,
6+
"SpacesAfterTabs": false,
7+
"NoColor": false,
8+
"Exclude": ["^\\.idea/", "\\.md$", "\\.py$", "\\.ipynb$"],
9+
"AllowedContentTypes": [],
10+
"PassedFiles": [],
11+
"Disable": {
12+
"EndOfLine": false,
13+
"Indentation": false,
14+
"InsertFinalNewline": false,
15+
"TrimTrailingWhitespace": false,
16+
"IndentSize": true,
17+
"MaxLineLength": false
18+
}
19+
}

.gitattributes

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Common settings that generally should always be used with your language specific settings
2+
3+
# Auto detect text files and perform LF normalization
4+
# https://www.davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
5+
* text=auto
6+
7+
#
8+
# The above will handle all files NOT found below
9+
#
10+
11+
# Documents
12+
*.bibtex text diff=bibtex
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain
23+
*.md text
24+
*.tex text diff=tex
25+
*.adoc text
26+
*.textile text
27+
*.mustache text
28+
*.csv text
29+
*.tab text
30+
*.tsv text
31+
*.txt text
32+
*.sql text
33+
34+
# Graphics
35+
*.png binary
36+
*.jpg binary
37+
*.jpeg binary
38+
*.gif binary
39+
*.tif binary
40+
*.tiff binary
41+
*.ico binary
42+
# SVG treated as an asset (binary) by default.
43+
*.svg text
44+
# If you want to treat it as binary,
45+
# use the following line instead.
46+
# *.svg binary
47+
*.eps binary
48+
49+
# Scripts
50+
*.bash text eol=lf
51+
*.fish text eol=lf
52+
*.sh text eol=lf
53+
# These are explicitly windows files and should use crlf
54+
*.bat text eol=crlf
55+
*.cmd text eol=crlf
56+
*.ps1 text eol=crlf
57+
58+
# Serialisation
59+
*.json text
60+
*.toml text
61+
*.xml text
62+
*.yaml text
63+
*.yml text
64+
65+
# Archives
66+
*.7z binary
67+
*.gz binary
68+
*.tar binary
69+
*.tgz binary
70+
*.zip binary
71+
72+
# Text files where line endings should be preserved
73+
*.patch -text
74+
75+
#
76+
# Exclude files from exporting
77+
#
78+
79+
.gitattributes export-ignore
80+
.gitignore export-ignore
81+
# Basic .gitattributes for a python repo.
82+
83+
# Source files
84+
# ============
85+
*.pxd text diff=python
86+
*.py text diff=python
87+
*.py3 text diff=python
88+
*.pyw text diff=python
89+
*.pyx text diff=python
90+
*.pyz text diff=python
91+
92+
# Binary files
93+
# ============
94+
*.db binary
95+
*.p binary
96+
*.pkl binary
97+
*.pickle binary
98+
*.pyc binary
99+
*.pyd binary
100+
*.pyo binary
101+
102+
# Jupyter notebook
103+
*.ipynb text
104+
105+
# Note: .db, .p, and .pkl files are associated
106+
# with the python modules ``pickle``, ``dbm.*``,
107+
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
108+
# (among others).

.github/workflows/pre-commit.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
- feature-*
10+
11+
jobs:
12+
pre-commit:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
contents: read
17+
packages: write
18+
pull-requests: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
version: 0.8.22
25+
python-version: 3.11
26+
enable-cache: true
27+
cache-suffix: pre-commit
28+
cache-dependency-glob: uv.lock
29+
- name: Restore venv cache
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
.venv
34+
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
35+
- name: Restore mypy cache
36+
uses: actions/cache@v4
37+
with:
38+
path: .mypy_cache
39+
key: mypy_cache|${{ hashFiles('pyproject.toml') }}
40+
- name: Restore pre-commit cache
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.cache/pre-commit
44+
key: pre-commit-4|${{ hashFiles('.pre-commit-config.yaml') }}
45+
- name: Synchronize project dependencies
46+
run: uv sync --group dev
47+
- name: Run pre-commit checks
48+
run: uv run pre-commit run --show-diff-on-failure --all-files --hook-stage manual
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Test and Publish
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
- feature-*
10+
release:
11+
types:
12+
- published
13+
14+
jobs:
15+
tests:
16+
name: Tests (Python ${{ matrix.python-version }})
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
22+
permissions:
23+
id-token: write
24+
contents: read
25+
packages: write
26+
pull-requests: write
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v6
31+
with:
32+
version: 0.8.22
33+
python-version: ${{ matrix.python-version }}
34+
enable-cache: true
35+
cache-suffix: test-and-publish
36+
cache-dependency-glob: uv.lock
37+
- name: Run tests with nox
38+
run: uvx nox --python ${{ matrix.python-version }} --session tests -- --no-parallel
39+
env:
40+
PDFREST_API_KEY: ${{ secrets.PDFREST_API_KEY }}
41+
42+
publish:
43+
name: Publish to CodeArtifact
44+
needs: tests
45+
if: github.event_name == 'release'
46+
runs-on: ubuntu-latest
47+
permissions:
48+
id-token: write
49+
contents: read
50+
packages: write
51+
env:
52+
UV_PROJECT_ENVIRONMENT: .venv-release
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: Assume AWS role for repository CI
56+
uses: aws-actions/configure-aws-credentials@v4
57+
with:
58+
role-to-assume: arn:aws:iam::304774597385:role/cit-oidc-role-${{ github.event.repository.name }}-ci
59+
aws-region: us-east-2
60+
- name: Install uv
61+
uses: astral-sh/setup-uv@v6
62+
with:
63+
version: 0.8.22
64+
enable-cache: true
65+
cache-suffix: pre-commit
66+
cache-dependency-glob: uv.lock
67+
- name: Restore venv cache
68+
uses: actions/cache@v4
69+
with:
70+
path: |
71+
${{ env.UV_PROJECT_ENVIRONMENT }}
72+
key: ${{ runner.os }}-uv-release-${{ hashFiles('pyproject.toml') }}
73+
- name: Install keyring
74+
run: uv tool install keyring --with keyrings.codeartifact
75+
- name: Synchronize project dependencies
76+
run: uv sync --group dev
77+
- name: Build distribution artifacts
78+
run: uv build --python 3.11
79+
- name: Publish package to CodeArtifact
80+
run: uv publish --index cit-pypi

0 commit comments

Comments
 (0)