maci docs
  • maci
  • WATCH
    • Quick Start
    • Full Training Series
  • DOCS
    • maci
      • language
        • v1.0.0
      • functions
        • maci.build
        • maci.load
        • maci.loadstr
        • maci.loadattrs
        • maci.loadraw
        • maci.loaddict
        • maci.loadstrdict
        • maci.dump
        • maci.dumpstr
        • maci.dumpraw
      • object
        • methods
          • lock_attr
          • unlock_attr
          • hard_lock_attr
          • map_attr
          • unmap_attr
          • load_attrs
          • get_attrs
          • get_locked_list
          • get_hard_locked_list
          • get_all_maps
          • get_parent_maps
          • get_child_maps
          • get_parent_map_chains
          • is_parent_map
          • is_child_map
      • errors
      • hints
    • json
      • functions
        • maci.jsonload
        • maci.jsonloadstr
        • maci.jsondump
        • maci.jsondumpstr
    • yaml
      • functions
        • maci.yamlload
        • maci.yamlloadstr
        • maci.yamlloadall
        • maci.yamldump
        • maci.yamldumpstr
        • maci.yamldumpall
    • toml
      • functions
        • maci.tomlload
        • maci.tomlloadstr
        • maci.tomldump
        • maci.tomldumpstr
    • ini
      • functions
        • maci.iniload
        • maci.inidump
        • maci.inibuildauto
        • maci.inibuildmanual
    • xml
      • functions
        • maci.xmlload
        • maci.xmlloadstr
        • maci.xmlloaddict
        • maci.xmlloadstrdict
        • maci.xmldump
        • maci.xmldumpstr
        • maci.xmldumpdict
        • maci.xmldumpstrdict
        • maci.xmlbuildmanual
        • maci._defuse_xml_stdlib
    • pickle
      • functions
        • maci.pickleloadbytes
        • maci.pickledumpbytes
    • tools
      • hash functions
        • maci.createhash
        • maci.createfilehash
        • maci.comparefilehash
      • format functions
        • maci.cleanformat
  • Updates
    • Changelog
      • v1.1.0
      • v1.0.0
Powered by GitBook
On this page
  • building a maci data object
  • creating and setting attribute names with data
  • object view
  • object operators and built-in behavior
  • object methods
  • object hinting
  1. DOCS
  2. maci

object

maci data object

Last updated 1 year ago

The maci data object is a custom data type that provides unique functionality to perform useful operations on attribute names in the object and is responsible for holding all stored data during the runtime of the code.

Type name representation: MaciDataObj

building a maci data object

To build a maci data object in code, you may run the simple build function (See ). This will return an empty maci object.

Example creating an empty maci data object using the

data = maci.build()

creating and setting attribute names with data

Whether loaded from a file (See ) or in code, you can create and set attribute names and assign data to them on the object in code like you normally would expect in python.

Example creating and setting attributes names in code with basic data

data.attr1 = 1
data.attr2 = 2
data.attr3 = 3

See and for loading data from a file

object view

MaciDataObj(attr1=1, attr2=2, attr3=3)

If the object is empty, it will show like so:

MaciDataObj()

object operators and built-in behavior

maci version 1.0.0

equality

Compare maci objects to each other in code to check for equality. This will check if the data inside the object is exactly the same.

Example comparing maci objects

maci_obj1 == maci_obj2

bool

Call the bool built-in function on the object in code to check if the object is empty or not.

Example calling built-in bool function on maci object

bool(maci_obj)

object methods

Perform varying operations on the attribute names or data for the object using the built-in methods. You can set attribute names to be locked like a constant, or map attribute names to another like a pointer, get views of the object data and their states, and more.

object hinting

maci version 1.0.0

Conveniently, you can access the MaciDataObj type to hint it in your code from the maci module.

Example accessing the MaciDataObj type for hinting

maci.hint.MaciDataObj

You may view the representation of the object by printing the object directly, or calling the or functions on the object. The resulting output will display all attribute names and their currently assigned values. Example output showing current attribute names and their respective data

See the object's api for all useful functionality

Typing for the MaciDataObj is currently supported if needed for type checkers. This is being currently tested using for type safety. Updates may be made in the future for uncaught scenarios that is not passing mypy or other type checkers.

See for more on this and other types

maci.build
maci build function
maci.load
maci.load
language section
str()
repr()
methods section
mypy
hints section