Skip to content

Commit

Permalink
Second release (v1.0.1). Updated name from pow_law to pow-law to matc…
Browse files Browse the repository at this point in the history
…h PyPI convention.
  • Loading branch information
Chancellor-1 committed Oct 10, 2024
1 parent f48cfd3 commit 84cbacc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Please make sure Python (>=3.8) is installed. If not, go to e.g. Microsoft Store
> py -m venv .venv
> .venv\Scripts\activate
(.venv) > py -m pip install --upgrade pip
(.venv) > py -m pip install pow_law
(.venv) > py -m pip install pow-law
```

After installation you can execute this tool with e.g. flag `-h` (for showing its use):
```
(.venv) > pow_law -h
(.venv) > pow-law -h
```

Deactivate the Python virtual environment when you're done:
Expand All @@ -33,7 +33,7 @@ Deactivate the Python virtual environment when you're done:
Don't forget to re-activate the Python virtual environment (from the installation directory) when you want to use this tool again:
```
> .venv\Scripts\activate
(.venv) > pow_law -h
(.venv) > pow-law -h
```

#### Ubuntu (>=20.04)
Expand All @@ -47,17 +47,17 @@ and/or
$ python3 -m ensurepip --default-pip
```

Next, install the `pow_law` tool with:
Next, install the `pow-law` tool with:
```
$ python3 -m venv .venv
$ source .venv/bin/activate
(.venv) $ python3 -m pip install --upgrade pip
(.venv) $ python3 -m pip install pow_law
(.venv) $ python3 -m pip install pow-law
```

After installation you can execute this tool with e.g. flag `-h` (for showing its use):
```
(.venv) $ pow_law -h
(.venv) $ pow-law -h
```

Deactivate the Python virtual environment when you're done:
Expand All @@ -68,12 +68,12 @@ Deactivate the Python virtual environment when you're done:
Don't forget to re-activate the Python virtual environment (from the installation directory) when you want to use this tool again:
```
$ source .venv/bin/activate
(.venv) $ pow_law -h
(.venv) $ pow-law -h
```

### From the Github repository

Go to the [pow_law github repository](https://github.com/Chancellor-1/power_law), click the green `<> Code` button, click `Download ZIP` and extract the ZIP archive, or open a terminal / command prompt and execute: `git clone https://github.com/Chancellor-1/power_law.git` (for this Git needs to be installed).
Go to the [pow-law github repository](https://github.com/Chancellor-1/power_law), click the green `<> Code` button, click `Download ZIP` and extract the ZIP archive, or open a terminal / command prompt and execute: `git clone https://github.com/Chancellor-1/power_law.git` (for this Git needs to be installed).

#### Windows (>=10)

Expand Down Expand Up @@ -118,27 +118,27 @@ Below examples assume you've activated the Python virtual environment that you u

1. To show the Bitcoin price (`-b`), together with its regression line (`-r`) and extend its trendlines for 5 future years (`-y 5`) on a log-log chart (`-s loglog`, which is the default) do:
```
(.venv) $ pow_law -b -r -y 5
(.venv) $ pow-law -b -r -y 5
```

2. To show the Kaspa price (`-k`) on a log-linear chart (`-s loglin`) and extend its trendlines for 8 years (`-y 8`, which is the default) and update it's price via CoinAPI (`-u`, for this you need a valid CoinAPI license; see paragraph `Updating prices` below)
```
(.venv) $ pow_law -k -s loglin -u
(.venv) $ pow-law -k -s loglin -u
```

3. To show the Ethereum price (`-e`), together with its regression line (`-r`) and no future years (`-y 0`) on a regular linear chart (`-s linlin`) do:
```
(.venv) $ pow_law -e -r -y 0 -s linlin
(.venv) $ pow-law -e -r -y 0 -s linlin
```

4. To show the year-over-year return on investment (`-a`) for all assets for 15 future years (`-y 15`) on a regular linear chart (`-s linlin`) do:
```
(.venv) $ pow_law -a -y 15 -s linlin
(.venv) $ pow-law -a -y 15 -s linlin
```

5. To show the regression results and the $R^2$ over time for all assets (`-r2`) on a linear chart (only option for this mode) do:
```
(.venv) $ pow_law -r2 -s linlin
(.venv) $ pow-law -r2 -s linlin
```

For more advanced settings please take a look at the `./power_law/config/config.yaml` file. From this configuration file the trendlines can be updated and graph settings can be adjusted (e.g. resolution, line widths, YoY ROI start year etc.).
Expand All @@ -147,7 +147,7 @@ For more advanced settings please take a look at the `./power_law/config/config.

Price data for all assets can be updated via CoinAPI, but you need a valid license for this. You can obtain a (free) CoinAPI license from [coinapi.io](https://www.coinapi.io/get-free-api-key?product_id=market-data-api). Once you have a CoinAPI license code, execute below (the X's represent your license code; make sure to include the hyphens):
```
(.venv) $ pow_law -l XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
(.venv) $ pow-law -l XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
```

After this, the price data for the selected asset (`-b` for Bitcoin, `-k` for Kaspa, `-e` for Ethereum, `-a` for all assets) can be updated by adding the `-u` flag.
Expand Down
4 changes: 2 additions & 2 deletions power_law/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class Config:

def __init__(self):
""" Constructor for the Config class. """
self.parser = argparse.ArgumentParser(prog='pow_law',
self.parser = argparse.ArgumentParser(prog='pow-law',
description="This tool can visualize the Bitcoin, Kaspa or Ethereum price together with "
"its power law price channel, among other related functionality.")
self.parser.add_argument('-v', '--version', action='version', version=version('pow_law'))
self.parser.add_argument('-v', '--version', action='version', version=version('pow-law'))
self.parser.add_argument('-u', '--update', action='store_true',
help="Update price data of selected asset(s) ('-b', '-k', '-e' or '-a') via CoinAPI "
"(valid CoinAPI license needed).")
Expand Down
2 changes: 1 addition & 1 deletion power_law/visualization/common_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ def set_legend(ax: plt.Axes, line_width: float):
def show():
""" This function shows the plot in a window with tight layout and uniform title for all plots. """
plt.tight_layout()
plt.get_current_fig_manager().set_window_title("Power Law v" + version('pow_law'))
plt.get_current_fig_manager().set_window_title("Power Law v" + version('pow-law'))
plt.show()
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
long_description = (this_directory / "README.md").read_text()

setup(
name='pow_law',
version='1.0.0',
name='pow-law',
version='1.0.1',
packages=find_packages(),
include_package_data=True,
url='https://github.com/Chancellor-1/power_law',
Expand All @@ -28,7 +28,7 @@
python_requires='>=3.8, <4',
entry_points={
'console_scripts': [
'pow_law=power_law.__main__:main'
'pow-law=power_law.__main__:main'
]
}
)

0 comments on commit 84cbacc

Please sign in to comment.