Crates.io | cryptocurrency_parser |
lib.rs | cryptocurrency_parser |
version | 0.1.1 |
source | src |
created_at | 2024-11-13 14:40:41.479358 |
updated_at | 2024-11-13 14:59:16.049921 |
description | A parser of different cryptocurrencies |
homepage | |
repository | https://github.com/Bogunok/cryptocurrency_parser |
max_upload_size | |
id | 1446588 |
size | 56,129 |
This project implements a parser that parses data of different types of cryptocurrencies, such as ETH, SOL, BTC etc.
The parser reades structured data from a file using grammar rules and then outputs parsed result to a json file.
WHITESPACE = _{ " " | "\t" | "\n" }
digit = _{ ASCII_DIGIT }
year = { digit ~ digit ~ digit ~ digit }
month = { digit ~ digit }
day = { digit ~ digit }
date = @{ (day ~ "." ~ month ~ "." ~ year) | (month ~ "/" ~ day ~ "/" ~ year) }
blockchain_name = @{ "SOL" | "BTC" | "ETH" }
currency = @{ "USD" | "EUR" | "UAH" }
number = @{ ASCII_DIGIT+ ~ ("," ~ ASCII_DIGIT{3})* ~ ("." ~ ASCII_DIGIT+)? }
number_and_currency = @{number ~ WHITESPACE ~ currency}
entry = ${name ~ WHITESPACE ~ date_entry ~ WHITESPACE ~ open ~ WHITESPACE ~ close ~ WHITESPACE ~ high ~ WHITESPACE ~ low ~ WHITESPACE ~ volume}
name = ${ "Name:" ~ WHITESPACE ~ blockchain_name ~ ";"}
date_entry = ${ "Date:" ~ WHITESPACE ~ date ~ ";"}
open = ${ "Open:" ~ WHITESPACE ~ number_and_currency ~ ";"}
close = ${ "Close:" ~ WHITESPACE ~ number_and_currency ~ ";"}
high = ${ "High:" ~ WHITESPACE ~ number_and_currency ~ ";"}
low = ${ "Low:" ~ WHITESPACE ~ number_and_currency ~ ";"}
volume = ${ "Volume:" ~ WHITESPACE ~ number_and_currency ~ ";"}
This command reads data from the input file, parses it, and saves the results in the specified output file in JSON format. It takes two arguments: <input_file> — the path to the input file containing data to parse (e.g., data.txt). <output_file> — the path to the output JSON file where the parsed results will be saved (e.g., output.json).
Displays helpful information on how to use the program and the available commands. It describes the input format required for the parse command and provides an example of the data structure that can be parsed.
Shows information about the project`s name and author of the program.
This parser can be used in applications related to blockchain and financial data processing
The parser can be used to extract structured data from text files or logs that record blockchain or cryptocurrency market data. This is useful for preparing datasets for further analysis or storage in databases
The parser can be used to read historical blockchain data from files and convert it into a structured format, such as CSV. Analysts can then use this data to identify trends, patterns, or perform time-series analysis
This parser can be utilized in applications that help manage cryptocurrency portfolios by parsing data that includes market metrics like open, close, high, and low prices, and volumes for specific dates