Copyright Stats Extractor
A lightweight utility package that parses news headlines or short articles about digital copyright enforcement and automatically extracts key statistics such as the number of takedown requests processed, the year, and the entities involved.
The extractor uses a large language model (LLM) under the hood; by default it uses ChatLLM7 from the langchain_llm7 package, but you can plug in any LangChain chat model you prefer.
📦 Installation
pip install copyright_stats_extractor
🚀 Getting Started
from copyright_stats_extractor import copyright_stats_extractor
# Example text to analyse
user_input = """
In 2023, the Digital Society Agency issued 12,000 takedown requests against
unauthorized streaming sites. Major platforms such as StreamTop and IndiePlay
reported compliance with 95% of the requests. These actions were part of
the global crackdown on digital piracy led by the International Digital
Rights Alliance (IDRA).
"""
# Use the default LLM7 implementation
stats = copyright_stats_extractor(user_input)
print(stats)
Output
[ "year: 2023", "takedown_requests: 12,000", "platforms_involved: StreamTop, IndiePlay", "authority: International Digital Rights Alliance (IDRA)" ]
🔌 Using a Custom LLM
You can provide any LangChain chat model. Examples:
OpenAI
from langchain_openai import ChatOpenAI
from copyright_stats_extractor import copyright_stats_extractor
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0.2)
stats = copyright_stats_extractor(user_input, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from copyright_stats_extractor import copyright_stats_extractor
llm = ChatAnthropic(model="claude-3-5-sonnet-20240620", temperature=0.2)
stats = copyright_stats_extractor(user_input, llm=llm)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from copyright_stats_extractor import copyright_stats_extractor
llm = ChatGoogleGenerativeAI(model="gemini-1.5-pro", temperature=0.2)
stats = copyright_stats_extractor(user_input, llm=llm)
Note: Any LangChain-compliant chat model can be supplied via the
llmargument.
⚙️ Configuration
| Parameter | Type | Optional? | Default | Description |
|---|---|---|---|---|
user_input |
str |
Required | – | Text to analyze |
api_key |
Optional[str] |
Yes | None |
API key for the default ChatLLM7. If omitted, the package first looks for the LLM7_API_KEY environment variable, then falls back to "None" (you will get an error if no key). |
llm |
Optional[BaseChatModel] |
Yes | None |
Custom LangChain chat model to use instead of the default ChatLLM7. |
The default ChatLLM7 uses the free tier which is more than adequate for most use cases. For higher throughput, supply a personal API key:
export LLM7_API_KEY="your_api_key_here"
or pass it directly:
stats = copyright_stats_extractor(user_input, api_key="your_api_key_here")
You can obtain a free API key by registering at https://token.llm7.io/.
📄 Documentation of Output
The function returns a list of strings, each string containing a key‑value pair extracted from the input. The keys correspond to the statistics recognized by the model (e.g. year, takedown_requests, platforms_involved, authority). The format of each string is controlled by an internal prompt that enforces a regular‑expression pattern. If you need a different output structure, customize the prompt and the regex accordingly.
📈 Limitations
- The extraction accuracy depends on the quality of the LLM prompt and the input text length.
- The default free tier for ChatLLM7 may impose request limits; if you hit them, upgrade your API key.
🐛 Issues
Please file bugs or feature requests at the GitHub issues tracker:
https://github.com/chigwell/copyright-stats-extractor/issues
📢 Author
- Eugene Evstafev
Email: hi@euegne.plus
GitHub: https://github.com/chigwell
Release files for copyright-stats-extractor 2025.12.22110614
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| copyright_stats_extractor-2025.12.22110614.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| copyright_stats_extractor-2025.12.22110614-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / copyright_stats_extractor-2025.12.22110614.tar.gz
| Download URL | copyright_stats_extractor-2025.12.22110614.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03832f464e0cde7da40f72be7bd0c7889c039bfbd7f0dede414b8b6b33fdbe23
|
|
BLAKE2b-256 checksum How to use checksums |
7800bacb22d06b9d8c6e5d83ef1382f1fdfc97021613f35550195abfd23f0bc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / copyright_stats_extractor-2025.12.22110614-py3-none-any.whl
| Download URL | copyright_stats_extractor-2025.12.22110614-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85bb9f33cddfe6bb95e05c8b915987784f0dcbae555c296e8534d87cd5f8c02e
|
|
BLAKE2b-256 checksum How to use checksums |
769090d1785ec0a91dea8bcefdf2d1ed393fca20fe24e4aad11ccdffa4b027ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|