Skip to main content

A CLI tool to check a URL's content type and map it to a simplified type.

Project description

atai-url-tool

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.

Features

  • Fetch URL Headers: Uses an HTTP GET request to retrieve the Content-Type header.
  • Simplified Type Mapping: Maps detailed MIME types (e.g., application/pdf, audio/mpeg) to simple labels like pdf, mp3, etc.
  • Easy-to-Use CLI: Run the tool directly from your terminal with a single command.

Installation

You can install atai-url-tool via pip (once published on PyPI):

pip install atai-url-tool

Alternatively, clone the repository and install it locally:

git clone https://github.com/AtomGradient/atai-url-tool.git
cd atai-url-tool
pip install .

Usage

Run atai-url-tool from the command line with the URL you want to check:

atai-url-tool https://example.com/sample.pdf

The tool will output the fetched content type and the simplified result. For example:

{"type": "pdf", "path": "https://example.com/sample.pdf"}

Development

To contribute or modify atai-url-tool:

  1. Clone the repository:

    git clone https://github.com/AtomGradient/atai-url-tool.git
    cd atai-url-tool
    
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate
    
  3. Install the dependencies:

    pip install -r requirements.txt
    
  4. Make your changes, write tests, and submit a pull request.

License

atai-url-tool is released under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atai_url_tool-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atai_url_tool-0.0.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file atai_url_tool-0.0.1.tar.gz.

File metadata

  • Download URL: atai_url_tool-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for atai_url_tool-0.0.1.tar.gz
Algorithm Hash digest
SHA256 31f224ad0607768b7bf4b03978c6e974db0367cd4edd0ecf667c2e728201c71e
MD5 1e089987e63ccac3c916ad14878c83a5
BLAKE2b-256 6100762ba1f6fe07e613dccf7252561d9bc768c5c143c9985e668d7a3066a84e

See more details on using hashes here.

File details

Details for the file atai_url_tool-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: atai_url_tool-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for atai_url_tool-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 82c337e7975ee10e580209c6f5e94419e846f03aaaf062e109ef0a6d9beed1c4
MD5 f34550a5242b3f930bcac253dcb1617c
BLAKE2b-256 dc91fc3fa4f00d0d6c08cec37527764fa988016cb0b30b9c613369bc6714ed46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page