Skip to main content

Generate fake JSON user data and lorem ipsum with a Star Trek theme.

Project description

JSON Trek

Star-Trek-flavored JSON data

Generate fake JSON user data and lorem ipsum with a Star Trek theme.

CI

Fake User Data

JSON Trek can generate user information for the following categories:

  • Username
  • Email address
  • First name
  • Last name
  • Address
    • Street
    • City
    • State
    • Country
    • Zip code
  • Occupation

Install

$ pip install json-trek

Usage

>>> from json_trek import JSONTrek

>>> trek = JSONTrek()

Methods

user_profile(fields: list)

If called without a list of fields, user_profile will generate values for all fields.

Username fields

  • username
  • email
  • first_name
  • last_name
  • occupation
  • address
>>> trek.user_profile() # generate a user profile with all fields

# the output here is formatted for readability
{
  "username": "CyberneticImplant8",
  "email": "SporeDrive48@sector68.fed",
  "first_name": "Mirab",
  "last_name": "Zshaar",
  "occupation": "Xenoanthropologist",
  "address": {
    "street": "665 N. Bomar Hwy.",
    "city": "Nyria III",
    "state": "RT",
    "country": "Tessen III",
    "zipcode": "43974-3953"
  }
}
>>> trek.user_profile([ 'username', 'email' ]) # or, pass a list of the desired user profile fields

# the output here is formatted for readability
{
  "username": "FluxIsolator81",
  "email": "IsodyneRelay17@sector21.trk"
}

username()

Generate a username consisting of two words and a number.

>>> trek.username()
"OrbitalTether35"

email()

Generate an email address. This is the same as the output from username ending with @sector0-100 and ending with .com, .trk, .edu, .fed, or .net

>>> trek.email()
"IconianCombadge48@sector63.net"

get_name(first_or_last: str = 'both')

Generate a first and last name together or each individually.

>>> trek.name()
"K'Kath Lor"

>>> trek.name('first')
"Ilia"

>>> trek.name('last')
"Xerius"

occupation()

Generate an occupation.

>>> trek.occupation('first')
"Chief Medical Officer"

address()

Generate an address with values for street, city, state, country and zipcode.

>>> trek.address()

# the output here is formatted for readability
{
  "street": "75 Aldean St.",
  "city": "Risa",
  "state": "CR",
  "country": "Ganalda IV",
  "zipcode": "73691-9986"
}

ipsum(n: int = 30, lang: str = 'human')

Args:

  • n - minimum number of words to generate (some words come as pairs so the final string might be more than n words.)
  • lang - language in which to generate lorem ipsum text
    • 'human' (default)
    • 'klingon'
>>> trek.ipsum() # generate 30 human words
"Matter synthesizer? Holosuite hovercar runabout kantare? Kelva ithenite nuubari sensor mundahla taresia narva verdanis combadge ardana lothra leyron argosian. Burke? Xindus varro? Eridanus. Xelatian lyssarian hovercar? Cepheus nakan kurlan valakis shuttlecraft!"

>>> trek.ipsum(10, 'klingon') # generate 10 klingon words
"Cha. Jatlh jajvam duj nenchoh pov jaghmeyjaj? Chack toj posmoh!"

Thanks to STAPI for providing a lot of the data used in this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json_trek-1.0.9.tar.gz (39.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

json_trek-1.0.9-py3.10.egg (42.3 kB view details)

Uploaded Egg

json_trek-1.0.9-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file json_trek-1.0.9.tar.gz.

File metadata

  • Download URL: json_trek-1.0.9.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for json_trek-1.0.9.tar.gz
Algorithm Hash digest
SHA256 0cf1a992d438b6ffbbbcced82be1ddccb80f71a12743d658fd84a7b71635c853
MD5 02dfb5558741cf89a0ec56e4375375c5
BLAKE2b-256 72e62b0d7d861568ffb109731ca435ba1206ee18fcace1c7917910c961894a5f

See more details on using hashes here.

File details

Details for the file json_trek-1.0.9-py3.10.egg.

File metadata

  • Download URL: json_trek-1.0.9-py3.10.egg
  • Upload date:
  • Size: 42.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for json_trek-1.0.9-py3.10.egg
Algorithm Hash digest
SHA256 d69b0e5361a869f46660569b07d3c80548174fcdcbd8d7b1b279aa5640901567
MD5 36c6bbcd3d22259ea0bfaa6bbdf292ad
BLAKE2b-256 0ac646c5466e94527db5e60fa9567c89c497fbd93233acb2b8b3cea130b0bdf2

See more details on using hashes here.

File details

Details for the file json_trek-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: json_trek-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for json_trek-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 93b7015121df7f0bd2042e710611e3d3e4aacc5e76b3fd43521cc5e0b18d8350
MD5 cd7a5d8518a5eebd8beb4f59002bf050
BLAKE2b-256 51e92620ba595a37bf781532ea9f22d0fa2932a52c2eede267a15eb302009865

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page