Tinys SRD
This is a Python library for accessing data from the D&D SRD. It provides access to information about ability scores, equipment, and other game elements.
This library provides access to the SRD in local way with no API calls. This means that the library can be used offline.
Usage
Here's an example of how to use the library:
from tinys_srd import AbilityScores, Equipment
# Print the entries for ability scores
print(AbilityScores.entries)
# Print the attributes for equipment
print(Equipment.attributes)
# Print the strength ability score
print(AbilityScores.str)
# Print the damage for a battleaxe
print(Equipment.battleaxe.damage)
The library provides access to the following data:
- AbilityScores
- Alignments
- Backgrounds
- Classes
- Conditions
- DamageTypes
- EquipmentCategories
- Equipment
- Feats
- Features
- Languages
- Levels
- MagicItems
- MagicSchools
- Monsters
- Proficiencies
- Races
- RuleSections
- Rules
- Skills
- Spells
- Subclasses
- Subraces
- Traits
- WeaponProperti
https://github.com/5e-bits is where all this data originates
Adding New Classes
To add a new class to the dataset, you can use the entry_builder class. Here's an example of how to use it:
from tinys_srd import entry_builder
# Create instances of entry_builder for each entry
entry1 = entry_builder.entry_builder(attr1=value1, attr2=value2, ...)
entry2 = entry_builder.entry_builder(attr1=value1, attr2=value2, ...)
NOTE: The entry_builder class is not meant to be used directly. It is used to build the classes in this library. You should not need to create instances of it yourself. It does nothing except create a class from a dictionary, you have more control making the class yourself.
Extending a class
from tinys_srd import entry_builder
from tinys_srd.AbilityScores import *
# Create a new class that extends the AbilityScores class
entry1 = entry_builder.entry_builder(attr1=value1, attr2=value2, ...)
entry2 = entry_builder.entry_builder(attr1=value1, attr2=value2, ...)
You then import your file instead of AbilityScores. Do note that Intellisense suggestions may not work with this method and it may be better to keep the two seperate.
Release files for tinys-srd 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tinys_srd-1.0.0.tar.gz | 492.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tinys_srd-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 996.8 kB
Release files / tinys_srd-1.0.0.tar.gz
| Download URL | tinys_srd-1.0.0.tar.gz |
|---|---|
| Size | 492.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1be49810f73cd272fed62cc6e4eedf7e2bf8518e90f6faf7c57d921dcacb02dd
|
|
BLAKE2b-256 checksum How to use checksums |
7e72996fea9b44b70180104c5b0ff3290edbf355606b1064399987aa36e05511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.1
|
Release files / tinys_srd-1.0.0-py3-none-any.whl
| Download URL | tinys_srd-1.0.0-py3-none-any.whl |
|---|---|
| Size | 503.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a39209c59f7f8effd857c90822d94ac45553494efc2182637845c51d5004976a
|
|
BLAKE2b-256 checksum How to use checksums |
bc78a1ecd6767fdf006c07096b6fd2de6ee92a237f3d132e50b41d45b469c83e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.1
|