Skip to main content

A simple way to store python objects in yaml

Project description

yaml_serialize

A simple way to store python objects in yaml

Use

from src import yaml_serialize


class MyObject:
    def __init__(self):
        self.name = "Jake"
        self.age = 16
        self.favorite_color = "Green"
        self.mylist = ["hey", "this", "is", "cool"]


my_object = MyObject()
serializer = yaml_serialize.Serialize(my_object)

# Get serialized object as string
my_serialized_object = serializer.get()

# Write serialized object with class name "MyObject.yml"
serializer.write()

# Write serialized object with custom name "MyCoolObject.yml"
serializer.write("MyCoolObject.yml")

Output

_object: !!python/object:__main__.MyObject
  age: 16
  favorite_color: Green
  mylist:
  - hey
  - this
  - is
  - cool
  name: Jake

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

yaml_serialize-0.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

yaml_serialize-0.1-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file yaml_serialize-0.1.tar.gz.

File metadata

  • Download URL: yaml_serialize-0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.5

File hashes

Hashes for yaml_serialize-0.1.tar.gz
Algorithm Hash digest
SHA256 c90e19d045f19320c2f88d33fdafe1d23f709d3e4d43bfa4f0089b056c703ff2
MD5 0a1de3f51cc1d4247fe52e867b3dc546
BLAKE2b-256 2807fb5af46167fa6a49b32e605b46237973104622246bbebe65e7f8af920542

See more details on using hashes here.

File details

Details for the file yaml_serialize-0.1-py3-none-any.whl.

File metadata

  • Download URL: yaml_serialize-0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.5

File hashes

Hashes for yaml_serialize-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d00e61aad0421d6b09097af285d08ae438c72952a938a38cc9d7131ff509e790
MD5 127aab2409304a11d9fbb117364599c5
BLAKE2b-256 59d81333ee748b2299af3e7df33ecfdc72c4b51118ab4ce7e887d38a0a8bcae4

See more details on using hashes here.

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