Skip to content

Commit 0adc6df

Browse files
authored
Add installation instructions (#487)
- Remove Python requirement from the README - Add quick start section to the README - Add a documentation section to the README - Add a custom website home page with install instructions Fixes #455.
2 parents c3dd869 + 94927a2 commit 0adc6df

File tree

2 files changed

+89
-3
lines changed

2 files changed

+89
-3
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,29 @@
66

77
A development kit to interact with the Frequenz development platform.
88

9-
## Supported Python versions
9+
## Quick Start
1010

11-
* Only Python 3.11 is fully supported (tested).
11+
We assume you are on a system with Python available. If that is not the case,
12+
please [download and install Python](https://www.python.org/downloads/) first.
13+
14+
To install the SDK, you probably want to create a new virtual environment first.
15+
For example, if you use a `sh` compatible shell, you can do this:
16+
17+
```sh
18+
python3 -m venv .venv
19+
. .venv/bin/activate
20+
```
21+
22+
Then, just install using `pip`:
23+
24+
```sh
25+
python3 -m pip install frequenz-sdk
26+
```
27+
28+
## Documentation
29+
30+
For more information, please visit the [documentation
31+
website](https://frequenz-floss.github.io/frequenz-sdk-python/).
1232

1333
## Contributing
1434

docs/index.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,67 @@
1-
--8<-- "README.md"
1+
# Frequenz Python SDK
2+
3+
## Introduction
4+
5+
The Frequenz Python SDK is a development kit for interacting with the Frequenz development platform.
6+
7+
## Installation
8+
9+
First, you need to make sure you have Python installed (at least version 3.11):
10+
11+
```console
12+
$ python3 --version
13+
Python 3.11.4
14+
```
15+
16+
!!! note
17+
18+
These instructions assume you are using a [POSIX compatible
19+
`sh`](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html)
20+
shell.
21+
22+
If that command doesn't print a version newer than 3.11.0, you'll need to
23+
[download and install Python](https://www.python.org/downloads/) first.
24+
25+
To install the SDK, you probably want to create a new virtual environment first:
26+
27+
```sh
28+
mkdir my-sdk-project
29+
cd my-sdk-project
30+
python3 -m venv .venv
31+
. .venv/bin/activate
32+
```
33+
34+
!!! tip
35+
36+
Using [`direnv`](https://direnv.net/) can greatly simplify this process as
37+
it automates the creation, activation, and deactivation of the virtual
38+
environment. The first time you enable `direnv`, the virtual environment
39+
will be created, and each time you enter or leave a subdirectory, it will be
40+
activated and deactivated, respectively.
41+
42+
```sh
43+
sudo apt install direnv # if you use Debian/Ubuntu
44+
mkdir my-sdk-project
45+
cd my-sdk-project
46+
echo "layout python python3" > .envrc
47+
direnv allow
48+
```
49+
50+
This will create the virtual environment and activate it automatically for you.
51+
52+
Now you can install the SDK by using `pip`:
53+
54+
```sh
55+
python3 -m pip install frequenz-sdk
56+
```
57+
58+
To verify that the installation worked, you can invoke the Python interpreter and
59+
import the SDK:
60+
61+
```console
62+
$ python3
63+
Python 3.11.4 (main, Jun 7 2023, 10:13:09) [GCC 12.2.0] on linux
64+
Type "help", "copyright", "credits" or "license" for more information.
65+
>>> import frequenz.sdk
66+
>>>
67+
```

0 commit comments

Comments
 (0)