uri-register 0.3.0

A high-performance PostgreSQL-backed URI dictionary service for assigning unique integer IDs to URIs
Documentation
"""
URI Register - A high-performance PostgreSQL-backed URI to ID mapping service

This library provides a bidirectional mapping between URIs (strings) and integer IDs,
optimized for batch operations and designed for use in distributed systems.

Example (synchronous):
    >>> from uri_register import UriRegister
    >>>
    >>> # Connect to PostgreSQL
    >>> register = UriRegister(
    ...     "postgres://localhost/mydb",
    ...     "uri_register",  # table_name
    ...     20,              # max_connections
    ...     10000            # cache_size
    ... )
    >>>
    >>> # Register a single URI
    >>> id = register.register_uri("http://example.org/resource/1")
    >>> print(f"Registered with ID: {id}")
    >>>
    >>> # Register multiple URIs in batch (much faster!)
    >>> uris = [
    ...     "http://example.org/resource/2",
    ...     "http://example.org/resource/3",
    ... ]
    >>> ids = register.register_uri_batch(uris)
    >>>
    >>> # Get statistics
    >>> stats = register.stats()
    >>> print(f"Total URIs: {stats['total_uris']}")

Example (asynchronous):
    >>> import asyncio
    >>> from uri_register import UriRegister
    >>>
    >>> async def main():
    ...     # Connect to PostgreSQL
    ...     register = await UriRegister.new_async(
    ...         "postgres://localhost/mydb",
    ...         "uri_register",  # table_name
    ...         20,              # max_connections
    ...         10000            # cache_size
    ...     )
    ...
    ...     # Register a single URI
    ...     id = await register.register_uri_async("http://example.org/resource/1")
    ...     print(f"Registered with ID: {id}")
    ...
    ...     # Register multiple URIs in batch (much faster!)
    ...     uris = [
    ...         "http://example.org/resource/2",
    ...         "http://example.org/resource/3",
    ...     ]
    ...     ids = await register.register_uri_batch_async(uris)
    ...
    ...     # Get statistics
    ...     stats = await register.stats_async()
    ...     print(f"Total URIs: {stats['total_uris']}")
    >>>
    >>> asyncio.run(main())
"""

from ._uri_register import UriRegister

__version__ = "0.2.0"
__all__ = ["UriRegister"]