Skip to main content

A local SRD for offline access.

Project description

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.

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

tinys_srd-1.0.0.tar.gz (492.8 kB view details)

Uploaded Source

Built Distribution

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

tinys_srd-1.0.0-py3-none-any.whl (503.9 kB view details)

Uploaded Python 3

File details

Details for the file tinys_srd-1.0.0.tar.gz.

File metadata

  • Download URL: tinys_srd-1.0.0.tar.gz
  • Upload date:
  • Size: 492.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for tinys_srd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1be49810f73cd272fed62cc6e4eedf7e2bf8518e90f6faf7c57d921dcacb02dd
MD5 c6f39ca34625d8da133411e53ec2fe63
BLAKE2b-256 7e72996fea9b44b70180104c5b0ff3290edbf355606b1064399987aa36e05511

See more details on using hashes here.

File details

Details for the file tinys_srd-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tinys_srd-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 503.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for tinys_srd-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a39209c59f7f8effd857c90822d94ac45553494efc2182637845c51d5004976a
MD5 71760f1dad6d778e2d43609256391d8d
BLAKE2b-256 bc78a1ecd6767fdf006c07096b6fd2de6ee92a237f3d132e50b41d45b469c83e

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