Metadata-Version: 2.4
Name: dmcaed
Version: 2026.4.18
Summary: Check if a software URL is found in takedown notices.
Project-URL: Homepage, https://codeberg.org/canarduck/dmcaed
Project-URL: Issues, https://codeberg.org/canarduck/dmcaed/issues
Author-email: Renaud Canarduck <renaud@canarduck.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Provides-Extra: tests
Requires-Dist: coverage; extra == 'tests'
Description-Content-Type: text/markdown

# DMCAed

A command-line tool to analyze GitHub DMCA takedown notices. It downloads, parses, and
indexes takedown data from the [GitHub DMCA repository](https://github.com/github/dmca)
to allow querying **which repository URL can be found** in takedown requests, please
note that this only means the repository URL _might_ have been subject to takedown
requests.

## Installation

DMCAed requires at least python 3.11.

```bash
pip install dmcaed
```

## CLI

```bash
dmcaed [--verbose] [command]
```

### Commands

- `download`: Download the latest DMCA notices from GitHub
- `analyze`: Parse downloaded notices and extract takedown data
- `db`: Rebuild the complete DMCA database (download + analyze)
- `stats`: Show statistics about the database content
- `notices <url>`: List takedown notices for a specific repository URL

### Options

- `--verbose`: Enable debug logging
- `-h`, `--help`: Show help message

## Library Usage

```python
from dmcaed import DMCAed

dmca = DMCAed()
notices = dmca.notices("https://github.com/user/repo")

if notices:
    print(f"https://github.com/user/repo _might_ be subject to a takedown: {notices}")
```

## How it works

- Download the latest DMCA notices from GitHub
- Extract repository URLs (path to files, issues, releases, etc. are truncated)
  mentioned in takedown notices
- Build a local SQLite database mapping repository URLs to takedown notices

## Build and Release

### Prerequisites

The project uses `hatch` build system and dynamic CalVer versioning based on the 
current date.

```bash
pip install hatch hatch-calver
```

Git clone and install DMCAed.

```bash
git clone ssh://git@codeberg.org/canarduck/dmcaed.git
pip install -e .
```

### Update the package and publish it on PyPI

You first need to fetch DMCAs and create/update the database.

```bash
dmcaed db
```

Then use hatch to update version number and build the package.

```bash
hatch version release
# use `hatch version release,fix` in case you need to fix an already released package
```

Build the package and publish it on PyPI.

```bash
hatch build
hatch publish  --auth PYPI_AUTH_TOKEN
```