Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

names

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

names

Generate random names

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

names

.. image:: https://secure.travis-ci.org/treyhunner/names.png?branch=master :target: http://travis-ci.org/treyhunner/names .. image:: https://coveralls.io/repos/treyhunner/names/badge.png?branch=master :target: https://coveralls.io/r/treyhunner/names

Random name generator

Installation

The script is available on PyPI_. To install with pip::

sudo pip install names

Usage

Names can be used as a command line utility or imported as a Python package.

Command Line Usage

To use the script from the command line:

.. code-block:: bash

    $ names
    John Powell

Python Package Usage

Here are examples of all current features:

.. code-block:: pycon

>>> import names
>>> names.get_full_name()
u'Patricia Halford'
>>> names.get_full_name(gender='male')
u'Patrick Keating'
>>> names.get_first_name()
'Bernard'
>>> names.get_first_name(gender='female')
'Christina'
>>> names.get_last_name()
'Szczepanek'

License

This project is released under an MIT License_.

Data in the following files are public domain (derived from 1990 Census data):

  • dist.all.last
  • dist.female.first
  • dist.male.first

.. _mit license: http://th.mit-license.org/2013 .. _available on PyPI: http://pypi.python.org/pypi/names/

Changes

0.3.0 (2013-05-14)

  • Fixed Python 3 support
  • Improved tests and fixed minor bugs

0.2 (2013-02-17)

  • Initial release

Contributing

Please file bugs to the Github issue tracker_. Pull requests are welcome.

.. _Github issue tracker: https://github.com/treyhunner/names/issues

Hacking and Pull Requests

Please try to conform to PEP8_ for code contributions and ensure that the tests continue to function.

Please include new tests with your pull requests when appropriate.

Running the tests


You will need `tox`_ and `coverage`_ installed to run the tests on your code:

.. code-block:: bash

    $ pip install tox coverage

To run the tests and generate a coverage report:

.. code-block:: bash

    $ ./runtests.sh

The coverage output should look similar to this::

    _____________________ summary _____________________
    py27: commands succeeded
    py32: commands succeeded
    py33: commands succeeded
    pypy: commands succeeded
    flake8: commands succeeded
    congratulations :)
    Name             Stmts   Miss Branch BrMiss  Cover
    --------------------------------------------------
    names/__init__      25      0      8      0   100%
    names/main           4      0      0      0   100%
    --------------------------------------------------
    TOTAL               29      0      8      0   100%

.. _pep8: http://www.python.org/dev/peps/pep-0008/
.. _tox: http://testrun.org/tox/latest/
.. _coverage: https://pypi.python.org/pypi/coverage/

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc