Metadata-Version: 2.4
Name: tmautils-core
Version: 0.2.0
Summary: Core infrastructure for tmautils
License-Expression: MPL-2.0
License-File: LICENSE
Author: Sulyab Thottungal Valapu
Author-email: sulyabtv@gmail.com
Requires-Python: >=3.13,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: aiohttp (>=3.13.0,<4.0.0)
Requires-Dist: aiolimiter (>=1.1.0,<2.0.0)
Requires-Dist: duckdb (>=1.4.1,<2.0.0)
Requires-Dist: numpy (>=2.0.0,<3.0.0) ; extra == "dev"
Requires-Dist: pandas (>=2.3.0,<3.0.0) ; extra == "dev"
Requires-Dist: pyarrow (>=22.0.0,<23.0.0)
Requires-Dist: pydantic (>=2.12.4,<3.0.0)
Requires-Dist: pytest (>=9.0.0,<10.0.0) ; extra == "dev"
Requires-Dist: pytest-asyncio (>=1.0.0,<2.0.0) ; extra == "dev"
Requires-Dist: pytricia (>=1.2.0,<2.0.0)
Requires-Dist: tenacity (>=9.1.2,<10.0.0)
Project-URL: Repository, https://github.com/sulyabtv/tmautils-core
Description-Content-Type: text/markdown

# tmautils-core
Core infrastructure for the [tmautils](https://github.com/sulyabtv/tmautils) package family.

Installation:
```bash
pip install tmautils-core
```

## `tmautils.core`

| Utility / Function | What it does |
| --- | --- |
| `IOHelper` | Directory structure and logging for utilities |
| `LogHelper` | Logging configuration |
| `AsyncRateLimiter` | Rate limiter with concurrency and throughput limits |
| `RetryConfig` | Configuration for HTTP retry behavior |
| `get_logger_from_helper()` | Get the configured or no-op logger from LogHelper |
| `run_coro_sync()` | Run async code from sync context |
| `request_with_retry()` | HTTP requests with retry and backoff |
| `get_with_retry()` | Convenience wrapper for GET with retry |
| `gzip_file()`, `gunzip_file()` | Compress/decompress a file with gzip |
| `try_convert_ip()` | Try to convert an IP address string to an IP address object |
| `is_ipv4()`, `is_ipv6()` | Check if string is valid IPv4/IPv6 address |

## `tmautils.db`

| Utility / Function | What it does |
| --- | --- |
| `BufferedWriter` | Batched writes to storage backends |
| `DuckDbStore` | DuckDB storage interface |
| `DuckDbBackend` | DuckDB backend for BufferedWriter |
| `DuckLakeStore` | DuckLake storage interface |
| `DuckLakeBackend` | DuckLake backend for BufferedWriter |
| `ParquetBackend` | Parquet backend for BufferedWriter |
| `DuckDbInetLpmIndex` | In-memory LPM index for fast IP lookups |
| `pydantic_to_arrow()` | Convert Pydantic models to Arrow tables |

## License
This project is licensed under [MPL-2.0](LICENSE) (Mozilla Public License 2.0).

What this means in practice:
- If you modify an existing file, your modifications must remain MPL-2.0.
- You can license new files however you want. (But I won't merge them unless they are MPL-2.0.)
- You can use this code alongside code under other licenses.

## Contributing
Contributions are highly welcome! See the [tmautils README](https://github.com/sulyabtv/tmautils/blob/main/README.md) for philosophy and design choices.

AI Policy: I don't consider AI tool usage any different from IDE usage. This also means that *you* are responsible for the code you write and *you* should inspect every line of code written by an LLM.

