You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-33Lines changed: 39 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,53 +7,36 @@
7
7
</p>
8
8
9
9
# 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).
12
11
13
12
## Installation
14
13
15
-
### Get it via PyPI
14
+
### Via PyPi
16
15
The recommended way to install the package is with pip:
17
16
```bash
18
17
pip install ipython-polypheny
19
18
```
20
19
21
-
### Building & Installing the Package From Source
20
+
### From Source
22
21
If you do not want to use pip, you can download the code and build it manually.
23
22
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.
40
26
41
27
## Usage
42
-
First, the extension needs to be loaded:
28
+
Activate the extension using:
43
29
```python
44
30
%load_ext poly
45
31
```
46
32
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:
51
34
```python
52
35
# Print help
53
36
%poly help
54
37
```
55
38
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 (:):
57
40
```python
58
41
# Specify the http-interface address of a running Polypheny instance.
59
42
%poly db: http://localhost:13137
@@ -67,6 +50,8 @@ SELECT * FROM emps
67
50
```
68
51
The result is automatically printed as a nicely formatted table.
69
52
53
+
Interact with the retrieved data in multiple ways:
54
+
70
55
Storing the result in a variable:
71
56
```python
72
57
result = _
@@ -102,7 +87,6 @@ for employee in result.dicts():
102
87
print(employee['name'], employee['salary'])
103
88
```
104
89
105
-
106
90
Provided [Pandas](https://pypi.org/project/pandas/) is installed, it is possible to transform the result into a `DataFrame`:
107
91
```python
108
92
df = result.as_df()
@@ -124,7 +108,7 @@ x = 10000
124
108
Be careful to not accidentally inject unwanted queries, as the values are not escaped.
125
109
126
110
## 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:
@@ -134,17 +118,39 @@ Many file types supported by Polypheny are automatically casted to corresponding
134
118
|`DOCUMENT`, `JSON`, `NODE`, `PATH`|`dict`|
135
119
|`ARRAY`|`list`|
136
120
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`:
140
122
```python
141
123
raw_data = result.result_set['data']
142
124
```
143
125
144
126
### 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
+
```
147
152
153
+
Thank you for your dedication and enthusiasm for enhancing the Polypheny ecosystem! We look forward to reviewing your valuable contributions.
0 commit comments