{"id":18084911,"url":"https://github.com/jwodder/javaproperties","last_synced_at":"2025-04-04T07:05:24.959Z","repository":{"id":56060119,"uuid":"65639217","full_name":"jwodder/javaproperties","owner":"jwodder","description":"Python library for reading \u0026 writing Java .properties files","archived":false,"fork":false,"pushed_at":"2025-03-24T19:24:20.000Z","size":436,"stargazers_count":31,"open_issues_count":19,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T06:05:10.729Z","etag":null,"topics":["available-on-pypi","config","configfile","configuration","java","javaproperties","properties","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwodder.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-13T22:19:16.000Z","updated_at":"2025-01-24T15:25:26.000Z","dependencies_parsed_at":"2023-01-31T02:00:17.384Z","dependency_job_id":"9e902ad0-28bb-4ce5-befe-52ce57933784","html_url":"https://github.com/jwodder/javaproperties","commit_stats":{"total_commits":353,"total_committers":2,"mean_commits":176.5,"dds":"0.014164305949008527","last_synced_commit":"822e29573fb1087ee1bcd97865ec6e63b54876c7"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fjavaproperties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fjavaproperties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fjavaproperties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwodder%2Fjavaproperties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwodder","download_url":"https://codeload.github.com/jwodder/javaproperties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135142,"owners_count":20889420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["available-on-pypi","config","configfile","configuration","java","javaproperties","properties","python"],"created_at":"2024-10-31T15:08:36.593Z","updated_at":"2025-04-04T07:05:24.942Z","avatar_url":"https://github.com/jwodder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|repostatus| |ci-status| |coverage| |pyversions| |license|\n\n.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg\n    :target: https://www.repostatus.org/#active\n    :alt: Project Status: Active - The project has reached a stable, usable\n          state and is being actively developed.\n\n.. |ci-status| image:: https://github.com/jwodder/javaproperties/actions/workflows/test.yml/badge.svg\n    :target: https://github.com/jwodder/javaproperties/actions/workflows/test.yml\n    :alt: CI Status\n\n.. |coverage| image:: https://codecov.io/gh/jwodder/javaproperties/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/jwodder/javaproperties\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/javaproperties.svg\n    :target: https://pypi.org/project/javaproperties\n\n.. |license| image:: https://img.shields.io/github/license/jwodder/javaproperties.svg?maxAge=2592000\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT License\n\n`GitHub \u003chttps://github.com/jwodder/javaproperties\u003e`_\n| `PyPI \u003chttps://pypi.org/project/javaproperties\u003e`_\n| `Documentation \u003chttps://javaproperties.readthedocs.io\u003e`_\n| `Issues \u003chttps://github.com/jwodder/javaproperties/issues\u003e`_\n| `Changelog \u003chttps://github.com/jwodder/javaproperties/blob/master/CHANGELOG.md\u003e`_\n\n``javaproperties`` provides support for reading \u0026 writing |properties|_ (both\nthe simple line-oriented format and XML) with a simple API based on the\n``json`` module — though, for recovering Java addicts, it also includes a\n``Properties`` class intended to match the behavior of |propclass|_ as much as\nis Pythonically possible.\n\nPrevious versions of ``javaproperties`` included command-line programs for\nbasic manipulation of ``.properties`` files.  As of version 0.4.0, these\nprograms have been split off into a separate package, |clipkg|_.\n\n\nInstallation\n============\n``javaproperties`` requires Python 3.8 or higher.  Just use `pip\n\u003chttps://pip.pypa.io\u003e`_ for Python 3 (You have pip, right?) to install it::\n\n    python3 -m pip install javaproperties\n\n\nExamples\n========\n\nDump some keys \u0026 values (output order not guaranteed):\n\n\u003e\u003e\u003e properties = {\"key\": \"value\", \"host:port\": \"127.0.0.1:80\", \"snowman\": \"☃\", \"goat\": \"🐐\"}\n\u003e\u003e\u003e print(javaproperties.dumps(properties))\n#Mon Sep 26 14:57:44 EDT 2016\nkey=value\ngoat=\\ud83d\\udc10\nhost\\:port=127.0.0.1\\:80\nsnowman=\\u2603\n\nLoad some keys \u0026 values:\n\n\u003e\u003e\u003e javaproperties.loads('''\n... #Mon Sep 26 14:57:44 EDT 2016\n... key = value\n... goat: \\\\ud83d\\\\udc10\n... host\\\\:port=127.0.0.1:80\n... #foo = bar\n... snowman   ☃\n... ''')\n{'goat': '🐐', 'host:port': '127.0.0.1:80', 'key': 'value', 'snowman': '☃'}\n\nDump some properties to a file and read them back in again:\n\n\u003e\u003e\u003e with open('example.properties', 'w', encoding='latin-1') as fp:\n...     javaproperties.dump(properties, fp)\n...\n\u003e\u003e\u003e with open('example.properties', 'r', encoding='latin-1') as fp:\n...     javaproperties.load(fp)\n...\n{'goat': '🐐', 'host:port': '127.0.0.1:80', 'key': 'value', 'snowman': '☃'}\n\nSort the properties you're dumping:\n\n\u003e\u003e\u003e print(javaproperties.dumps(properties, sort_keys=True))\n#Mon Sep 26 14:57:44 EDT 2016\ngoat=\\ud83d\\udc10\nhost\\:port=127.0.0.1\\:80\nkey=value\nsnowman=\\u2603\n\nTurn off the timestamp:\n\n\u003e\u003e\u003e print(javaproperties.dumps(properties, timestamp=None))\nkey=value\ngoat=\\ud83d\\udc10\nhost\\:port=127.0.0.1\\:80\nsnowman=\\u2603\n\nUse your own timestamp (automatically converted to local time):\n\n\u003e\u003e\u003e print(javaproperties.dumps(properties, timestamp=1234567890))\n#Fri Feb 13 18:31:30 EST 2009\nkey=value\ngoat=\\ud83d\\udc10\nhost\\:port=127.0.0.1\\:80\nsnowman=\\u2603\n\nDump as XML:\n\n\u003e\u003e\u003e print(javaproperties.dumps_xml(properties))\n\u003c!DOCTYPE properties SYSTEM \"http://java.sun.com/dtd/properties.dtd\"\u003e\n\u003cproperties\u003e\n\u003centry key=\"key\"\u003evalue\u003c/entry\u003e\n\u003centry key=\"goat\"\u003e🐐\u003c/entry\u003e\n\u003centry key=\"host:port\"\u003e127.0.0.1:80\u003c/entry\u003e\n\u003centry key=\"snowman\"\u003e☃\u003c/entry\u003e\n\u003c/properties\u003e\n\nNew in v0.6.0: Dump Unicode characters as-is instead of escaping them:\n\n\u003e\u003e\u003e print(javaproperties.dumps(properties, ensure_ascii=False))\n#Tue Feb 25 19:13:27 EST 2020\nkey=value\ngoat=🐐\nhost\\:port=127.0.0.1\\:80\nsnowman=☃\n\n`And more! \u003chttps://javaproperties.readthedocs.io\u003e`_\n\n\n.. |properties| replace:: Java ``.properties`` files\n.. _properties: https://en.wikipedia.org/wiki/.properties\n\n.. |propclass| replace:: Java 8's ``java.util.Properties``\n.. _propclass: https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html\n\n.. |clipkg| replace:: ``javaproperties-cli``\n.. _clipkg: https://github.com/jwodder/javaproperties-cli\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fjavaproperties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwodder%2Fjavaproperties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwodder%2Fjavaproperties/lists"}