ValveFGD
ValveFGD is a Python library designed to parse and edit .FGD files, which provides logic entity schemas for Valve's level editor as well as some configuration information.
Full documentation: https://pysourcesdk.github.io/ValveFGD/
Installation
PyPI
ValveFGD is available on the Python Package Index. This makes installing it with pip as easy as:
pip3 install valvefgd
Git
If you want the latest code or even feel like contributing, the code is available on GitHub.
You can easily clone the code with git:
git clone git@github.com:pySourceSDK/ValveFGD.git
and install it with:
python3 setup.py install
Usage
Here's a few example usage of ValveFGD
Parsing
You can get a Fgd object by parsing an .fgd file using FgdParse
>>> from valvefgd import FgdParse
>>> fgd = FgdParse('C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/bin/tf.fgd')
Writing
You can write an .fgd file from a Fgd object.
Parsing/writing is destructive. Comments will be lost. The original structure of the file may be altered. The actual data about entities and the inheritance hierarchy is untouched however.
>>> from valvefgd import FgdWrite
>>> FgdWrite(fgd, 'tf-clone.fgd')
Getting entity schemas
You can get entity schematics from an Fgd object.
>>> env_fire = fgd.entity_by_name('env_fire')
>>> print(env_fire.schema)
{'properties': {'targetname': {'type': 'string', 'description': 'The name...'}, ...},
'inputs': {'StartFire': {'type': 'void', 'description': 'Start the fire'}, ...},
'outputs': {'onIgnited': {'type': 'void', 'description':'Fires when...'}, ...}}
Terminology
Here are some color coded charts for the terminology used in this library for fgd files.
FgdEntity
FgdEntityInput/Output
FgdEntityProperty
FgdEntityPropertyOption
FgdEntitySpawnflag
Metadata
Release files for valvefgd 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| valvefgd-1.0.5.tar.gz | 24.0 kB | Without provenance | Details for valvefgd-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| valvefgd-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for valvefgd-1.0.5-py3-none-any.whl |
Total release size: 47.1 kB
Release files / valvefgd-1.0.5.tar.gz
| Download URL | valvefgd-1.0.5.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f78a3de5e76cf8471af8f0cc4f7c0e551521c6c184fce08963f813256dccdbb9
|
|
BLAKE2b-256 checksum How to use checksums |
4564cec341c1370ac85f84d2420ebb06e280850538c76f44b892319443bf4413
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / valvefgd-1.0.5-py3-none-any.whl
| Download URL | valvefgd-1.0.5-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bfffa5b4cb792f6d770c6ecd59f8af61f7c2604438eb5e735705272ffe0a13b
|
|
BLAKE2b-256 checksum How to use checksums |
c3a73da31670e60fd2e2711f836db024c5fe8e7c0f9ca690b226da8e36ee56ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for valvefgd 1.0.5
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.