{"id":19115356,"url":"https://github.com/perchunpak/optional-faker","last_synced_at":"2025-04-30T23:09:11.507Z","repository":{"id":63126201,"uuid":"565418812","full_name":"PerchunPak/optional-faker","owner":"PerchunPak","description":"Small wrapper around faker, to make values optional!","archived":false,"fork":false,"pushed_at":"2023-12-15T21:52:28.000Z","size":218,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T23:09:09.813Z","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/PerchunPak.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2022-11-13T10:57:56.000Z","updated_at":"2024-11-30T23:37:31.000Z","dependencies_parsed_at":"2023-12-15T22:44:52.878Z","dependency_job_id":null,"html_url":"https://github.com/PerchunPak/optional-faker","commit_stats":{"total_commits":26,"total_committers":4,"mean_commits":6.5,"dds":"0.34615384615384615","last_synced_commit":"d3377fe348e89a5f908c7c65f52bc0ae45a3d176"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerchunPak%2Foptional-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerchunPak%2Foptional-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerchunPak%2Foptional-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PerchunPak%2Foptional-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PerchunPak","download_url":"https://codeload.github.com/PerchunPak/optional-faker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795415,"owners_count":21645023,"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-09T04:46:10.194Z","updated_at":"2025-04-30T23:09:11.470Z","avatar_url":"https://github.com/PerchunPak.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# optional-faker\n\n[![Support Ukraine](https://badgen.net/badge/support/UKRAINE/?color=0057B8\u0026labelColor=FFD700)](https://www.gov.uk/government/news/ukraine-what-you-can-do-to-help)\n\n[![Build Status](https://github.com/PerchunPak/optional-faker/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/PerchunPak/optional-faker/actions?query=workflow%3Atest)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Python support versions badge (from pypi)](https://img.shields.io/pypi/pyversions/optional-faker)](https://www.python.org/downloads/)\n\nSmall wrapper around faker, to make values optional!\n\nNote that faker added own `optional` proxy, which however can be used only with callables. This is why in version 2.0.0 we renamed our method to `none_or`.\n\n## Example\n\n```py\n\u003e\u003e\u003e from faker import Faker\n\u003e\u003e\u003e import optional_faker\n\u003e\u003e\u003e\n\u003e\u003e\u003e fake = Faker()\n\u003e\u003e\u003e Faker.seed(1555)\n\u003e\u003e\u003e\n\u003e\u003e\u003e # `fake.none_or` can take any value, and return it, or None.\n\u003e\u003e\u003e fake.none_or(fake.pystr())\n'scHhghRDleajCHjEYWAu'\n\u003e\u003e\u003e fake.none_or(fake.pystr())\nNone\n\u003e\u003e\u003e # or it can take callable, and *args with **kwargs\n\u003e\u003e\u003e # that will be passed to this callable.\n\u003e\u003e\u003e fake.none_or(fake.pystr, 1, max_chars=10)\n'zmZUcJVTYX'\n\u003e\u003e\u003e fake.none_or(fake.pystr, 1, max_chars=10)\nNone\n\u003e\u003e\u003e # there is no explicit check is callable a faker part,\n\u003e\u003e\u003e # so you can pass anything.\n\u003e\u003e\u003e fake.none_or(lambda: \"my callable!\")\n'my callable!'\n\u003e\u003e\u003e fake.none_or(lambda: \"my callable!\")\nNone\n```\n\n## Installing\n\n```bash\npip install optional-faker\n```\n\nAnd then you need to import `optional_faker` anywhere but before creating `Faker` instance.\n\n## Installing for local developing\n\n```bash\ngit clone https://github.com/PerchunPak/optional-faker.git\ncd optional-faker\n```\n\n### Installing `poetry`\n\nNext we need install `poetry` with [recommended way](https://python-poetry.org/docs/master/#installation).\n\nIf you use Linux, use command:\n\n```bash\ncurl -sSL https://install.python-poetry.org | python -\n```\n\nIf you use Windows, open PowerShell with admin privileges and use:\n\n```powershell\n(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -\n```\n\n### Installing dependencies\n\n```bash\npoetry install\n```\n\n### If something is not clear\n\nYou can always write me!\n\n## Updating\n\n```bash\npip install -U optional-faker\n```\n\n### For local development\n\nFor updating, just re-download repository,\nif you used `git` for downloading, just run `git pull`.\n\n## Thanks\n\nThis project was inspired by [faker-optional](https://github.com/lyz-code/faker-optional).\n\nThis project was generated with [python-template](https://github.com/PerchunPak/python-template).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperchunpak%2Foptional-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperchunpak%2Foptional-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperchunpak%2Foptional-faker/lists"}