opml2csv
is a command-line tool written in Go for converting a Feedly OPML (Outline Processor Markup Language) file into CSV.
This tool extracts feed information defined in a Feedly OPML file and structures it into a tabular, CSV-friendly format.
- Efficient conversion of a Feedly OPML file to CSV.
- Command-line arguments that make input and output handling simple.
- Automatic generation of CSV headers.
- Validation of Feedly OPML input files.
- Options to display help and version information.
- Go SDK 1.23.4 (or a more recent version).
- A Feedly OPML file containing structured feed information (feeds, URLs, etc.).
-
Clone the repository:
git clone https://github.com/Kharec/opml2csv.git cd opml2csv
-
Build the project:
go build -o opml2csv
-
Push it into a bin directory in your
$PATH
:mv ompl2csv ~/bin # for example
opml2csv [OPTIONS]
Option | Description |
---|---|
-h , --help |
Displays help with usage information. |
-v , --version |
Displays the current version of the tool. |
-i , --input |
Path to the OPML file to be converted. |
-o , --output |
Path to the generated CSV file (default: ./export.csv ). |
-
Display help:
./opml2csv -h
-
Convert an OPML file (
feeds.opml
) to CSV (feeds.csv
):./opml2csv -i feeds.opml -o feeds.csv
-
Display the version of the tool:
./opml2csv -v
The project is organized as follows:
opml2csv/
├── internal/
│ ├── flags/ # Handles command-line arguments
│ │ ├── parse.go # Parsing of options (input, output, etc.)
│ │ ├── manage.go # Functions for handling help, version, validation
│ │ ├── help.go # Function to display the help text
│ └── utils/ # Utilities for file processing
│ ├── parsers.go # Parses OPML lines into Outline structs
│ ├── builders.go # Builds CSV headers and lines
│ ├── types.go # Defines structured types (e.g., Outline)
│ └── version.go # Manages the application version
├── opml2csv.go # Main code (entry point for the application)
- Reading the OPML File: OPML files contain structured lists of feeds in XML format.
- Parsing: Relevant OPML lines containing structured data are extracted.
- CSV Validation and Generation: Feed information is processed and converted into a cleanly formatted CSV file.
Contributions, bug reports, and feature requests are welcome! Feel free to submit an issue or a pull request on the GitHub repository.
This project is licensed under the MIT License. You are free to use, modify, and distribute the project.