Skip to content

Commit 7ec2ac4

Browse files
authored
Merge pull request #71 from mindsdb/symplify
Symplify usage
2 parents 3f52b62 + bfbdab8 commit 7ec2ac4

32 files changed

+2242
-1068
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ You can establish a connection to the MindsDB server using the SDK. Here are som
1818

1919
```python
2020
import mindsdb_sdk
21-
server = mindsdb_sdk.connect()
22-
server = mindsdb_sdk.connect('http://127.0.0.1:47334')
21+
con = mindsdb_sdk.connect()
22+
con = mindsdb_sdk.connect('http://127.0.0.1:47334')
2323
```
2424

2525
#### Connect to the MindsDB Cloud
2626

2727
```python
2828
import mindsdb_sdk
29-
server = mindsdb_sdk.connect(login='[email protected]', password='-')
30-
server = mindsdb_sdk.connect('https://cloud.mindsdb.com', login='[email protected]', password='-')
29+
con = mindsdb_sdk.connect(login='[email protected]', password='-')
30+
con = mindsdb_sdk.connect('https://cloud.mindsdb.com', login='[email protected]', password='-')
3131
```
3232

3333
#### Connect to a MindsDB Pro server
3434

3535
```python
3636
import mindsdb_sdk
37-
server = mindsdb_sdk.connect('http://<YOUR_INSTANCE_IP>', login='[email protected]', password='-', is_managed=True)
37+
con = mindsdb_sdk.connect('http://<YOUR_INSTANCE_IP>', login='[email protected]', password='-', is_managed=True)
3838
```
3939

4040
## Basic usage
@@ -43,7 +43,7 @@ Once connected to the server, you can perform various operations. Here are some
4343

4444
```python
4545
# Get a list of databases
46-
databases = server.list_databases()
46+
databases = con.databases.list()
4747

4848
# Get a specific database
4949
database = databases[0] # Database type object
@@ -53,24 +53,27 @@ query = database.query('select * from table1')
5353
print(query.fetch())
5454

5555
# Create a table
56-
table = database.create_table('table2', query)
56+
table = database.tables.create('table2', query)
5757

5858
# Get a project
59-
project = server.get_project('proj')
59+
project = con.projects.proj
60+
61+
# or use mindsdb project
62+
project = con
6063

6164
# Perform an SQL query within a project
6265
query = project.query('select * from database.table join model1')
6366

6467
# Create a view
65-
view = project.create_view('view1', query=query)
68+
view = project.views.create('view1', query=query)
6669

6770
# Get a list of views
68-
views = project.list_views()
71+
views = project.views.list()
6972
view = views[0]
7073
df = view.fetch()
7174

7275
# Get a list of models
73-
models = project.list_models()
76+
models = project.models.list()
7477
model = models[0]
7578

7679
# Use a model for prediction
@@ -83,7 +86,7 @@ timeseries_options = {
8386
'window': 5,
8487
'horizon': 1
8588
}
86-
model = project.create_model(
89+
model = project.models.create(
8790
'rentals_model',
8891
predict='price',
8992
query=query,
@@ -98,6 +101,10 @@ You can find more examples in this [Google colab notebook](
98101
https://colab.research.google.com/drive/1QouwAR3saFb9ffthrIs1LSH5COzyQa11#scrollTo=k6IbwsKRPQCR
99102
)
100103

104+
## Examples
105+
106+
https://github.com/mindsdb/mindsdb_python_sdk/tree/staging/examples
107+
101108
## API Documentation
102109

103110
The API documentation for the MindsDB SDK can be found at https://mindsdb.github.io/mindsdb_python_sdk/. You can generate the API documentation locally by following these steps:

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
requests
2-
pandas == 1.3.5
3-
mindsdb-sql >= 0.5.0, < 0.6.0
2+
pandas >= 1.3.5
3+
mindsdb-sql >= 0.7.0, < 0.8.0
44

55
sphinx
66
sphinx-rtd-theme

docs/source/database.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Database
1+
Databases
22
----------------------------
33

4-
.. automodule:: mindsdb_sdk.database
4+
.. automodule:: mindsdb_sdk.databases
55
:members:
66
:undoc-members:
77
:show-inheritance:

docs/source/handlers.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Handlers
2+
-------------------------
3+
4+
.. automodule:: mindsdb_sdk.handlers
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ Base usage
8787
query=query,
8888
)
8989
90+
More
9091
92+
More examples
93+
-----------
94+
95+
`<https://github.com/mindsdb/mindsdb_python_sdk/examples>`_
9196

9297
API documentation
9398
=================
@@ -105,9 +110,15 @@ API documentation
105110

106111
server
107112
database
113+
handlers
114+
ml_engines
108115
project
109116
model
117+
tables
118+
views
110119
query
120+
jobs
121+
111122

112123
Indices and tables
113124
------------------

docs/source/jobs.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Jobs
2+
-------------------------
3+
4+
.. automodule:: mindsdb_sdk.jobs
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/ml_engines.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ML Engines
2+
-------------------------
3+
4+
.. automodule:: mindsdb_sdk.ml_engines
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/source/model.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Model
1+
Models
22
-------------------------
33

4-
.. automodule:: mindsdb_sdk.model
4+
.. automodule:: mindsdb_sdk.models
55
:members:
66
:undoc-members:
77
:show-inheritance:

docs/source/project.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Project
1+
Projects
22
---------------------------
33

4-
.. automodule:: mindsdb_sdk.project
4+
.. automodule:: mindsdb_sdk.projects
55
:members:
66
:undoc-members:
77
:show-inheritance:

docs/source/tables.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Tables
2+
-------------------------
3+
4+
.. automodule:: mindsdb_sdk.tables
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)