Skip to main content

Welcome to OLIB, an object library.

OLIB is an object library you can use to program with objects, uses a JSON in file database with a versioned readonly storage and reconstructs objects based on type information in the path.

OLIB is placed in the Public Domain and has no COPYRIGHT and no LICENSE.

INSTALL

OLIB can be found on pypi, see http://pypi.org/project/olib

installation is through pypi:

$ sudo pip3 install olib --upgrade --force-reinstall

PROGRAMMING

OLIB provides a library you can use to program objects under python3. It provides a basic Object, that mimics a dict while using attribute access and provides a save/load to/from json files on disk. Objects can be searched with a little database module, provides read-only files to improve persistence and use a type in filename reconstruction.

basic usage is this:

>>> from obj import Object
>>> o = Object()
>>> o.key = "value"
>>> o.key
'value'
>>> o
{"key": "value"}

objects can be saved and loaded to JSON files:

>>> from obj import Object, cfg
>>> cfg.wd = "data"
>>> o = Object()
>>> o.key = "value"
>>> path = o.save()
>>> path
'obj.Object/4b58abe2-3757-48d4-986b-d0857208dd96/2021-04-12/21:15:33.734994
>>> oo = Object().load(path)
>>> oo.key
'value'

an Object tries to mimic a dictionary while trying to be an object with normal attribute access as well. Hidden methods are provided as are the basic methods like get, items, keys, register, set, update, values.

great for giving objects peristence by having their state stored in files.

CONTACT

have fun coding

Bart Thate (bthate67@gmail.com)
botfather on #dunkbots irc.freenode.net

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

olib-101.tar.gz (15.4 kB view details)

Uploaded Source

File details

Details for the file olib-101.tar.gz.

File metadata

  • Download URL: olib-101.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.4

File hashes

Hashes for olib-101.tar.gz
Algorithm Hash digest
SHA256 7468e801ed8546ea7e43d6034c09847bca86754bb13b77142e9cd3cd90685397
MD5 400512fdad5540a626d5ded74a464a92
BLAKE2b-256 6ff59e471625106101a516288d383e03921e4c306b8c17a0a50235264d862aef

See more details on using hashes here.

Release history Release notifications | RSS feed

102

1 file

This release

101 This release

1 file

100

1 file

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