{"id":9733,"library":"faker-nonprofit","title":"Faker Nonprofit Provider","description":"Faker-nonprofit is a provider for the Faker library, extending its capabilities to generate fake nonprofit-specific data such as organization names, EINs, and other related information. It is currently at version 1.0.0 and has a flexible release cadence, typically releasing new versions as features or bug fixes are introduced.","status":"active","version":"1.0.0","language":"en","source_language":"en","source_url":"https://github.com/SFDO-Community-Sprints/Snowfakery-Nonprofit","tags":["faker","data generation","nonprofit","testing","data mocking"],"install":[{"cmd":"pip install faker-nonprofit","lang":"bash","label":"Install faker-nonprofit"}],"dependencies":[{"reason":"This library is a provider for Faker and requires it to function.","package":"faker","optional":false}],"imports":[{"note":"The provider class is located within the `provider` submodule, not directly under the top-level package.","wrong":"from faker_nonprofit import NonprofitProvider","symbol":"NonprofitProvider","correct":"from faker_nonprofit.provider import NonprofitProvider"}],"quickstart":{"code":"from faker import Faker\nfrom faker_nonprofit.provider import NonprofitProvider\n\n# Register the custom provider with Faker\nFaker.add_provider(NonprofitProvider)\n\n# Initialize Faker\nfake = Faker()\n\n# Generate fake nonprofit data\nprint(f\"Nonprofit Name: {fake.nonprofit_name()}\")\nprint(f\"Nonprofit EIN: {fake.nonprofit_ein()}\")\nprint(f\"Nonprofit Street Address: {fake.nonprofit_street_address()}\")\nprint(f\"Nonprofit City: {fake.nonprofit_city()}\")\nprint(f\"Nonprofit State: {fake.nonprofit_state_abbr()}\")\nprint(f\"Nonprofit Zip Code: {fake.nonprofit_zip_code()}\")","lang":"python","description":"This quickstart demonstrates how to import the NonprofitProvider, register it with the Faker instance, and then generate various pieces of fake nonprofit data."},"warnings":[{"fix":"Always use `Faker.add_provider(NonprofitProvider)` or `fake = Faker(); fake.add_provider(NonprofitProvider)` before attempting to use the provider's methods.","message":"Forgetting to register the provider with Faker. Faker custom providers must be explicitly added to the Faker instance or the Faker class itself before their methods can be called.","severity":"gotcha","affected_versions":"1.0.0+"},{"fix":"Import `NonprofitProvider` specifically from `faker_nonprofit.provider`: `from faker_nonprofit.provider import NonprofitProvider`.","message":"Incorrect import path for NonprofitProvider. The provider class is not directly accessible from the top-level `faker_nonprofit` package.","severity":"gotcha","affected_versions":"1.0.0+"},{"fix":"Consult the library's documentation or source code for a list of all available methods (e.g., `nonprofit_name`, `nonprofit_ein`, `nonprofit_city`).","message":"The available data fields are limited to those defined in the NonprofitProvider. Attempting to access non-existent attributes will result in an AttributeError.","severity":"gotcha","affected_versions":"1.0.0+"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Before using methods like `fake.nonprofit_name()`, ensure you add the provider: `Faker.add_provider(NonprofitProvider)`.","cause":"The NonprofitProvider has not been registered with the Faker instance or the Faker class.","error":"AttributeError: 'Faker' object has no attribute 'nonprofit_name'"},{"fix":"Change the import to `from faker_nonprofit.provider import NonprofitProvider`.","cause":"Incorrect import statement for the NonprofitProvider class. The class is nested within a `provider` submodule.","error":"ModuleNotFoundError: No module named 'faker_nonprofit.NonprofitProvider'"},{"fix":"Pass the `NonprofitProvider` class as the argument: `Faker.add_provider(NonprofitProvider)`.","cause":"Attempting to call `Faker.add_provider()` without passing the provider class or object as an argument.","error":"TypeError: add_provider() missing 1 required positional argument: 'provider'"}]}