Skip to main content

CLI to list serial (COM/USB) ports on Windows, Linux & macOS

Project description

🔌 Dircom

CI

Dircom is a lightweight, cross-platform command-line utility written in Python to list available serial (COM) ports on your system, with special emphasis on USB-connected devices. Ideal for developers working with ESP32, Arduino, Raspberry Pi, sensors, and other serial peripherals.


🚀 Features

  • Lists all available serial ports (COM on Windows, /dev/tty* on Unix-like systems)
  • Filters only USB-connected ports (--usb-only)
  • Tags USB ports with [USB]
  • Compatible with Windows, Linux, and macOS
  • Simple, easy-to-use CLI
  • Can be packaged as a standalone executable for Windows

💻 Usage

dircom [options]

Options

Flag Description
-u, --usb-only Show only USB-connected ports
-v, --version Display the current Dircom version
-h, --help Show help message and exit

Examples

dircom
dircom --usb-only
dircom --version

🔧 Installation

From PyPI

pip install dircom

🛠️ Compiling to a Windows Executable

If you want to distribute Dircom without requiring Python:

  1. Install PyInstaller:
    pip install pyinstaller
    
  2. Build the executable:
    pyinstaller --onefile --name dircom dircom.py
    
  3. The standalone executable will be created at:
    dist/dircom.exe
    

🐧 Linux / macOS

Run directly with Python:

python3 dircom.py

Or package with PyInstaller on the target operating system.


📂 Recommended Project Structure

dircom/
├── dircom.py
├── README.md
├── .gitignore
├── requirements.txt
├── setup.py
├── MANIFEST.in
├── LICENSE
└── .github/
    └── workflows/
        └── python-ci.yml

📦 Requirements

Ensure your requirements.txt contains:

pyserial>=3.5

📜 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.


📝 TODO

  • Fully test functionality on Windows
  • Test on Linux (various distributions)
  • Test on macOS
  • Add automated tests (e.g., pytest)
  • Build executables for Linux and macOS
  • Publish GitHub releases

🤝 Contributions

Contributions are welcome! Feel free to open issues or pull requests.


🔗 Author

Nelson Almeida
https://github.com/ncamilo

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

dircom-1.0.2.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

dircom-1.0.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file dircom-1.0.2.tar.gz.

File metadata

  • Download URL: dircom-1.0.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for dircom-1.0.2.tar.gz
Algorithm Hash digest
SHA256 14d60bd88cae0ee2b706b50481f76e93f8c615bbe6746407edc4ee15b2bcb82b
MD5 74f00e6d4825aa7a1eea98470d743d13
BLAKE2b-256 8e90cbb9ec267b190e42e8bf106d63e64fd9a116f34b8504cd24519ba656a268

See more details on using hashes here.

File details

Details for the file dircom-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: dircom-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for dircom-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 059277e545c57fd68c7034ee1c3b500228992754ee80555a85b3781d3a313353
MD5 6926ea554ab5e2c95493201fa0377230
BLAKE2b-256 5d7d31b48cbaede9aef549ff4d9cf7eda7e7f1584520ec6ddbd0429ee6d98338

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