Last active
          October 14, 2022 03:34 
        
      - 
      
- 
        Save codeadict/9512a87becd0f27e69070ca8b021d350 to your computer and use it in GitHub Desktop. 
    Planet provider for faker
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from faker.providers import BaseProvider | |
| class PlanetProvider(BaseProvider): | |
| __provider__ = 'planet' | |
| __lang___ = 'en_US' | |
| planets = ['Neptune', 'Mars', 'Mercury', 'Venus', 'Earth', 'Jupiter', 'Saturn', 'Uranus'] | |
| def planet(self): | |
| return self.random_element(self.planets) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment