Code Monkey home page Code Monkey logo

fantasynames's Introduction

Fantasy Name Generator

PyPI version

A random name generator that produces names aligning (more or less) with common conventions for fantasy characters in fictional media such as Dungeons and Dragons or World of Warcraft.

Installation

python3 -m pip install fantasynames

Or if your project is using Poetry:

poetry add fantasynames

Usage

The following name generating methods are provided for a variety of different stereotypical fantasy "races", as well as a few different "medieval-y" languages:

import fantasynames as names

names.elf()
# Example outputs: 'Farathia Eaviel', 'Iethian Willowblossom'

names.dwarf()
# Example outputs: 'Dagdr Steelbeard', 'Thorinna Ironstrike'

names.hobbit()
# Example outputs: 'Libby Honeyfoot', 'Flublius Sweetscone'

names.french()
# Example outputs: 'Richert Roublac', 'Clavena de Clardalle'

names.anglo()
# Example outputs: 'Brandin of Avonlyn', 'Kallem Davenmere'

names.human()
# Example outputs: 'Danric du Tourbloc', 'Sumia Sageholme'

Note that human() provides a diverse mix of different first and last name styles, including anglo() and french()...and more!

You can also pass a string argument to specify whether you want to recieve masculine or feminine names. By default, it's totally random:

names.human() # this will randomly generate either a male or female name

names.human('any') # this is equivalent to the above, in case you want to be specific

names.human('male') # this will generate a masculine name

names.human('female') # this will generate a feminine name

Contributing

Poetry

This package uses Poetry for package management. After checking out the repo, use poetry install to install all the required dependencies. Anytime you need to add a package, use:

poetry add PACKAGE_NAME_HERE

Continuous Integration Tests

We do code formatting with Python Black, additional linting with flake8, and type checking with mypy. Before opening a PR, please make sure to run all of these. Below is a helpful command to do them all at once:

poetry run black fantasynames && poetry run flake8 fantasynames && poetry run mypy fantasynames

We also run some tests with pytest:

poetry run pytest

Guides

If you want to make your own name generators, check out:

And then if you want to ramp up the complexity, take a look at:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.