Skip to main content

D2lib

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

Metadata

Release files for d2lib 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for d2lib 0.2.4
File Size Uploaded Provenance Actions
d2lib-0.2.4.tar.gz 17.1 kB Without provenance Details for d2lib-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for d2lib 0.2.4
File Interpreter ABI Platform Actions
d2lib-0.2.4-py2.py3-none-any.whl Python 3, Python 2 none any Details for d2lib-0.2.4-py2.py3-none-any.whl

Total release size: 63.9 kB

Release files / d2lib-0.2.4.tar.gz

Download URL d2lib-0.2.4.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d3efeddb99c10e37739b8c795c1cbc389a736d3cf42f69d39ff0205d92594698
BLAKE2b-256 checksum
How to use checksums
496ecbf195166754df91b730c46a1ea80c5525f8a115a6a4157911f1e0e0d82b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / d2lib-0.2.4-py2.py3-none-any.whl

Download URL d2lib-0.2.4-py2.py3-none-any.whl
Size 46.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bc34164aa4fe663e97f6536defbb7b8e25ceb95591b7119afbf6a6e6b2077075
BLAKE2b-256 checksum
How to use checksums
49dc694dc1a4e5f3cdb187f955ca4515b94eba6d793417159fbc951269e2dbf1
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for d2lib 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page