{"id":26295650,"url":"https://github.com/spuerta10/pyconfparser","last_synced_at":"2025-03-15T04:14:38.676Z","repository":{"id":282315302,"uuid":"947425120","full_name":"spuerta10/PyConfParser","owner":"spuerta10","description":"A secure and flexible Python library for parsing, validating, and managing configuration files (YAML, JSON, and more).","archived":false,"fork":false,"pushed_at":"2025-03-13T22:17:01.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T23:25:09.672Z","etag":null,"topics":["library","pydantic","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spuerta10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-12T17:04:04.000Z","updated_at":"2025-03-13T22:17:04.000Z","dependencies_parsed_at":"2025-03-13T23:35:13.245Z","dependency_job_id":null,"html_url":"https://github.com/spuerta10/PyConfParser","commit_stats":null,"previous_names":["spuerta10/pyconfparser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spuerta10%2FPyConfParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spuerta10%2FPyConfParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spuerta10%2FPyConfParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spuerta10%2FPyConfParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spuerta10","download_url":"https://codeload.github.com/spuerta10/PyConfParser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681077,"owners_count":20330155,"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":["library","pydantic","python3"],"created_at":"2025-03-15T04:14:37.874Z","updated_at":"2025-03-15T04:14:38.668Z","avatar_url":"https://github.com/spuerta10.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyConfParser\nPyConfParser is a secure and flexible Python library for parsing, validating, and managing configuration files.\n\n## Installation\nYou can install this library via pip:\n\n```shell\npip install git+https://github.com/spuerta10/PyConfParser.git\n```\n\nOr install it via [uv](https://docs.astral.sh/uv/):\n```shell\nuv add git+https://github.com/spuerta10/PyConfParser.git\n```\n\n## Usage\n### Basic Usage\nHere is a quick example of how to use this library:\n\n```json\n{\n    \"PASS\": \"some-content\",\n    \"ENDPOINTS\": {\n        \"ENDPOINT1\": \"http://your-endpoint-1.com\",\n        \"ENDPOINT2\": \"http://your-endpoint-2.com\"\n    }\n}\n```\n*configurations.json*\n\n```python\nfrom pyconfparser import ConfigFactory\n\nconfigurations_path: str = \"/path/to/configurations.json\"  # the path can be relative or absolute\nconfigurations = ConfigFactory.get_conf(configurations_path)\n\nconfigurations.api_key  # to obtain 'your-api-key'\nconfigurations.enpoints[\"ENDPOINT1\"]  # to obtain 'http://your-endpoint-1.com'\nconfigurations.enpoints[\"ENDPOINT2\"]  # to obtain 'http://your-endpoint-2.com'\n```\n\n### Using with a Schema\nFor stricter validation, you can define a schema using `pydantic` to ensure the configuration follows the expected structure.\n\n```python\nfrom pyconfparser import ConfigFactory\nfrom pydantic import BaseModel\n\nclass ConfigSchema(BaseModel):\n    PASS: str\n    ENDPOINTS: dict[str, str]\n\nconfigurations_path: str = \"/path/to/configurations.json\"  # the path can be relative or absolute\nconfigurations = ConfigFactory.get_conf(configurations_path, ConfigSchema)\n\nconfigurations.api_key  # to obtain 'your-api-key'\nconfigurations.enpoints[\"ENDPOINT1\"]  # to obtain 'http://your-endpoint-1.com'\nconfigurations.enpoints[\"ENDPOINT2\"]  # to obtain 'http://your-endpoint-2.com'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspuerta10%2Fpyconfparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspuerta10%2Fpyconfparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspuerta10%2Fpyconfparser/lists"}