Metadata-Version: 2.5
Name: lupaxa-domain-expiry
Version: 0.1.0
Summary: Look up domain name expiration dates over WHOIS.
Project-URL: Homepage, https://domain-expiry.thelupaxaproject.org/
Project-URL: Documentation, https://domain-expiry.thelupaxaproject.org/
Project-URL: Repository, https://github.com/lupaxa-sre-toolbox/domain-expiry
Project-URL: Issues, https://github.com/lupaxa-sre-toolbox/domain-expiry/issues
Author: The Lupaxa Project
License: MIT License
        
        Copyright (c) The Lupaxa Project
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENCE
Keywords: cli,domain,expiration,expiry,sre,whois
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.13
Requires-Dist: prettytable>=3.12
Requires-Dist: python-whois>=0.9
Requires-Dist: tld>=0.13
Provides-Extra: dev
Requires-Dist: bump-my-version>=1.2.0; extra == 'dev'
Requires-Dist: hatch>=1.12.0; extra == 'dev'
Requires-Dist: mkdocs-material==9.7.7; extra == 'dev'
Requires-Dist: mkdocs==1.6.1; extra == 'dev'
Requires-Dist: mypy>=1.12.0; extra == 'dev'
Requires-Dist: pip-audit>=2.7.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-cov>=5.0; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

<!-- markdownlint-disable -->
<p align="center">
  <a href="https://github.com/lupaxa-sre-toolbox">
    <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/organisations/sre-toolbox/readme-logo.png" alt="Project Logo" width="256"/><br/>
  </a>
</p>
<h3 align="center">
  The Lupaxa SRE Toolbox<br />
  Part of The Lupaxa Project
</h3>

<br />

# lupaxa-domain-expiry

Look up domain name expiration dates over WHOIS.

## Features

- Query one or more domain names and print one table
- Read names from a file, or from stdin with `--file -`
- Report the expiration date and the number of days remaining
- Keep every name in the table, including invalid names and timeouts
- Treat a missing registration as available
- Treat a successful lookup with no date as unpublished
- Keep query failures separate from missing dates
- Exit `1` when a domain is due within `--warn-days`
- Sort the table by domain, date, or days, ascending or descending
- Use the `lookup` library API
- Depend on `python-whois`, `prettytable`, and `tld` at runtime

## Installation

### From PyPI

```bash
pip install lupaxa-domain-expiry
```

### From source (development mode)

```bash
pip install -e ".[dev]"
```

Requires Python 3.13+.

## Library quick start

```python
from lupaxa.domain_expiry import lookup

result = lookup("example.com", timeout=10.0)
print(result.domain, result.status, result.days_remaining)
```

## CLI quick start

```bash
domain-expiry --help
domain-expiry example.com example.org
domain-expiry --file domains.txt --warn-days 14 --timeout 5
```

You can also run the CLI as a module:

```bash
python -m lupaxa.domain_expiry --help
python -m lupaxa.domain_expiry --version
```

## Options

- `DOMAIN`: one or more domain names
- `--file`, `-f`: text file of domain names, one per line; `-` reads stdin
- `--timeout`, `-t`: WHOIS socket timeout in seconds; default `10`
- `--warn-days`, `-w`: exit `1` when a domain expires within this many days; default `30`
- `--sort`, `-s`: sort by `domain`, `date`, or `days`
- `--order`: `ascending` or `descending` (default `ascending`); requires `--sort`
- `--version`: print the package version

## Documentation

Online documentation:

[Documentation](https://domain-expiry.thelupaxaproject.org/)

Source repository:

[GitHub](https://github.com/lupaxa-sre-toolbox/domain-expiry)

### Serve docs locally

From a clone of the repository:

```bash
make mkdocs-serve
```

Then open the local URL printed by MkDocs in your browser.

## Development

Clone the repository and install with Make:

```bash
make init                # first-time makefile-skills checkout
make python-install-dev  # editable install with [dev]
make python-check        # lint, type-check, and test
```

<a href="https://github.com/the-lupaxa-project">
    <img src="https://raw.githubusercontent.com/the-lupaxa-project/brand-assets/master/logos/components/footer-for-child-orgs.svg" alt="The Lupaxa Project Footer" width="100%" />
</a>
