Skip to content

Commit 2ae8dec

Browse files
committed
new docs
1 parent 3a24eda commit 2ae8dec

11 files changed

Lines changed: 209 additions & 1415 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
1818
strategy:
1919
matrix:
20-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
20+
python-version: ["3.11", "3.12", "3.13", "3.14"]
2121

2222
steps:
2323
- uses: actions/checkout@v4
@@ -50,16 +50,14 @@ jobs:
5050
- build
5151
steps:
5252
- uses: actions/checkout@v4
53-
- name: Set up Python 3.12
54-
uses: actions/setup-python@v5
55-
with:
56-
python-version: "3.14"
57-
- name: Install all dev dependencies
58-
run: make install-dev
59-
- name: build book
60-
run: make book
61-
- name: publish book
62-
run: make publish-book
53+
- name: Install uv
54+
uses: astral-sh/setup-uv@v5
55+
- name: Install dependencies
56+
run: uv sync --all-extras --group book
57+
- name: build docs
58+
run: make docs
59+
- name: publish docs
60+
run: make publish-docs
6361
- name: publish
6462
if: ${{ github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release' }}
6563
run: make publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ build
1616
docs/build
1717
htmlcov
1818
dist
19+
site
1920
venv
2021
MANIFEST
2122
.python-version

Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ clean: ## Remove python cache files
1212
rm -rf .pytest_cache
1313
rm -rf .coverage
1414

15-
.PHONY: docs
16-
docs: ## Build docs
17-
cd docs && make docs
18-
1915
.PHONY: install-dev
2016
install-dev: ## Install packages for development
2117
@./dev/install
@@ -36,17 +32,17 @@ test: ## Test with python 3.8 with coverage
3632
publish: ## Release to pypi
3733
@uv build && uv publish --token $(PYPI_TOKEN)
3834

39-
.PHONY: notebook
40-
notebook: ## Run Jupyter notebook server
41-
@uv run ./dev/start-jupyter 9095
35+
.PHONY: docs
36+
docs: ## Build mkdocs site
37+
uv run mkdocs build
4238

43-
.PHONY: book
44-
book: ## Build static jupyter {book}
45-
uv run jupyter-book build docs --all
39+
.PHONY: docs-serve
40+
docs-serve: ## Serve docs locally with live reload
41+
uv run mkdocs serve
4642

47-
.PHONY: publish-book
48-
publish-book: ## Publish the book to github pages
49-
uv run ghp-import -n -p -f docs/_build/html
43+
.PHONY: publish-docs
44+
publish-docs: ## Publish docs to github pages
45+
uv run mkdocs gh-deploy
5046

5147
.PHONY: outdated
5248
outdated: ## Show outdated packages

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ccy.quantmind.com

docs/_config.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/_toc.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/dates.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,26 @@
1-
---
2-
jupytext:
3-
text_representation:
4-
extension: .md
5-
format_name: myst
6-
format_version: 0.13
7-
jupytext_version: 1.14.7
8-
kernelspec:
9-
display_name: Python 3 (ipykernel)
10-
language: python
11-
name: python3
12-
---
13-
141
# Dates & Periods
152

16-
The module is shipped with a ``date`` module for manipulating time periods and
17-
converting dates between different formats. Th *period* function can be use
18-
to create ``Period`` instanc.::
3+
The module is shipped with a `date` module for manipulating time periods and
4+
converting dates between different formats. The *period* function can be used
5+
to create `Period` instances:
196

20-
```{code-cell} ipython3
7+
```python
218
import ccy
229
p = ccy.period("1m")
2310
p
2411
```
2512

26-
```{code-cell} ipython3
13+
```python
2714
p += "2w"
2815
p
2916
```
3017

31-
```{code-cell} ipython3
18+
```python
3219
p += "3m"
3320
p
3421
```
3522

36-
```{code-cell} ipython3
37-
p -= "1w"
38-
p
39-
```
40-
41-
```{code-cell} ipython3
42-
p -= "1w"
43-
p
44-
```
45-
46-
```{code-cell} ipython3
23+
```python
4724
p -= "1w"
4825
p
4926
```
50-
51-
```{code-cell} ipython3
52-
53-
```
Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
---
2-
jupytext:
3-
text_representation:
4-
extension: .md
5-
format_name: myst
6-
format_version: 0.13
7-
jupytext_version: 1.14.7
8-
kernelspec:
9-
display_name: Python 3 (ipykernel)
10-
language: python
11-
name: python3
12-
---
13-
141
# Python CCY
152

163
## Getting Started
@@ -21,7 +8,7 @@ pip install ccy
218
```
229
* display currencies
2310

24-
```{code-cell} ipython3
11+
```python
2512
import ccy
2613
import pandas as pd
2714
df = pd.DataFrame(ccy.dump_currency_table())
@@ -30,78 +17,69 @@ df.head(80)
3017

3118
## Main Usage
3219

33-
```{code-cell} ipython3
20+
```python
3421
import ccy
3522
eur = ccy.currency("aud")
3623
eur.printinfo()
3724
```
3825

3926
a currency object has the following properties:
40-
* *code*: the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) three letters codee.
41-
* *twoletterscode*: two letter crg.
27+
* *code*: the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) three letters code.
28+
* *twoletterscode*: two letter code.
4229
* *default_country*: the default [ISO 3166-1 alpha_2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code for the currency.
4330
* *isonumber*: the ISO 4217 number.
4431
* *name*: the name of the currency.
4532
* *order*: default ordering in currency pairs (more of this below).
4633
* *rounding*: number of decimal places
4734

48-
+++
49-
5035
## Currency Crosses
5136

37+
You can create currency pairs by using the `currency_pair` function:
5238

53-
You can create currency pairs by using the ``currency_pair`` functn::
54-
55-
```{code-cell} ipython3
39+
```python
5640
c = ccy.currency_pair("eurusd")
5741
c
5842
```
5943

60-
```{code-cell} ipython3
44+
```python
6145
c.mkt()
6246
```
6347

64-
```{code-cell} ipython3
48+
```python
6549
c = ccy.currency_pair("chfusd")
66-
c
67-
```
68-
69-
```{code-cell} ipython3
7050
c.mkt() # market convention pair
7151
```
7252

7353
## cross & crossover
7454

7555
Some shortcuts:
7656

77-
```{code-cell} ipython3
57+
```python
7858
ccy.cross("aud")
7959
```
8060

81-
```{code-cell} ipython3
61+
```python
8262
ccy.crossover('eur')
8363
```
8464

85-
```{code-cell} ipython3
65+
```python
8666
ccy.crossover('chf')
8767
```
8868

89-
```{code-cell} ipython3
69+
```python
9070
ccy.crossover('aud')
9171
```
9272

9373
Note, the Swiss franc cross is represented as 'USD/CHF', while the Aussie Dollar and Euro crosses are represented with the USD as denominator. This is the market convention which is handled by the order property of a currency object.
9474

95-
+++
96-
9775
## Eurozone
9876

9977
The euro area, commonly called the eurozone (EZ), is a currency union of 20 member states of the European Union (EU) that have adopted the euro (€) as their primary currency and sole legal tender, and have thus fully implemented EMU policies.
10078

101-
```{code-cell} ipython3
79+
```python
10280
ccy.eurozone
10381
```
10482

105-
```{code-cell} ipython3
83+
```python
10684
ccy.print_eurozone()
10785
```

mkdocs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
site_name: Python CCY
2+
site_url: https://ccy.quantmind.com/
3+
repo_url: https://github.com/quantmind/ccy
4+
repo_name: quantmind/ccy
5+
6+
theme:
7+
name: material
8+
palette:
9+
- media: "(prefers-color-scheme: light)"
10+
scheme: default
11+
primary: teal
12+
accent: amber
13+
toggle:
14+
icon: material/lightbulb
15+
name: Switch to dark mode
16+
- media: "(prefers-color-scheme: dark)"
17+
scheme: slate
18+
primary: teal
19+
accent: amber
20+
toggle:
21+
icon: material/lightbulb-outline
22+
name: Switch to light mode
23+
features:
24+
- navigation.instant
25+
- navigation.footer
26+
- navigation.indexes
27+
- navigation.path
28+
- content.code.copy
29+
30+
nav:
31+
- Home: index.md
32+
- Dates & Periods: dates.md

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,14 @@ dev = [
3434
"types-python-dateutil>=2.9.0.20241003",
3535
]
3636
book = [
37-
"jupyter-book>=1.0.3",
38-
"jupyterlab>=4.3.4",
39-
"jupytext>=1.16.6",
40-
"ghp-import>=2.1.0",
37+
"mkdocs>=1.6",
38+
"mkdocs-material>=9.0",
4139
]
4240

4341
[build-system]
4442
requires = [ "hatchling" ]
4543
build-backend = "hatchling.build"
4644

47-
[tool.jupytext]
48-
formats = "ipynb,myst"
49-
5045
[tool.isort]
5146
profile = "black"
5247

0 commit comments

Comments
 (0)