atai-url-tool is a command-line interface (CLI) tool that fetches a URL and determines its content type, mapping it to a simplified type. It’s designed to quickly check the MIME type of a URL and categorize it accordingly.
- Fetch URL Headers: Uses an HTTP GET request to retrieve the
Content-Typeheader. - Simplified Type Mapping: Maps detailed MIME types (e.g.,
application/pdf,audio/mpeg) to simple labels likepdf,mp3, etc. - Easy-to-Use CLI: Run the tool directly from your terminal with a single command.
You can install atai-url-tool via pip (once published on PyPI):
pip install atai-url-toolAlternatively, clone the repository and install it locally:
git clone https://github.com/AtomGradient/atai-url-tool.git
cd atai-url-tool
pip install .Run atai-url-tool from the command line with the URL you want to check:
atai-url-tool https://example.com/sample.pdfThe tool will output the fetched content type and the simplified result. For example:
{"type": "pdf", "path": "https://example.com/sample.pdf"}To contribute or modify atai-url-tool:
-
Clone the repository:
git clone https://github.com/AtomGradient/atai-url-tool.git cd atai-url-tool -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate -
Install the dependencies:
pip install -r requirements.txt
-
Make your changes, write tests, and submit a pull request.
atai-url-tool is released under the MIT License. See the LICENSE file for details.