DATEV API Integration with FastAPI backend and Streamlit frontend
Project description
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
- Clone the repository:
git clone https://github.com/superpandas-ai/pydatev.git
cd pydatev
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package in development mode:
pip install -e .
- Create a
.envfile 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
- Create a
.streamlit/secrets.tomlfile 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
- Start the FastAPI backend:
uvicorn pydatev.app.main:app --reload
- In a separate terminal, start the Streamlit frontend:
streamlit run pydatev/app/frontend.py
- 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:
- Log in through the Streamlit interface or initialize the client with credentials
- Authorize the application
- Handle the OAuth callback
- 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
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydatev-0.1.0.tar.gz.
File metadata
- Download URL: pydatev-0.1.0.tar.gz
- Upload date:
- Size: 143.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f723a92ee3c7ad3127b621874b91e430a9a5bb32755b469351cb75b4ba44e2e
|
|
| MD5 |
a630f840e0ecc18659f3d6589762a221
|
|
| BLAKE2b-256 |
ed2c01fd86b7d8a003b621182c20e49b287785a83ec298fe588d109762ef7742
|
File details
Details for the file pydatev-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydatev-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
627c589cb70dd999c870789b1eeece4cdcc50c1b8b83e71989b8717b68edba05
|
|
| MD5 |
f00a2fe8c44945c01a60f17f67a26f20
|
|
| BLAKE2b-256 |
95bafabd2c382deab12d70e2857553a855d8d79ac49bd64f0a4eebf38c232722
|