bluecatipreg
Python module to perform IP hostname registration and unregistration in BlueCat.
Getting Started
Installation
Install from source (development)
# Clone the repository
git clone <repository-url>
cd bluecatipreggithub
# Create and activate virtual environment
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Linux/Mac:
source venv/bin/activate
# Install in development mode
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"
Build and install package
# Build the package
pip install build
python -m build
# This creates:
# - dist/bluecatipreg-0.0.1.tar.gz (source distribution)
# - dist/bluecatipreg-0.0.1-py3-none-any.whl (wheel)
# Install from built package
pip install dist/bluecatipreg-0.0.1-py3-none-any.whl
Install from PyPI (when published)
pip install bluecatipreg
Usage
NOTE: Provided password should be base64 encrypted.
1. Register IP and host in Bluecat
python -m bluecatipreg add -url https://abc.com -user admin -passwd password -n test01 -fqdn test01.dev.abc.com -ipv4 6.6.6.6 -net 6.6.6.0/24 -conf playground -domain dev.abc.com -contact developer@abc.com -c "test01 dns entry"
2. Unregister IP from the Bluecat
python -m bluecatipreg delete -url https://abc.com -user admin -passwd password -conf playground -ipv4 6.6.6.6
Development
Running Unit Tests
Using pytest (recommended)
# Install test dependencies
pip install -r requirements_dev.txt
pip install pytest pytest-cov
# Run all tests
pytest bluecatipreg/tests -v
# Run with coverage
pytest bluecatipreg/tests -v --cov=bluecatipreg --cov-report=term-missing --cov-report=html
# Run specific test file
pytest bluecatipreg/tests/test_bluecat_utils.py -v
Using unittest (Python built-in)
python -m unittest discover -s bluecatipreg/tests -p "test_*.py" -v
Code Quality
Linting with flake8
flake8 bluecatipreg --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 bluecatipreg --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
Code formatting with black
# Check formatting
black --check bluecatipreg
# Format code
black bluecatipreg
CI/CD Pipeline
The project includes a GitHub Actions CI/CD pipeline (.github/workflows/ci.yml) that:
- Runs on: Push and pull requests to
main,master, anddevelopbranches - Test Matrix: Tests on multiple Python versions (3.7-3.13) across Ubuntu, Windows, and macOS
- Steps:
- Installs dependencies
- Runs linting (flake8)
- Checks code formatting (black)
- Runs unit tests with coverage
- Builds the package (on main/master branch)
- Validates the built package
Viewing Pipeline Status
- Go to the "Actions" tab in your GitHub repository
- Click on a workflow run to see detailed logs
- The pipeline will automatically run on every push and pull request
Package Structure
bluecatipreg/
├── __init__.py # Package initialization
├── __main__.py # CLI entry point
├── bluecat_utils.py # Core BlueCat API functionality
├── options.py # Command-line argument parsing
└── tests/ # Unit tests
├── __init__.py
└── test_bluecat_utils.py
Requirements
- Python 3.7+
- requests
See requirements.txt for production dependencies and requirements_dev.txt for development dependencies.
Metadata
Release files for bluecatipreg 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bluecatipreg-0.0.1.tar.gz | 9.4 kB | Without provenance | Details for bluecatipreg-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bluecatipreg-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for bluecatipreg-0.0.1-py3-none-any.whl |
Total release size: 17.8 kB
Release files / bluecatipreg-0.0.1.tar.gz
| Download URL | bluecatipreg-0.0.1.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
292164fd657287eb28706a994b8fc2a92e11b2ccf6e7a2b6f2c195f4e40fd77d
|
|
BLAKE2b-256 checksum How to use checksums |
ff7efdf82a4004b3639a5a9baa55d63c0736cf84df5198241cdef5ca34df4136
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / bluecatipreg-0.0.1-py3-none-any.whl
| Download URL | bluecatipreg-0.0.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
190b60a60c54f5f0489c2583d7be36a3df4023a1b3c4fa9088e1662c90c14008
|
|
BLAKE2b-256 checksum How to use checksums |
c7a048f4d195cf3b4db02f9df0119fca45b1c7b9402c62537047aebd04c13677
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for bluecatipreg 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.