Skip to main content

Cross-Language .properties file parser

Project description

XProperties

Install

pip install XProperties

Examples

Example 1

# example1.properties
username=Duelit
password=password
# example1.py
import XProperties


prop = XProperties.Properties()
prop.load("example1.properties")

# get property
print(prop.get_property("username"))
print(prop["username"])

# set property
prop.set_property("password", "password1")
prop["password"] = "password1"

# delete property
prop["delete"] = "delete me"
prop.delete_property("delete")
prop["delete"] = "delete me"
del prop["delete"]

# iterator
print(prop.list())
print([i for i in prop])
print(len(prop))

prop.save()

Example 2

# example2.py
import XProperties


prop = XProperties.Properties()

prop["username"] = "Duelit"
prop["password"] = "password"

prop.save("example2.properties")

License

MIT License

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

XProperties-1.0.4-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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