Skip to content

Commit

Permalink
Add initial logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianZaremba committed May 22, 2021
1 parent c2da9a2 commit 4cbe221
Show file tree
Hide file tree
Showing 21 changed files with 883 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI
on: [ pull_request ]
jobs:
pytest:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with: { python-version: '3.9' }
- name: Install dependencies
run: pip install tox
- name: Run pytest
run: tox -e pytest
pylama:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with: { python-version: '3.9' }
- name: Install dependencies
run: pip install tox
- name: Run pylama
run: tox -e pylama
pyre:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with: { python-version: '3.9' }
- name: Install dependencies
run: pip install tox
- name: Run pyre
run: tox -e pyre
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on: { push: { tags: [ 'v*' ] } }
jobs:
github:
runs-on: ubuntu-20.04
steps:
- name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
pypi:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with: { python-version: '3.9' }
- name: Run sdist
run: python setup.py sdist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
skip_existing: true
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .pyre_configuration
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"source_directories": ["pikepdf_annots"],
"strict": false
}
7 changes: 7 additions & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
update: all
pin: True
search: True
close_prs: True
requirements:
- requirements.txt
- requirements-dev.txt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Dive With Damian
Copyright (c) 2021 Damian Zaremba

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include requirements.txt
graft tests
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# pikepdf-annots
Helper utilities for pikepdf
PikePDF helper utilities
========================

Helper utilities for editing PDFs using [PikePDF](https://github.com/pikepdf/pikepdf).

## Example usage

```python3
from pathlib import PosixPath
from pikepdf_annots import EditableForm, AnnotationMatcher

class ExampleForm(EditableForm):
def _get_source_pdf(self) -> PosixPath:
return PosixPath('source.pdf')

with ExampleForm() as pdf:
pdf.update_annotation(0, AnnotationMatcher("First Name"), "Bob")
pdf.update_annotation(0, AnnotationMatcher("Last Name"), "Smoth")
```
Loading

0 comments on commit 4cbe221

Please sign in to comment.