Skip to content

Commit 754bec2

Browse files
authored
Improve README
1 parent de9a9f2 commit 754bec2

1 file changed

Lines changed: 39 additions & 33 deletions

File tree

README.md

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,36 @@
77
</p>
88

99
# Polypheny Extension for IPython
10-
This IPython extension adds `%poly` magics for querying a [Polypheny](https://polypheny.org/) polystore.
11-
The extension was heavily inspired by the wonderful [IPython SQL Extension](https://github.com/catherinedevlin/ipython-sql).
10+
This IPython extension adds `%poly` magics for querying [Polypheny](https://polypheny.org/) using any of the supported query languages. This extension takes inspiration from the brilliant [IPython SQL Extension](https://github.com/catherinedevlin/ipython-sql).
1211

1312
## Installation
1413

15-
### Get it via PyPI
14+
### Via PyPi
1615
The recommended way to install the package is with pip:
1716
```bash
1817
pip install ipython-polypheny
1918
```
2019

21-
### Building & Installing the Package From Source
20+
### From Source
2221
If you do not want to use pip, you can download the code and build it manually.
2322

24-
From the top level directory, first execute `python -m build`.
25-
This should create a `.tar.gz` and `.whl` file in `dist/`.
26-
Now you can install the built package with `python -m pip install ./dist/<file-name>.whl`.
27-
28-
### For Development
29-
Since installation of a package is usually not needed for development, it can be installed in editable mode:
30-
Execute `python -m pip install -e .` from the top level folder of the project.
31-
32-
Changes to the codebase should now be reflected immediately after reloading the extension.
33-
It is useful to have [autoreload](https://ipython.org/ipython-doc/3/config/extensions/autoreload.html) running, to automatically reload the extension:
34-
```python
35-
%load_ext autoreload
36-
%autoreload 2
37-
38-
%load_ext poly
39-
```
23+
1. Download the source code.
24+
2. At the root directory, run python -m build. This will produce .tar.gz and .whl files in the dist/ folder.
25+
3. Install the package using: python -m pip install ./dist/<file-name>.whl.
4026

4127
## Usage
42-
First, the extension needs to be loaded:
28+
Activate the extension using:
4329
```python
4430
%load_ext poly
4531
```
4632

47-
Both line magics (lines starting with `%poly`) and cell magics (cells starting with`%%poly`) can be used.
48-
Following the magic keyword, a command must be specified.
49-
50-
Here is a basic example:
33+
You can utilize both line magics (%poly) and cell magics (%%poly). A command must always follow the magic keyword. For instance:
5134
```python
5235
# Print help
5336
%poly help
5437
```
5538

56-
If a command expects an argument, then it must be separated with a colon (`:`):
39+
Commands requiring arguments should separate them using a colon (:):
5740
```python
5841
# Specify the http-interface address of a running Polypheny instance.
5942
%poly db: http://localhost:13137
@@ -67,6 +50,8 @@ SELECT * FROM emps
6750
```
6851
The result is automatically printed as a nicely formatted table.
6952

53+
Interact with the retrieved data in multiple ways:
54+
7055
Storing the result in a variable:
7156
```python
7257
result = _
@@ -102,7 +87,6 @@ for employee in result.dicts():
10287
print(employee['name'], employee['salary'])
10388
```
10489

105-
10690
Provided [Pandas](https://pypi.org/project/pandas/) is installed, it is possible to transform the result into a `DataFrame`:
10791
```python
10892
df = result.as_df()
@@ -124,7 +108,7 @@ x = 10000
124108
Be careful to not accidentally inject unwanted queries, as the values are not escaped.
125109

126110
## Data Types
127-
Many file types supported by Polypheny are automatically casted to corresponding Python data types:
111+
Polypheny's data types are mapped to Python's as follows:
128112

129113
| Type in Polypheny | Type in Python |
130114
|:-------------------------------------------|:----------------|
@@ -134,17 +118,39 @@ Many file types supported by Polypheny are automatically casted to corresponding
134118
| `DOCUMENT`, `JSON`, `NODE`, `PATH` | `dict` |
135119
| `ARRAY` | `list` |
136120

137-
Any other types are stored as `str`. The same is true for values where the casting does not succeed.
138-
139-
If the raw data as a nested `list` of `str` is required, one can get it from the `ResultSet`:
121+
Other types are stored as str. Failed casting operations will also result in str. If the raw data as a nested `list` of `str` is required, one can get it from the `ResultSet`:
140122
```python
141123
raw_data = result.result_set['data']
142124
```
143125

144126
### Limitations
145-
Working with (multimedia) file types is currently not supported.
146-
While it does not result in an error, only the identifier for a given file is stored, not the actual file content.
127+
Working with multimedia and other blob types is currently not supported. While it does not result in an error, only the identifier is stored, not the actual content.
128+
129+
130+
## Contributing
131+
Thank you for considering contributing! We truly appreciate any effort, whether it's fixing bugs, improving documentation, or suggesting new features. Here's a guide to help streamline the process:
132+
133+
1. **Start by Forking**: Begin by forking the repository. Once done, you can work on your changes and then submit them as a pull request.
134+
135+
2. **Development Guidelines**: Before diving in, take a moment to explore our [Documentation](https://docs.polypheny.com). Pay special attention to the 'For Developers' section — it offers insights on setup, code style, organization, and other valuable resources tailored for developers.
136+
137+
3. **Adherence to Code of Conduct**: We are committed to fostering an open and welcoming environment. As such, we request all contributors to uphold the standards outlined in our [code of conduct](https://github.com/polypheny/Admin/blob/master/CODE_OF_CONDUCT.md) throughout their interactions related to the project.
138+
139+
4. **Setting up for Development**:
140+
- **Editable Installation**: To see your code changes reflected in real-time, install the extension in an editable mode. Execute the following command from the root directory of the extension:
141+
```bash
142+
python -m pip install -e .
143+
```
144+
This allows any modifications in the codebase to be instantly visible post-reloading the extension.
145+
146+
- **Utilize Autoreload**: For a smoother development experience, consider activating the [autoreload](https://ipython.org/ipython-doc/3/config/extensions/autoreload.html) extension. This tool automatically reloads the extension and incorporates the recent code changes:
147+
```python
148+
%load_ext autoreload
149+
%autoreload 2
150+
%load_ext poly
151+
```
147152

153+
Thank you for your dedication and enthusiasm for enhancing the Polypheny ecosystem! We look forward to reviewing your valuable contributions.
148154

149155
## License
150156
The Apache 2.0 License

0 commit comments

Comments
 (0)