Cross-Language .properties file parser
Project description
XProperties
Install
pip install xproperties
Examples
Example 1
# example1.properties
usr=Duelit
pwd=password
# example1.py
import XProperties
prop = XProperties.Properties()
prop.load("example1.properties")
# set property
print(prop.get_property("usr")) # Duelit
print(prop["usr"]) # Duelit
# get property
prop.set_property("pwd", "password1")
prop["usr.pwd"] = "password2"
# delete property
prop["del"] = "delete"
prop.delete_property("del")
prop["del"] = "delete"
del prop["del"]
# iterators
print(prop.list()) # ["usr", "pwd"]
print([i for i in prop]) # ["usr", "pwd"]
print(len(prop)) # 2
prop.save()
Example 2
# example2.py
import XProperties
prop = XProperties.Properties()
prop["username"] = "Duelit"
prop["password"] = "password"
prop.save("example2.properties")
License
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for XProperties-1.0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50dab311194a8aea3fc6d7d4c9e0c42f23b7e0c2bf86315e2494aad14b9099e9 |
|
MD5 | 32dc933fc7c5ecaf4ad2a6c8b97035e4 |
|
BLAKE2b-256 | 43a78cf62d178bf7769b664a6b484f2275f14dbdff1605bffd68e83450b10967 |