Skip to main content

Official Python client for IPForge (IPAM that pushes DNS/DHCP config).

Project description

ipforge-client

Official Python client for IPForge — IPAM that pushes DNS/DHCP config. Sync, typed, one dependency (requests).

Install

pip install ipforge-client

Quickstart

from ipforge_client import IPForge

client = IPForge("https://ipforge.example.com", token="ipfg_...")
# or rely on IPFORGE_URL / IPFORGE_TOKEN env vars: IPForge()

# List (auto-paginates across pages, yields typed models)
for addr in client.addresses.list(subnet_id=3, status="assigned"):
    print(addr.address, addr.hostname)

# Single page with total
page = client.addresses.list_page(limit=50, offset=0, subnet_id=3)
print(page.total, [a.address for a in page])

# Allocate the next free IP, registering DNS
result = client.subnets.allocate(3, hostname="web-01", register_dns=True, dns_zone="example.com")
print(result["address"])

# Create a DNS record
client.dns.create_record("example.com", name="web-01", record_type="A", value=result["address"])

# Audit log (cursor-paginated)
for entry in client.audit.list(username="admin"):
    print(entry.action, entry.resource_type)

Errors

All errors derive from ipforge_client.IPForgeError: AuthError (401), ForbiddenError (403, incl. read-only token writing), NotFoundError (404), ConflictError (409), ValidationError (422, see .detail), ServerError (5xx), TransportError (network/timeout).

Notes

  • Sync only. An async client (httpx-based) is a possible future addition.
  • Models expose known fields as typed properties and keep the full payload on .raw, so new API fields never break the client.
  • Targets the IPForge /api/v1 API.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipforge_client-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipforge_client-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file ipforge_client-0.1.0.tar.gz.

File metadata

  • Download URL: ipforge_client-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ipforge_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccbc9b83871051d7fa66ec86c1d9a6510c597e00ea1c2188f450d22a787c1eaa
MD5 c20f230cff7e47f9b9685348ba8c2349
BLAKE2b-256 0f9409901de36c65da260326338581de3e72169f2a087b7e160038f3134c80b4

See more details on using hashes here.

File details

Details for the file ipforge_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ipforge_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ipforge_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd4e6a001e5eabf254ba61db2e95610872f0ac79f25f84f6d0d06265fd1078fd
MD5 9dcfe967f55e808c6d5b4da8ef32237b
BLAKE2b-256 c61c25b1850c3a27d64294dfb42c12c7aa8d43b86b2b39e52a8a7ae7684cb291

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page