Skip to content

Commit deda47d

Browse files
committed
Add initial project structure with dependencies and CI configuration
1 parent 67faaa6 commit deda47d

File tree

7 files changed

+655
-1
lines changed

7 files changed

+655
-1
lines changed

.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/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
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/pylint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check on Python Code Quality for 3.10, 3.11, and 3.12
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.10", "3.11", "3.12"]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install pylint
21+
pip install -r requirements.txt
22+
- name: Analysing the code with pylint
23+
run: |
24+
pylint $(git ls-files '*.py')

README.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,55 @@
1-
# eboekhouden-client-python
1+
# Client for E-Boekhouden API
2+
3+
**Introduction:**
4+
> This package provides a Python client for interacting with the E-Boekhouden API. It simplifies authentication, data fetching, and handling of financial records (cost centers, invoices, ledgers, and mutations) while maintaining clear and organized code. Designed for rapid integration and ease of maintenance, it leverages modern logging and error-handling mechanisms.
5+
6+
## Example for retrieving Mutations
7+
8+
```python
9+
"""Example script to process the API."""
10+
11+
import logging
12+
from datetime import datetime, timedelta
13+
14+
from eboekhouden_client import EBoekhoudenClient, DateFilterOperator
15+
16+
logging.basicConfig(
17+
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
18+
)
19+
20+
log: logging.Logger = logging.getLogger(__name__)
21+
22+
23+
def main() -> None:
24+
"""Main function to process the data pipeline."""
25+
26+
mutation_details: list = []
27+
client = EBoekhoudenClient(
28+
credentials={
29+
"source": "<Source for the Application>",
30+
"access_token": "<Acces Token from the Portal>",
31+
},
32+
)
33+
34+
# Determine the processing period (Last 3 Days, including Today)
35+
today = datetime.now().date()
36+
start_date = today - timedelta(days=3)
37+
end_date = today
38+
39+
# Process the Transactions
40+
mutations = client.get_mutations(
41+
start_date=start_date.strftime("%Y-%m-%d"),
42+
end_date=end_date.strftime("%Y-%m-%d"),
43+
date_range=DateFilterOperator.RANGE,
44+
)
45+
46+
for mutation in mutations:
47+
mutation_id = mutation.get("id")
48+
get_mutation_details = client.get_mutation(mutation_id=mutation_id)
49+
mutation_details.append(get_mutation_details)
50+
51+
52+
if __name__ == "__main__":
53+
main()
54+
55+
```

eboekhouden_client/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""This is the main package file for the verbonden_stilte package."""
2+
3+
import logging
4+
5+
from rich.logging import RichHandler
6+
from .eboekhouden import EBoekhoudenClient
7+
from .enums import DateFilterOperator
8+
9+
# Version and author info for the package
10+
__version__ = "2.0-beta"
11+
__author__ = "Daan Damhuis"
12+
__organization__ = "Verbonden Stilte"
13+
14+
# Add RichHandler to the root logger
15+
logging.basicConfig(
16+
level="INFO",
17+
format="%(message)s",
18+
datefmt="[%X]",
19+
handlers=[RichHandler(rich_tracebacks=True)],
20+
)
21+
22+
log = logging.getLogger(__name__)
23+
24+
log.info("Initializing %s version %s", __package__, __version__)
25+
26+
__all__ = ["EBoekhoudenClient", "DateFilterOperator"]

0 commit comments

Comments
 (0)