[](https://travis-ci.org/EvgenyAK/3db.svg?branch=master)
ThreeDB is a lightweight database optimized for data storage used testing. [DDT](https://en.wikipedia.org/wiki/Data-driven_testing).
## Usage
```
TestData/
10001_A/
data_1.txt
etalon_1.txt
10002_B/
data_1.txt
etalon_1.txt
10003_A_B/
data_A_1.txt
etalon_A_1.txt
data_B_1.txt
data_B_1.txt
```
```python
import threedb
db = threedb.connect("TestData/")
items = db.search()
print(items)
>>> {'ref': './10001_A', 'etalon_1_txt': <threedb.storage.DataItem object at 0x7f7de4563b38>, 'tags': [], 'data_1_txt': <threedb.storage.DataItem object at 0x7f7de4563b70>, 'index': '10001_A'}
>>> {'ref': './10002_A_B', 'etalon_1_txt': <threedb.storage.DataItem object at 0x7f7de4563ba8>, 'tags': [], 'data_1_txt': <threedb.storage.DataItem object at 0x7f7de4563be0>, 'index': '10002_A_B'}
>>> {'ref': './10002_B', 'etalon_1_txt': <threedb.storage.DataItem object at 0x7f7de4563c50>, 'tags': [], 'data_1_txt': <threedb.storage.DataItem object at 0x7f7de4563c88>, 'index': '10002_B'}
items = db.search(*("10001_A",))
print(items)
>>> {'ref': './10001_A', 'etalon_1_txt': <threedb.storage.DataItem object at 0x7f7de4563b38>, 'tags': [], 'data_1_txt': <threedb.storage.DataItem object at 0x7f7de4563b70>, 'index': '10001_A'}
first = item[0]["etalon_1_txt"]
print(first.text)
>>> {"name": "Neo"}
print(first.json())
>> {
"name": "Neo"
}
```
## Database schema
Used to describe the schema of a database.
```json
'schema': {
'input_data': {
'match': ['data.*']
},
'gold_etalon': {
'match': ['etalon.*'],
}
}
```
```python
db = threedb.connect("TestData/")
items = db.search(*("10001_A",))
print(items)
{'tags': [], 'index': '10001_A', 'ref': './10001_A', 'gold_etalon': <threedb.storage.DataItem object at 0x7fbfaff4bc88>, 'input_data': <threedb.storage.DataItem object at 0x7fbfaff4bf28>}
```
## Meta-data file
```
TestData/
10001_A/
metadata.yaml # tags: - serviceA
data_1.txt
etalon_1.txt
10002_B/
data_1.txt
etalon_1.txt
10003_A_B/
data_A_1.txt
etalon_A_1.txt
data_B_1.txt
data_B_1.txt
```
```python
db = threedb.connect("TestData/")
items = db.search(*("serviceA",))
print(items)
>>> {'ref': './10001_A', 'etalon_1_txt': <threedb.storage.DataItem object at 0x7f7de4563b38>, 'tags': ['serviceA'], 'data_1_txt': <threedb.storage.DataItem object at 0x7f7de4563b70>, 'index': '10001_A'}
```
Metadata
Release files for threedb 1.1
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 |
|---|---|---|---|---|
| threedb-1.1.tar.gz | 3.7 kB | Without provenance | Details for threedb-1.1.tar.gz |
Release files / threedb-1.1.tar.gz
| Download URL | threedb-1.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e46bfc6aef3b67e79bbda8d5061f65cbc7e427a38bfa8dde18d959a2f7fd3ad
|
|
BLAKE2b-256 checksum How to use checksums |
8745e8ca5768f1cb0a0e1604d24ac5b80c87bbbf1b143dfb82466eaee5d9441b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for threedb 1.1
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.