Metadata-Version: 2.4
Name: content-types
Version: 0.2.0
Summary: A library to map file extensions to content types and vice versa.
Author-email: Michael Kennedy <mikeckennedy@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: content-type,file extensions,mapping,mime
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <=3.14,>=3.10
Description-Content-Type: text/markdown


# content-types 🗃️🔎

A Python library to map file extensions to MIME types. 
It also provides a CLI for quick lookups right from your terminal.
If no known mapping is found, the tool returns `application/octet-stream`.

## Installation

```bash
uv pip install content-types
```

## Usage

```python
import content_types

# Forward lookup: filename -> MIME type
mime_type = content_types.get_content_type("example.jpg")
print(mime_type)  # "image/jpeg"

# For very common files, you have shortcuts:
print(f'Content-Type for webp is {content_types.webp}') # 'image/webp'
```

## CLI

After installing in a virtual environment or system-wide.

```bash
contenttypes example.jpg

# Outputs image/jpeg
```

## Contributing

Contributions are welcome! Check out [the GitHub repo](https://github.com/mikeckennedy/content-types) 
for more details on how to get involved.
