{"id":18898346,"url":"https://github.com/brainstone/python-format-operator-remake","last_synced_at":"2025-08-03T23:35:09.879Z","repository":{"id":69186498,"uuid":"421585154","full_name":"BrainStone/python-format-operator-remake","owner":"BrainStone","description":"An attempt to recreate the python format operator syntax as good as possible in modern C++","archived":false,"fork":false,"pushed_at":"2021-10-27T21:18:22.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T08:45:38.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/BrainStone.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-26T21:10:42.000Z","updated_at":"2021-10-27T21:18:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"5854ddb8-b4f7-44de-86f7-7afbf9af0d25","html_url":"https://github.com/BrainStone/python-format-operator-remake","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/BrainStone%2Fpython-format-operator-remake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2Fpython-format-operator-remake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2Fpython-format-operator-remake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2Fpython-format-operator-remake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrainStone","download_url":"https://codeload.github.com/BrainStone/python-format-operator-remake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239879317,"owners_count":19712176,"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-11-08T08:42:03.994Z","updated_at":"2025-02-20T17:14:37.128Z","avatar_url":"https://github.com/BrainStone.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-format-operator-remake\n\nAn attempt to recreate the python format operator syntax as good as possible in modern C++\n\nThe syntax in question is this:\n\n```py\n\"foo%s %d\" % (\"bar\", 42) # -\u003e \"foobar 42\"\n```\n\n## Goals\n\n1. Make the syntax look as similar as possible.\n2. Pass the arguments to C's `printf`-family functions. Do not reimplement the functionality (the challenge is about using the built in functions. Recreating `printf` as closely as possible would certainly also be an interesting challenge, but that's not what this about)\n3. Convert `std::string` to `char*`, so they can be used with `printf`\n4. Convert objects that can be streamed into an `std::ostream` into `char*` as well\n\n## Status\n\n1. Current syntax looks like `\"foo%s %d\" % _(\"bar\", 42)`, which is impressively close, considering C++ doesn't have a raw list syntax.\n2. This is currently the main issue. I haven't found a way to covert objects inside a container into multiple arguments or a `va_list` object\n3. Blocked by 2, but should be fairly easy with template magic\n4. Same as 3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainstone%2Fpython-format-operator-remake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainstone%2Fpython-format-operator-remake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainstone%2Fpython-format-operator-remake/lists"}