Skip to main content

Tool for retrieving information from Diablo 2 data files

Project description

d2lib is a tool for retrieving information from Diablo 2 data files. These files contain info about the character, items and their properties.

Supported files:

  • .d2s - Diablo 2 save files;

  • .d2x - PlugY personal stash files;

  • .sss - PlugY shared stash files.

Installation

Prerequisites

  • Python 3.6+

You can install d2lib using pip:

pip install d2lib

Usage

from d2lib.files import D2SFile, D2XFile, SSSFile

d2s_file = D2SFile('tests/data/test_d2s.d2s')
d2x_file = D2XFile('tests/data/test_d2x.d2x')
sss_file = SSSFile('tests/data/test_sss.sss')

# Character attributes.
print(d2s_file.char_class)
print(d2s_file.char_name)
print(d2s_file.char_level)
print(d2s_file.is_died)
print(d2s_file.last_played)
print(d2s_file.attributes)
print(d2s_file.skills)

# Get all unique items.
for item in d2s_file.items:
    if item.is_unique:
        print(item.level)
        print(item.name)
        print(item.base_name)
        print(item.magic_attrs)

# or for stash files
for page in d2x_file.stash:  # there may also be a SSSFile instance
    for item in page['items']:
        if item.is_unique:
            print(item.level)
            print(item.name)
            print(item.base_name)
            print(item.magic_attrs)

Acknowledgments

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

d2lib-0.2.4.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

d2lib-0.2.4-py2.py3-none-any.whl (46.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file d2lib-0.2.4.tar.gz.

File metadata

  • Download URL: d2lib-0.2.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for d2lib-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d3efeddb99c10e37739b8c795c1cbc389a736d3cf42f69d39ff0205d92594698
MD5 4d0265973c7e23201280fa638b522f1f
BLAKE2b-256 496ecbf195166754df91b730c46a1ea80c5525f8a115a6a4157911f1e0e0d82b

See more details on using hashes here.

File details

Details for the file d2lib-0.2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: d2lib-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 46.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for d2lib-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bc34164aa4fe663e97f6536defbb7b8e25ceb95591b7119afbf6a6e6b2077075
MD5 fd9b041a4f75d03c7308de6299f04c22
BLAKE2b-256 49dc694dc1a4e5f3cdb187f955ca4515b94eba6d793417159fbc951269e2dbf1

See more details on using hashes here.

Supported by

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