www.cochar.pl/api/v1/get
curl -X GET https://www.cochar.pl/api/v1/get
{ "year": 1925, "country": "US", "first_name": "Darryl", "last_name": "Delvalle", "age": 51, "sex": "M", "occupation": "musician", "strength": 37, "condition": 25, "size": 81, "dexterity": 67, "appearance": 25, "education": 66, "intelligence": 74, "power": 62, "move_rate": 5, "luck": 18, "damage_bonus": "0", "build": 0, "skills": { "listen": 89, "psychology": 71, "art/craft (writer)": 12, "acting": 88, "drive auto": 46, "swim": 83, "disguise": 38, "dodge": 34, "pilot": 7, "track": 56, "art/craft (cook)": 8, "credit rating": 27 }, "dodge": 34, "sanity_points": 62, "magic_points": 12, "hit_points": 10 }
Must be a valid integer, default 1925
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?year=invalid
{ "message": { "year": "invalid literal for int() with base 10: 'invalid'. Year mus be an integer number." } }
Country it's the characters origin. It determines the name
Available countries: US, PL, ES.
In future there might be more countries. Countries names follow alpha 2 code convention.
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?country=invalid
{ "message": { "country": "Bad choice: Invalid is not a valid choice. Country in alpha-2 code format. Available countries: 'US', 'PL', 'ES'" } }
Characters first name. By default random name is drawn. When "first_name" is provided, character with that name is returned.
Characters first name. By default random name is drawn. When "last_name" is provided, character with that name is returned.
It's a characters age. By default its random, between 15 and 90. When used, character with provided age is returned.
According to Call of Cthulhu rules, age affects basic characteristics.
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?age=14
{ "status": "fail", "message": "Age not in range: 14 -> [15, 90]." }400 Bad Request
curl -X GET https://www.cochar.pl/api/v1/get?age=invalid
{ "message": { "age": "Age must be an integer: invalid literal for int() with base 10: 'invalid'" } }
Character's sex, by default its random
Choices to specify gender: "M", "F"
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?sex=invalid
{ "message": { "sex": "Bad choice: invalid is not a valid choice. For random choice omit this parameter" } }
When random mode is set to True, character's characteristics are completely ignored when choosing occupation.
Omit this parameter if you don't want to generate completely random character.
According to Call of Cthulhu rules, game and characters can be placed in 3 different times: 1890, 1920 and modern. Those are just ruth delimiters to distinguish differences between set of skills and occupation that can occur in each era.
Available choices: "classic-1920", "modern"
To select both eras use: "classic-1920,modern"
"classic-1890" is not supported
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?era=invalid
{ "status": "fail", "message": "None occupation meets following criteria: type: None, era: ['invalid'], tags: None" }
"occup_type" also known as occupation set, defines from which set/expansion character's occupation are drown.
Available choices: "classic", "expansion", "custom"
Omit this parameter to select all.
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?occup_type=invalid
{ "message": { "occup_type": "invalid is not a valid choice" } }
Occupation can hav different tags.
Available choices: "lovecraftian", "criminal".
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?tags=invalid
{ "message": { "tags": "invalid is not a valid choice" } }
Character's occupation. When occupation is provided, character with that occupation is returned
400 Bad Requestcurl -X GET https://www.cochar.pl/api/v1/get?occupation=invalid
{ "status": "fail", "message": "'Invalid' not in available occupations. Check cochar.OCCUPATIONS_LIST" }
antiquarian
artist
athlete
author
bartender
butler/valet
chauffeur
clergy
computer programmer/technician
criminal
deprogrammer
dilettante
doctor of medicine
drifter
driver
engineer
entertainer
farmer
gangster boss
hacker
journalist
laborer, unskilled
lawyer
librarian
mechanic
military officer
missionary
musician
nurse
parapsychologist
pilot
police detective
police officer
private investigator
professor
sailor, commercial
sailor, naval
software tester
soldier
tribe member
waiter
zealot
curl -X GET https://www.cochar.pl/api/v1/get?era=modern&tags=lovecraftian
{ "status": "fail", "message": "None occupation meets following criteria: type: None, era: ['modern'], tags: ['lovecraftian']" }
Fast way of creating a random character for Call of Cthulhu RPG 7th ed.
cochar
stands for Call of Cthulhu Character
. It's a python package design to create a full characters for Call of Cthulhu RPG 7th ed.
www.cochar.pl demonstrates a power of cochar
package.
pip3 install cochar
Example:
```Python
from cochar import create_character person = create_character(1925, "US") person Character(year=1925, country='US', first_name='Anthem', last_name='Pharr', age=22, sex='M', occupation='doctor of medicine', strength=33, condition=30, size=78, dexterity=40, appearance=23, education=87, intelligence=65, power=50, move_rate=7, luck=38, skills={'first aid': 38, 'language [latin]': 9, 'medicine': 73, 'science [biology]': 48, 'ride': 64, 'anthropology': 6, 'charm': 46, 'intimidate': 32, 'art/craft (sculptor)': 9, 'credit rating': 74, 'dodge': 20}, damage_bonus='0', build=0, dodge=20, sanity_points=50, magic_points=10, hit_points=10) ```
Default settings are defined in ./data/settings.json
.
json
{
"min_age": 15,
"max_age": 90,
"max_skill_level": 90,
"year": 1925,
"age": null,
"sex": null,
"first_name": null,
"last_name": null,
"country": "US",
"occupation": null,
"weights": true,
"database": "",
"show_warnings": false,
"occupation_type": null,
"era": null,
"tags": null
}
cochar
depends on randname module for generating random names.
For more details please see:
Detailed documentation of module can by found here: cochar documentation
If you want to contribute to cochar
project read contribution for more information.
Web application is not a part of
cochar
package.
Web application was design to present the power of cochar
package. You can check it out on www.cochar.pl
Adam Walkiewicz
Cochar is licensed under the terms of the GNU AGPL v3