wurm
Wurm is a simple sqlite3-based ORM.
Usage
# create a table:
@dataclass
class Point(wurm.Table):
x: int
y: int
# types currently supported: int, str, bytes, bool, float, datetime.time,
# datetime.date, datetime.datetime, pathlib.Path
# sqlite3 connections cannot be shared, so call setup_connection once per thread
wurm.setup_connection(sqlite3.connect(":memory:"))
# adding new instances to the database:
point = Point(1, 0)
print(point.rowid) # None
point.insert()
print(point.rowid) # 1
# making changes:
point.x = 2
point.commit()
# simple queries:
point = Point[1] # get by rowid
del Point[1] # delete by rowid
point.delete() # delete from an object
all_points = list(Point) # iterate over a table to get instances for all rows
number_of_points = len(Point) # get the total number of rows in the table
Installation
wurm is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 3.7+.
$ pip install wurm
Changelog
0.1.0
Add wurm.Table.query() and wurm.Query.
Remove wurm.Table[rowid] getter and deleter.
Add documentation for the public interface.
0.0.2
Ensure tables are created, even in edge cases.
Add support for date, time, datetime and Path.
Add wurm.Unique[T].
License
wurm is distributed under the terms of the MIT License.
Metadata
Release files for wurm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wurm-0.1.0.tar.gz | 7.6 kB | Without provenance | Details for wurm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wurm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for wurm-0.1.0-py3-none-any.whl |
Total release size: 15.3 kB
Release files / wurm-0.1.0.tar.gz
| Download URL | wurm-0.1.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
897603a3dcfc6502a3674d71e8d681489cd5b9c9d1f9df7a94a3a3fb6b2fd43b
|
|
BLAKE2b-256 checksum How to use checksums |
e390964b0f7d91da29e013711e68116bc7dff481230a47f92aef5dba37ea98ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1
|
Release files / wurm-0.1.0-py3-none-any.whl
| Download URL | wurm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7f44f52127ec33dcbb6818912efb2ba64868f8a0ad353c9be866ff1e91bb50d
|
|
BLAKE2b-256 checksum How to use checksums |
bd6c266a63a078afc33fdede08fe216d30005b958e91691726c1761262572945
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1
|
Security for wurm 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.