Skip to content

securitybunker/databunkerpro-python

Repository files navigation

Databunker Pro Python Client

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.

Installation

You can install the package using pip:

pip install databunkerpro

Or install directly from GitHub:

pip install git+https://github.com/securitybunker/databunkerpro-python.git

Quick Start

from databunkerpro import DatabunkerproAPI

# Initialize the client
api = DatabunkerproAPI(
    base_url="https://pro.databunker.org",
    x_bunker_token="your-api-token",
    x_bunker_tenant="your-tenant-name"
)

# Create a new user
user_data = {
    "email": "user@example.com",
    "name": "John Doe",
    "phone": "+1234567890"
}
result = api.create_user(user_data)
print(f"Created user with token: {result['token']}")

# Get user information
user = api.get_user("email", "user@example.com")
print(f"User profile: {user['profile']}")

# Update user information
update_data = {
    "name": "John Updated",
    "phone": "+0987654321"
}
api.update_user("email", "user@example.com", update_data)

# Create a token for sensitive data
token_result = api.create_token("creditcard", "4111111111111111")
print(f"Created token in base format (credit card): {token_result['tokenbase']}")
print(f"Created token in uuid format: {token_result['tokenuuid']}")

Features

  • User Management (create, read, update, delete)
  • Credit Card Management
  • Token Management
  • System Statistics
  • Type hints and comprehensive documentation
  • Error handling and validation
  • Continuous security scanning (Semgrep SAST, pinned CI actions)

Development

To set up the development environment:

  1. Clone the repository:
git clone https://github.com/securitybunker/databunkerpro-python.git
cd databunkerpro-python
  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
pytest

Security

This library is scanned on every push and pull request, with a weekly scheduled sweep to catch drift:

  • SAST (Semgrep): static analysis using the p/python, p/secrets, p/security-audit, and p/owasp-top-ten rulesets. A finding fails the check, and results are published to the repository's Code Scanning tab. See .github/workflows/semgrep.yml.
  • Supply-chain hardening: every GitHub Action is pinned to a full commit SHA, so a mutable tag (@v4) cannot be silently repointed to malicious code.

Reproduce the SAST scan locally:

pip install semgrep
semgrep scan \
    --config p/python \
    --config p/secrets \
    --config p/security-audit \
    --config p/owasp-top-ten

To report a security vulnerability, please email hello@databunker.org rather than opening a public issue.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please open an issue on GitHub.

API Documentation

For detailed API documentation, please visit the DatabunkerPro API Documentation.

About

No description, website, or topics provided.

Resources

License

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages