Skip to main content

PicoDoc 📝

This is a document database module made for small-scale applications. Please don't use this module if your data is very important. It is not tested very extensively.

This project is on pypi and on github.

Installation

The project is up on pypi (PYthon Package Index). So installing can be done using pip.

Unix & Mac os X:

pip3 install picodoc

Windows:

pip install picodoc

⚠ Notice

The objects are not really dicts and lists. So they do not support all functions of those objects.

List supports:

  • append
  • remove
  • iterating over values
  • item assignment using index
    • del list[idx]
    • value = list[idx]
    • list[idx] = new_value

Dict supports:

  • iterating over keys
  • item assignment using key
    • del list[key]
    • value = list[key]
    • list[key] = new_value

Usage

Using the library should be very straight forward. Open a database with the picodoc.open_db function and use it as if it were a dict.

To get started import the module

import picodoc

Then open the database. (The extension doesn't really matter, but I would suggest using something lile '.db' or '.picodoc')

db = picodoc.open_db('database.picodoc')

Now just treat the db as af it were a basic (see notice) dictionary.

db['users'] = {}
db['users']['donkere.v'] = {
    'name':  'Donkere Vader',
    'descprition': 'Cool dude 😎',
}

There are two ways of printing a document.

Either print it as a dict:

print(db['users']['donkere.v'])

>>>
<Document donkere.v>
{
    'name':  'Donkere Vader',
    'descprition': 'Cool dude 😎',
}

Or print it as an object:

# this will print it as if it were a document
# <Document {document key}>
print(db['users']['donkere.v'].object_repr())

>>>
<Document donkere.v>

Tip

Use the rich module for beautiful output in the console.

Testing

Testing is done via the runtests file.

To run all the tests simply do:

python3 runtests

(If you are on windows use python in stead of python3)

Metadata

Release files for picodoc 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picodoc 0.1.7
File Size Uploaded Provenance Actions
picodoc-0.1.7.tar.gz 17.7 kB Without provenance Details for picodoc-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for picodoc 0.1.7
File Interpreter ABI Platform Actions
picodoc-0.1.7-py3-none-any.whl Python 3 none any Details for picodoc-0.1.7-py3-none-any.whl

Total release size: 37.3 kB

Release files / picodoc-0.1.7.tar.gz

Download URL picodoc-0.1.7.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e7aaef5cb5f66665590638412ee3581abecd80691756303fc041d4e04a051e05
BLAKE2b-256 checksum
How to use checksums
36df52674ac04655226ac554d8a6ae845accf6558f19fbe4a0b388c1e0893af7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

Release files / picodoc-0.1.7-py3-none-any.whl

Download URL picodoc-0.1.7-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17b276353a8049d4bbb07d570c6c0dfe7a53333a2762b4848315ff82b8fbc7e7
BLAKE2b-256 checksum
How to use checksums
881db2990f3d8bb46dbb7425506315b71c467b446567a625076285c9d00fc305
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

Security for picodoc 0.1.7

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page