Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit 56cfb44

Browse files
improved code readability, changed create fn to new, added colorswap and list fn
1 parent 2cb8f6b commit 56cfb44

File tree

13 files changed

+425
-240
lines changed

13 files changed

+425
-240
lines changed

.rpm/zigfi.spec

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
%define __spec_install_post %{nil}
2+
%define __os_install_post %{_dbpath}/brp-compress
3+
%define debug_package %{nil}
4+
5+
Name: zigfi
6+
Summary: zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets you're watching easily into watchlists.
7+
Version: @@VERSION@@
8+
Release: @@RELEASE@@%{?dist}
9+
License: AGPLv3+
10+
Group: Applications/System
11+
Source0: %{name}-%{version}.tar.gz
12+
URL: https://github.com/aldrinzigmundv/zigfi
13+
14+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
15+
16+
%description
17+
%{summary}
18+
19+
%prep
20+
%setup -q
21+
22+
%install
23+
rm -rf %{buildroot}
24+
mkdir -p %{buildroot}
25+
cp -a * %{buildroot}
26+
27+
%clean
28+
rm -rf %{buildroot}
29+
30+
%files
31+
%defattr(-,root,root,-)
32+
%{_bindir}/*

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "zigfi"
33
description = "zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets you're watching easily into watchlists."
4-
version = "0.1.0"
4+
version = "1.0.0"
55
authors = ["Aldrin Zigmund Cortez Velasco <aldrinzigmund@tutamail.com>"]
66
license = "AGPL-3.0-or-later"
77
edition = "2021"
@@ -14,10 +14,19 @@ keywords = ["finance", "stock", "cli", "app", "crypto"]
1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515

1616
[dependencies]
17-
zigarg = "1.0.0"
17+
zigarg = "1.1.0"
1818
tokio = { version = "1.15.0", features = ["full"] }
1919
confy = "0.4.0"
2020
serde = { version = "1.0.132", features = ["derive"] }
2121
crossterm = "0.22.1"
2222
yahoo_finance_api = "1.2.2"
23-
chrono = "0.4.19"
23+
chrono = "0.4.19"
24+
25+
[package.metadata.rpm]
26+
package = "zigfi"
27+
28+
[package.metadata.rpm.cargo]
29+
buildflags = ["--release"]
30+
31+
[package.metadata.rpm.targets]
32+
zigfi = { path = "/usr/bin/zigfi" }

PKGBUILD

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Maintainer: Aldrin Zigmund Cortez Velasco <aldrinzigmund@tutamail.com>
2+
#
3+
# This PKGBUILD was generated by `cargo aur`: https://crates.io/crates/cargo-aur
4+
5+
pkgname=zigfi-bin
6+
pkgver=1.0.0
7+
pkgrel=1
8+
pkgdesc="zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets you're watching easily into watchlists."
9+
url="https://github.com/aldrinzigmundv/zigfi"
10+
license=("AGPL-3.0-or-later")
11+
arch=("x86_64")
12+
provides=("zigfi")
13+
conflicts=("zigfi")
14+
source=("https://github.com/aldrinzigmundv/zigfi/releases/download/v$pkgver/zigfi-$pkgver-x86_64.tar.gz")
15+
sha256sums=("dd98bd272ac84700e546cd7466ce2ffc774209d38d6d9bbbedd05fe30afa62a9")
16+
17+
package() {
18+
install -Dm755 zigfi -t "$pkgdir/usr/bin"
19+
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
20+
}

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
![Alt text](screenshots/1.png?raw=true "Screenshot 1")
44
![Alt text](screenshots/2.png?raw=true "Screenshot 2")
55

6-
zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets you're watching easily into watchlists.
6+
zigfi is an open-source stocks, commodities and cryptocurrencies price monitoring CLI app, written fully in Rust, where you can organize assets you're watching into watchlists for easy access on the terminal.
77

8-
This used to be just a personal app of mine until I decided to share it. The app only consisted of a few hours of coding and is meant to just work, instead of being a community developed app, so there are a lot of issues with the code regarding readability, repetitions, inconsistency, error handling and stuff.
8+
This used to be just a personal app of mine until I decided to share it. I'm looking forward to adding more features in the future.
99

10-
I'll try to improve it as soon as possible. Also, I'm planning to add additional features, like news and maybe trading on the app itself in the future. Please, don't hesitate to file any issues if there are any bugs or suggest features.
10+
Also, I haven't tested the app yet with Windows but exe release is available if anyone wants to try. This is made mainly for GNU/Linux operating systems.
1111

12-
I haven't tested the app yet with Windows but exe release is available if anyone wants to try.
13-
14-
Also, the app gets its data from the Yahoo Finance API.
12+
The app gets its data from the Yahoo Finance API.
1513

1614
## Quickstart
1715
Here are the things you can do:
1816
```
17+
zigarg (shows "default" watchlist)
18+
zigarg new <watchlist name> <optional: ticker/s>
1919
zigarg show <watchlist name>
20-
zigarg create <watchlist name> <optional: ticker/s>
2120
zigarg delete <watchlist name>
22-
zigarg add <watchlistname> <ticker/s>
23-
zigarg remove <watchlist> <ticker/s>
21+
zigarg add <watchlist name> <ticker/s>
22+
zigarg remove <watchlist name> <ticker/s>
2423
zigarg search <name of asset>
25-
zigarg list
24+
zigarg list (lists saved watchlist/s)
25+
zigarg colorswap (swaps Green and Red for some East Asian users)
2626
zigarg help
2727
```
2828

screenshots/1.png

13.6 KB
Loading

screenshots/2.png

11.2 KB
Loading

src/format.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![forbid(unsafe_code)]
2+
3+
pub fn prcnt(n1: f64, n2: f64) -> f64 {
4+
//(n1 - n2 / (n1 + n2/ 2_f64)) * 100
5+
let sub = n1 - n2;
6+
let add = n1 + n2;
7+
let div = add / 2_f64;
8+
sub / div * 100_f64
9+
}
10+
11+
pub fn reduc(num: f64) -> f64 {
12+
(num * 100.0).round() / 100.0
13+
}

0 commit comments

Comments
 (0)