Skip to content

Commit 86a13af

Browse files
Merge pull request #16 from simonprickett/rename-to-micropython-cratedb
Renames `microcrate` to `micropython-cratedb`.
2 parents effbdb1 + 6f8f287 commit 86a13af

File tree

7 files changed

+39
-36
lines changed

7 files changed

+39
-36
lines changed

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# MicroCrate - A CrateDB Driver for MicroPython
1+
# micropython-cratedb - A CrateDB Driver for MicroPython
22

33
## Introduction
44

5-
MicroCrate is a [CrateDB](https://cratedb.com) driver for the [MicroPython](https://micropython.org) language. It connects to CrateDB using the [HTTP Endpoint](https://cratedb.com/docs/crate/reference/en/latest/interfaces/http.html).
5+
micropython-cratedb is a [CrateDB](https://cratedb.com) driver for the [MicroPython](https://micropython.org) language. It connects to CrateDB using the [HTTP Endpoint](https://cratedb.com/docs/crate/reference/en/latest/interfaces/http.html).
66

77
To use this, you'll need a CrateDB database cluster. Sign up for our cloud free tier [here](https://console.cratedb.cloud/) or get started with Docker [here](https://hub.docker.com/_/crate).
88

@@ -41,15 +41,15 @@ mip.install("github:simonprickett/microcrate")
4141
Import the driver like this:
4242

4343
```python
44-
import microcrate
44+
import cratedb
4545
```
4646

4747
### Connecting to CrateDB
4848

4949
Connect to a CrateDB cluster in the cloud by providing hostname, user name and password:
5050

5151
```python
52-
crate = microcrate.CrateDB(
52+
crate = cratedb.CrateDB(
5353
host="host",
5454
user="user",
5555
password="password"
@@ -61,7 +61,7 @@ The driver uses SSL by default.
6161
If you're running CrateDB locally (with Docker for example), connect like this:
6262

6363
```python
64-
crate = microcrate.CrateDB(
64+
crate = cratedb.CrateDB(
6565
host="hostname",
6666
use_ssl=False
6767
)
@@ -70,7 +70,7 @@ crate = microcrate.CrateDB(
7070
The driver will connect to port 4200 unless you provide an alternative value:
7171

7272
```python
73-
crate = microcrate.CrateDB(
73+
crate = cratedb.CrateDB(
7474
host="host",
7575
user="user",
7676
port=4201,
@@ -287,7 +287,7 @@ The response includes the number of rows affected by the update:
287287

288288
CrateDB supports flexible storage and indexing of objects / JSON data. To learn more about this, check out our [blog post](https://cratedb.com/blog/handling-dynamic-objects-in-cratedb) that explains the different ways objects can be stored.
289289

290-
Here are some basic examples showing how to store objects with MicroCrate and retrieve desired fields from them.
290+
Here are some basic examples showing how to store objects with micropython-cratedb and retrieve desired fields from them.
291291

292292
Assume a table with the following definition having a [dynamic object](https://cratedb.com/blog/handling-dynamic-objects-in-cratedb) column:
293293

@@ -389,7 +389,7 @@ The driver can throw the following types of exception:
389389
Here's an example showing how to catch a network error:
390390

391391
```python
392-
crate = microcrate.CrateDB("nonexist", use_ssl = False)
392+
crate = cratedb.CrateDB("nonexist", use_ssl = False)
393393

394394
try:
395395
response = crate.execute(
@@ -399,7 +399,7 @@ try:
399399
],
400400
with_types=True
401401
)
402-
except microcrate.NetworkError as e:
402+
except cratedb.NetworkError as e:
403403
print("Network error:")
404404
print(e)
405405
```
@@ -418,7 +418,7 @@ try:
418418
response = crate.execute(
419419
"SELECT nonexist FROM temp_humidity"
420420
)
421-
except microcrate.CrateDBError as e:
421+
except cratedb.CrateDBError as e:
422422
print("CrateDB error:")
423423
print(e)
424424
```
@@ -443,20 +443,23 @@ The [`examples`](examples/) folder contains example MicroPython scripts, some of
443443

444444
## Testing
445445

446-
This driver library was tested using the following MicroPython versions:
446+
This driver library has been tested using the following MicroPython versions:
447447

448-
* **1.23.0** ([download](https://micropython.org/download/))
449-
* macOS/darwin
450-
* Raspberry Pi Pico W
451-
* **1.23.0 (Pimoroni build)** ([download](https://github.com/pimoroni/pimoroni-pico/releases))
452-
* Raspberry Pi Pico W
448+
* **1.24.0**
449+
* macOS/darwin ([install with Homebrew package manager](https://formulae.brew.sh/formula/micropython))
450+
* Raspberry Pi Pico W ([download](https://micropython.org/download/RPI_PICO_W/))
451+
* **1.23.0**
452+
* macOS/darwin ([install with Homebrew package manager](https://formulae.brew.sh/formula/micropython))
453+
* Raspberry Pi Pico W ([download](https://micropython.org/download/RPI_PICO_W/))
454+
* **1.23.0 (Pimoroni build)**
455+
* Raspberry Pi Pico W ([download](https://github.com/pimoroni/pimoroni-pico/releases))
453456

454-
If you have other microcontroller boards that you can test the driver with or provide examples for, we'd love to receive a pull request!
457+
If you have other microcontroller boards that you can test the driver with or provide examples for, we'd love to receive a [pull request](/pulls)!
455458

456459
## Need Help?
457460

458461
If you need help, have a bug report or feature request, or just want to show us your project that uses this driver then we'd love to hear from you!
459462

460-
For bugs or feature requests, please raise an issue on GitHub. We also welcome pull requests!
463+
For bugs or feature requests, please raise an [issue](/issues) on GitHub. We also welcome [pull requests](/pulls)!
461464

462465
If you have a project to share with us, or a more general question about this driver or CrateDB, please post in our [community forum](https://community.cratedb.com/).
File renamed without changes.

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# MicroCrate Examples
1+
# micropython-cratedb Examples
22

3-
This folder contains code samples and fully working example code for the MicroCrate driver.
3+
This folder contains code samples and fully working example code for the micropython-cratedb driver.
44

55
* `example_usage.py`: Demonstrates various types of query. This does not have any specific microcontroller dependencies, and can be run on desktop MicroPython.
66
* `object_examples.py`: Demonstrates operations using an [OBJECT](https://cratedb.com/docs/crate/reference/en/latest/general/ddl/data-types.html#objects) column in CrateDB. Also demonstrates the use of the [ARRAY](https://cratedb.com/docs/crate/reference/en/latest/general/ddl/data-types.html#array) container data type.

examples/example_usage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# in any MicroPython environment. You will need to edit the
44
# code below to use your CrateDB credentials.
55

6-
import microcrate
6+
import cratedb
77

88
# CrateDB Docker / local network, no SSL.
9-
# crate = microcrate.CrateDB(host="hostname", use_ssl=False)
9+
# crate = cratedb.CrateDB(host="hostname", use_ssl=False)
1010

1111
# CrateDB Cloud.
12-
crate = microcrate.CrateDB(
12+
crate = cratedb.CrateDB(
1313
host="host",
1414
user="user",
1515
password="password"
@@ -84,9 +84,9 @@
8484
# This will throw a CrateDBError as we dropped the table.
8585
response = crate.execute("select * from driver_test")
8686

87-
except microcrate.NetworkError as e:
87+
except cratedb.NetworkError as e:
8888
print("Caught NetworkError:")
8989
print(e)
90-
except microcrate.CrateDBError as c:
90+
except cratedb.CrateDBError as c:
9191
print("Caught CrateDBError:")
9292
print(c)

examples/object_examples.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# run in any MicroPython environment. You will need to edit the
44
# code below to use your CrateDB credentials.
55

6-
import microcrate
6+
import cratedb
77

88
# CrateDB Docker / local network, no SSL.
9-
# crate = microcrate.CrateDB(host="hostname", use_ssl=False)
9+
# crate = cratedb.CrateDB(host="hostname", use_ssl=False)
1010

1111
# CrateDB Cloud.
12-
crate = microcrate.CrateDB(
12+
crate = cratedb.CrateDB(
1313
host="host",
1414
user="user",
1515
password="password"
@@ -325,9 +325,9 @@
325325
# {'rows': [[]], 'rowcount': 1, 'cols': [], 'duration': 67.91708}
326326
print(response)
327327

328-
except microcrate.NetworkError as e:
328+
except cratedb.NetworkError as e:
329329
print("Caught NetworkError:")
330330
print(e)
331-
except microcrate.CrateDBError as c:
331+
except cratedb.CrateDBError as c:
332332
print("Caught CrateDBError:")
333333
print(c)

examples/picow_demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MicroCrate Example for the Raspberry Pi Pico W.
1+
# micropython-cratedb Example for the Raspberry Pi Pico W.
22
# Configure your CrateDB credentials and WiFi SSID
33
# and password below before running this.
44

@@ -7,10 +7,10 @@
77
import sys
88
import time
99

10-
import microcrate
10+
import cratedb
1111

1212
# Configure CrateDB driver.
13-
crate = microcrate.CrateDB(
13+
crate = cratedb.CrateDB(
1414
host="hostname",
1515
user="username",
1616
password="password"
@@ -65,7 +65,7 @@
6565
"INSERT INTO picow_test (id, temp) VALUES (?, ?)",
6666
[
6767
ip_addr,
68-
temperature # TODO what units are these?
68+
temperature
6969
]
7070
)
7171

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"urls": [
33
[
4-
"microcrate.py",
5-
"github:simonprickett/microcrate/microcrate.py"
4+
"cratedb.py",
5+
"github:simonprickett/microcrate/cratedb.py"
66
]
77
],
88
"deps": [

0 commit comments

Comments
 (0)