Skip to main content

A simple simple item

Project description

SimpleItem

Python SimpleItem Library.

Installing

Install and update using pip3:

$ pip3 install simpleitem

Python 3 and newer.

SimpleItem Example

Easy to define and use features.

>> from simpleitem import SimpleItem

>> item1 = SimpleItem()

>> item1.node1 = 1

>> item1['node2']node3 = 3

>> item1['node1']
1

>> item1.node2.node3
3

>> item1['node2'].node3
3

>> item1.node2['node3']
3

>> item1['node2']['node3']
3

Other Usage Examples

>> item2 = SimpleItem()
>> item2['node1'] = 1
>> item2['node2']['node3'] = 3

>> item3 = SimpleItem(node1=1, node2={'node3': 3})

>> item4 = SimpleItem(**{'node1': 1, 'node2': {'node3': 3}})

>> item5 = SimpleItem()
>> item5(node1=1, node2={'node3': 3})

>> item6 = SimpleItem()
>> item6(**{'node1': 1, 'node2': {'node3': 3}})

path; test.yaml

settings:

username: admin

host: 0.0.0.0

>> item = SimpleItem()
>> item.from_yaml(path)

>> item.setting.username
admin

>> setting = item.setting
>> setting.host
0.0.0.0

MemoryStorage Example

MemoryStorage designed as singleton pattern, define somewhere use everywhere.

>> from simpleitem import MemoryStorage

>> storage = MemoryStorage()

>> settings = storage.settings
>> settings.sleep = 1
>> settings.sleep
 1

>> settings(debug=True)
>> storage.settings.debug
 True

Support

  • Python 3.x

  • Supports all operating systems

Project details


Download files

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

Source Distribution

simpleitem-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

simpleitem-0.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file simpleitem-0.0.2.tar.gz.

File metadata

  • Download URL: simpleitem-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for simpleitem-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d8d0f3a92109dfecf448070499025bb67e7071c9a925575194fbb0a54a63d013
MD5 76db8efeee19fcf4bfb109d8241f8811
BLAKE2b-256 a2ac804a6b86802ac33acf8e4057730689ea091f9296451ad91e36c5440aca3d

See more details on using hashes here.

Provenance

File details

Details for the file simpleitem-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: simpleitem-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for simpleitem-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab793e63a8d1fea97c10c44dc25d5ab03b65d0a3978828fdab0497186c5bd643
MD5 c8b684d20093a267c14195b3bed591a9
BLAKE2b-256 2e033f5712483a3ca4ae4ac04b00845e90b1c2e2f3496abfdc48a206a43ff0cc

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page