{"id":17358139,"url":"https://github.com/dadadel/py_usefull","last_synced_at":"2025-10-04T06:55:14.392Z","repository":{"id":13092012,"uuid":"15773296","full_name":"dadadel/py_usefull","owner":"dadadel","description":"Some usefull Python tools as a container multi-access modes","archived":false,"fork":false,"pushed_at":"2014-01-14T10:05:47.000Z","size":146,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T19:25:30.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dadadel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-09T17:12:25.000Z","updated_at":"2014-01-14T10:05:49.000Z","dependencies_parsed_at":"2022-09-14T07:12:02.371Z","dependency_job_id":null,"html_url":"https://github.com/dadadel/py_usefull","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadadel%2Fpy_usefull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadadel%2Fpy_usefull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadadel%2Fpy_usefull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadadel%2Fpy_usefull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dadadel","download_url":"https://codeload.github.com/dadadel/py_usefull/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245873501,"owners_count":20686605,"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":[],"created_at":"2024-10-15T19:04:33.697Z","updated_at":"2025-10-04T06:55:09.336Z","avatar_url":"https://github.com/dadadel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"py_usefull\n==========\n\nHere are some usefull tools that coded. I put them here to have easy access when needed. Maybe it could be usefull for you too?\n\nThe provided tools are:\n\n* config: a python configuration container with several access modes\n\n\nconfig\n------\n\nA python (2.6+/3+) class configuration container with several access modes.\nIn other words, it is a kind of dictionary but you can use it as you want (variables, accessors, keys,...)!\n\nThe Configuration class is a dictionary container usable in several ways with key/value data.\nYou can get easily the configuration from a file.\nYou can use it like a dictionary. You can use getters and setters. You can use it like a class with variables.\n\nExemple:\n\n- myconfig.txt:\n\n        # the name\n        \n        name = \"Foo Bar\"\n        \n        country = France # is beautiful\n        \n        comment = \"#this is a comment\"\n\n\n- configtest.py:\n\n        #!/usr/bin/python\n        from Config import Config\n        c = Config(\"myconfig.txt\", {\"home\": \"Here\", \"text\": \"This is a test\"})\n        c.set_new_param(\"One more\")\n        c[\"other\"] = \"This is good!\"\n        print(\"The param home = \" + c.home)\n        print(\"The param name = \" + c.name)\n        print(\"The param country = \" + c[\"country\"])\n        print(\"The param text = \" + c.get_text())\n        print(\"-------\")\n        for k in c:\n            print(k + \" = \" + c[k])\n        print(\"-------\")\n        print(str(c))\n        print(\"-------\")\n        if 'new_param' in c:\n            print(\"Found new_param\")\n        if 'old_param' not in c:\n            print(\"Not found old_param\")\n\n- result of execution:\n\n        The param home = Here\n        The param name = Foo Bar\n        The param country = France\n        The param text = This is a test\n        -------\n        name = Foo Bar\n        country = France\n        new_param = One more\n        other = This is good!\n        home = Here\n        text = This is a test\n        -------\n        name: Foo Bar\n        country: France\n        new_param: One more\n        other: This is good!\n        home: Here\n        text: This is a test\n        \n        -------\n        Found new_param\n        Not found old_param\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadadel%2Fpy_usefull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdadadel%2Fpy_usefull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadadel%2Fpy_usefull/lists"}