Skip to main content

PyDATEV

A Python library and FastAPI/Streamlit application that provides a unified interface for interacting with DATEV's various API services. This library integrates multiple DATEV APIs including accounting, HR, payroll, and cash register services.

Features

  • Authentication: OAuth2 integration with DATEV's authentication system
  • Client Management: View and manage DATEV clients
  • Document Management: Upload and manage documents
  • HR Services:
    • eAU (electronic Certificate of Incapacity for Work) management
    • Employee data access
    • Payroll reporting
  • Cash Register Integration: Manage cash register data and tenants
  • Master Data Management: Search and manage master client data
  • Interactive Dashboard: User-friendly Streamlit interface for all services

Prerequisites

  • Python 3.8+
  • DATEV API credentials (Client ID and Client Secret)
  • Valid DATEV account with appropriate permissions

Installation

  1. Clone the repository:
git clone https://github.com/superpandas-ai/pydatev.git
cd pydatev
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the package in development mode:
pip install -e .
  1. Create a .env file in the root directory with your DATEV credentials:
DATEV_CLIENT_ID=your_client_id
DATEV_CLIENT_SECRET=your_client_secret
DATEV_REDIRECT_URI=http://localhost:8501/callback
  1. Create a .streamlit/secrets.toml file with your OAuth credentials:
[oauth]
client_id = "your_client_id"
client_secret = "your_client_secret"

Project Structure

pydatev/
├── src/
│   └── pydatev/
│       ├── app/
│       │   ├── models/
│       │   │   └── __init__.py
│       │   └── __init__.py
│       └── __init__.py
├── tests/
│   └── conftest.py
├── setup.py
├── pytest.ini
├── .env
└── README.md

Running the Application

  1. Start the FastAPI backend:
uvicorn pydatev.app.main:app --reload
  1. In a separate terminal, start the Streamlit frontend:
streamlit run pydatev/app/frontend.py
  1. Access the application:
  • Frontend Dashboard: http://localhost:8501
  • API Documentation: http://localhost:8000/docs

Using the Library

from pydatev import DATEVClient

# Initialize the client
client = DATEVClient(client_id="your_client_id", client_secret="your_client_secret")

# Use the client to interact with DATEV APIs
clients = client.get_clients()

API Structure

The application provides endpoints for various DATEV services:

  • /clients/* - Client management endpoints
  • /documents/* - Document management
  • /hr/* - HR-related services
  • /tenants/* - Cash register management
  • /master-clients/* - Master data management
  • /payrollreports/* - Payroll reporting

For detailed API documentation, visit the Swagger UI at /docs when running the application.

Testing

Run the tests using pytest:

pytest

Authentication

The library and application use OAuth2 for authentication with DATEV's services. Users need to:

  1. Log in through the Streamlit interface or initialize the client with credentials
  2. Authorize the application
  3. Handle the OAuth callback
  4. Use the received token for API requests

Error Handling

The library includes comprehensive error handling for:

  • Authentication failures
  • API request errors
  • Invalid data submissions
  • Token expiration

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

[Add your license information here]

Support

For support, please create an issue in the repository.

Acknowledgments

  • DATEV for providing the API services
  • FastAPI and Streamlit communities

Metadata

Release files for pydatev 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydatev 0.1.0
File Size Uploaded
pydatev-0.1.0.tar.gz 143.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pydatev 0.1.0
File Interpreter ABI Platform
pydatev-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 163.9 kB

Release files / pydatev-0.1.0.tar.gz

Download URL pydatev-0.1.0.tar.gz
Size 143.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9f723a92ee3c7ad3127b621874b91e430a9a5bb32755b469351cb75b4ba44e2e
BLAKE2b-256 checksum
How to use checksums
ed2c01fd86b7d8a003b621182c20e49b287785a83ec298fe588d109762ef7742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / pydatev-0.1.0-py3-none-any.whl

Download URL pydatev-0.1.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
627c589cb70dd999c870789b1eeece4cdcc50c1b8b83e71989b8717b68edba05
BLAKE2b-256 checksum
How to use checksums
95bafabd2c382deab12d70e2857553a855d8d79ac49bd64f0a4eebf38c232722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page