Science fiction themed Faker provider for multiple universes including Star Trek, Star Wars, Battlestar Galactica, and more
Project description
Faker Galactic
Custom Faker provider for generating science fiction themed data from popular sci-fi universes
Installation
pip install faker-galactic
Or with uv:
uv add faker-galactic
Quick Start
from faker import Faker
from faker_galactic import SciFiProvider
fake = Faker()
fake.add_provider(SciFiProvider)
# Generate random sci-fi names
print(fake.scifi_first_name()) # "Spock"
print(fake.scifi_name()) # "James Kirk"
# Generate Star Trek specific data
print(fake.scifi_name(universe='startrek')) # "Spock Sulu"
print(fake.starship(universe='startrek')) # "USS Enterprise"
print(fake.scifi_rank(universe='startrek')) # "Captain"
Methods
All methods accept an optional universe parameter. When None (default), data is mixed from all universes. When specified (e.g., 'startrek'), only that universe's data is used.
Name Generation
faker.scifi_first_name(universe: str | None = None) -> str
faker.scifi_first_name_male(universe: str | None = None) -> str
faker.scifi_first_name_female(universe: str | None = None) -> str
faker.scifi_last_name(universe: str | None = None) -> str
faker.scifi_last_name_male(universe: str | None = None) -> str
faker.scifi_last_name_female(universe: str | None = None) -> str
faker.scifi_name(universe: str | None = None) -> str # Full name (first + last)
Military & Organizations
faker.scifi_rank(universe: str | None = None) -> str # "Captain", "Commander", etc.
Starships
faker.starship(universe: str | None = None) -> str # "USS Enterprise"
faker.starship_class(universe: str | None = None) -> str # "Galaxy-class"
faker.starship_registry(
universe: str | None = None,
prefix_only: bool = False, # Return "NCC" only
number_only: bool = False # Return "1701" only
) -> str # Full: "NCC-1701"
Locations & Culture
faker.scifi_location(universe: str | None = None) -> str # "USS Enterprise Recreation Deck"
faker.scifi_language(universe: str | None = None) -> str # "Klingon", "Vulcan", etc.
faker.scifi_quote(universe: str | None = None) -> str # Famous quotes
Canonical Characters
Unlike other methods that generate random combinations, canonical characters return actual characters from the source material with complete profiles. Use when you need realistic, recognizable characters with consistent metadata (e.g., demo data where "Captain Picard commands the Enterprise" makes sense).
faker.scifi_canonical_character(universe: str | None = None) -> CanonicalCharacter
Returns a CanonicalCharacter dataclass with:
first_name: strlast_name: strname: str(property: full name)rank: str | Nonestarship: str | Nonestarship_registry: str | Nonestarship_class: str | Nonelanguage: str | Nonequotes: list[str] | None
Supported Universes
'startrek' - Star Trek (TOS, TNG, DS9, VOY, Discovery)
Data counts:
- 30 male first names, 30 female first names
- 30 male last names, 20 female last names
- 19 ranks (Captain, Commander, Admiral, Ensign, etc.)
- 24 starships (USS Enterprise, USS Voyager, USS Defiant, etc.)
- 4 registry patterns with weights (NCC-####, NCC-#####, NX-#####, NAR-#####)
- 18 starship classes (Galaxy-class, Intrepid-class, Constitution-class, etc.)
- 15 base locations (Starfleet Academy, Deep Space Nine, Earth Spacedock, etc.)
- 20 location details (Recreation Deck, Holodeck, Sickbay, etc.)
- 14 languages (Klingon, Vulcan, Romulan, Cardassian, Bajoran, etc.)
- 20 famous quotes
- 20 canonical characters (Picard, Kirk, Janeway, Spock, Data, etc.)
Contributing
Interested in adding new universes or improving the library? See CONTRIBUTING.md for:
- Development setup
- Code quality standards
- How to add new universes
- Testing guidelines
- Pull request process
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file faker_galactic-1.0.2.tar.gz.
File metadata
- Download URL: faker_galactic-1.0.2.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c8664525dc97e7b6b42cc0d72791a2283b3b70669e9fea2d82a787ff0b26c90
|
|
| MD5 |
dbf65ce6826e36c8c8c6f14eb2d6e64f
|
|
| BLAKE2b-256 |
cae10b3f29ced6e40abde377066c7d163f8951a3cef32ee607a5e6ad82358984
|
File details
Details for the file faker_galactic-1.0.2-py3-none-any.whl.
File metadata
- Download URL: faker_galactic-1.0.2-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45acd5d09484240cc5ec795b949ebc98ca1575ae6da4ee85fafd8663bbf86ed2
|
|
| MD5 |
08d5a754a332b3d82a51b285f5b79f81
|
|
| BLAKE2b-256 |
498eba699fcba9a2abc71e78dc7f0e7c4978f566c5a139391f0f447d8362365a
|