|
1 | | -# databunkerpro-python |
| 1 | +# DatabunkerPro Python Client |
| 2 | + |
| 3 | +A Python client library for interacting with the DatabunkerPro API. This library provides a simple and intuitive interface for managing user data, tokens, and other DatabunkerPro features. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +You can install the package using pip: |
| 8 | + |
| 9 | +```bash |
| 10 | +pip install databunkerpro |
| 11 | +``` |
| 12 | + |
| 13 | +Or install directly from GitHub: |
| 14 | + |
| 15 | +```bash |
| 16 | +pip install git+https://github.com/yourusername/databunkerpro-python.git |
| 17 | +``` |
| 18 | + |
| 19 | +## Quick Start |
| 20 | + |
| 21 | +```python |
| 22 | +from databunkerpro import DatabunkerproAPI |
| 23 | + |
| 24 | +# Initialize the client |
| 25 | +api = DatabunkerproAPI( |
| 26 | + base_url="https://pro.databunker.org", |
| 27 | + x_bunker_token="your-api-token", |
| 28 | + x_bunker_tenant="your-tenant-name" |
| 29 | +) |
| 30 | + |
| 31 | +# Create a new user |
| 32 | +user_data = { |
| 33 | + "email": "user@example.com", |
| 34 | + "name": "John Doe", |
| 35 | + "phone": "+1234567890" |
| 36 | +} |
| 37 | +result = api.create_user(user_data) |
| 38 | +print(f"Created user with token: {result['token']}") |
| 39 | + |
| 40 | +# Get user information |
| 41 | +user = api.get_user("email", "user@example.com") |
| 42 | +print(f"User profile: {user['profile']}") |
| 43 | + |
| 44 | +# Update user information |
| 45 | +update_data = { |
| 46 | + "name": "John Updated", |
| 47 | + "phone": "+0987654321" |
| 48 | +} |
| 49 | +api.update_user("email", "user@example.com", update_data) |
| 50 | + |
| 51 | +# Create a token for sensitive data |
| 52 | +token_result = api.create_token("creditcard", "4111111111111111") |
| 53 | +print(f"Created token: {token_result['token']}") |
| 54 | +``` |
| 55 | + |
| 56 | +## Features |
| 57 | + |
| 58 | +- User Management (create, read, update, delete) |
| 59 | +- Token Management |
| 60 | +- System Statistics |
| 61 | +- Type hints and comprehensive documentation |
| 62 | +- Error handling and validation |
| 63 | + |
| 64 | +## Development |
| 65 | + |
| 66 | +To set up the development environment: |
| 67 | + |
| 68 | +1. Clone the repository: |
| 69 | +```bash |
| 70 | +git clone https://github.com/yourusername/databunkerpro-python.git |
| 71 | +cd databunkerpro-python |
| 72 | +``` |
| 73 | + |
| 74 | +2. Install development dependencies: |
| 75 | +```bash |
| 76 | +pip install -e ".[dev]" |
| 77 | +``` |
| 78 | + |
| 79 | +3. Run tests: |
| 80 | +```bash |
| 81 | +pytest |
| 82 | +``` |
| 83 | + |
| 84 | +## Contributing |
| 85 | + |
| 86 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 87 | + |
| 88 | +1. Fork the repository |
| 89 | +2. Create your feature branch (`git checkout -b feature/amazing-feature`) |
| 90 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 91 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 92 | +5. Open a Pull Request |
| 93 | + |
| 94 | +## License |
| 95 | + |
| 96 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 97 | + |
| 98 | +## Support |
| 99 | + |
| 100 | +If you encounter any issues or have questions, please [open an issue](https://github.com/yourusername/databunkerpro-python/issues) on GitHub. |
| 101 | + |
| 102 | +## API Documentation |
| 103 | + |
| 104 | +For detailed API documentation, please visit the [DatabunkerPro API Documentation](https://docs.databunker.org). |
0 commit comments