valvefgd


Namevalvefgd JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://pysourcesdk.github.io/ValveFGD/
SummaryA library to parse .FGD files (editor schema definition files for the Source engine).
upload_time2023-08-05 04:31:48
maintainer
docs_urlNone
authorMaxime Dupuis
requires_python
licensegpl-3.0
keywords fgd source sourcesdk hammer valve
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            [![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/pySourceSDK/ValveFGD/blob/master/LICENSE.txt)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/valvefgd.svg)](https://pypi.python.org/pypi/valvefgd/)
[![Platforms](https://img.shields.io/badge/platform-Linux,_MacOS,_Windows-blue)]()
[![PyPI version fury.io](https://badge.fury.io/py/valvefgd.svg)](https://pypi.python.org/pypi/valvefgd/)
[![GitHub Workflow Status (with event)](https://github.com/pySourceSDK/ValveFGD/actions/workflows/CI.yml/badge.svg)]()
[![Test coverage](https://github.com/pySourceSDK/ValveFGD/blob/master/docs/source/coverage.svg "coverage")]()
# 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:

```bash
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:

```bash
git clone git@github.com:pySourceSDK/ValveFGD.git
```

and install it with:

```bash
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

```python
>>> 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.

```python
>>> from valvefgd import FgdWrite
>>> FgdWrite(fgd, 'tf-clone.fgd')
```

### Getting entity schemas

You can get entity schematics from an Fgd object.

```python
>>> 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
![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentity.jpg "FgdEntity terminology")

### FgdEntityInput/Output
![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentityio.jpg "FgdEntityInput/Output terminology")

### FgdEntityProperty
![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentityproperty.jpg "FgdEntityProperty terminology")

### FgdEntityPropertyOption
![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentitypropertyoption.jpg "FgdEntityPropertyOption terminology")

### FgdEntitySpawnflag
![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentityspawnflags.jpg "FgdEntitySpawnflag terminology")


            

Raw data

            {
    "_id": null,
    "home_page": "https://pysourcesdk.github.io/ValveFGD/",
    "name": "valvefgd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "fgd,source,sourcesdk,hammer,valve",
    "author": "Maxime Dupuis",
    "author_email": "mdupuis@hotmail.ca",
    "download_url": "https://files.pythonhosted.org/packages/45/64/cec341c1370ac85f84d2420ebb06e280850538c76f44b892319443bf4413/valvefgd-1.0.5.tar.gz",
    "platform": null,
    "description": "[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/pySourceSDK/ValveFGD/blob/master/LICENSE.txt)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/valvefgd.svg)](https://pypi.python.org/pypi/valvefgd/)\n[![Platforms](https://img.shields.io/badge/platform-Linux,_MacOS,_Windows-blue)]()\n[![PyPI version fury.io](https://badge.fury.io/py/valvefgd.svg)](https://pypi.python.org/pypi/valvefgd/)\n[![GitHub Workflow Status (with event)](https://github.com/pySourceSDK/ValveFGD/actions/workflows/CI.yml/badge.svg)]()\n[![Test coverage](https://github.com/pySourceSDK/ValveFGD/blob/master/docs/source/coverage.svg \"coverage\")]()\n# ValveFGD\n\nValveFGD 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.\n\nFull documentation: https://pysourcesdk.github.io/ValveFGD/\n\n## Installation\n\n### PyPI\n\nValveFGD is available on the Python Package Index. This makes installing it with pip as easy as:\n\n```bash\npip3 install valvefgd\n```\n\n### Git\n\nIf you want the latest code or even feel like contributing, the code is available on GitHub.\n\nYou can easily clone the code with git:\n\n```bash\ngit clone git@github.com:pySourceSDK/ValveFGD.git\n```\n\nand install it with:\n\n```bash\npython3 setup.py install\n```\n\n## Usage\n\nHere's a few example usage of ValveFGD\n\n### Parsing\n\nYou can get a Fgd object by parsing an .fgd file using FgdParse\n\n```python\n>>> from valvefgd import FgdParse\n>>> fgd = FgdParse('C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/bin/tf.fgd')\n```\n\n### Writing\n\nYou can write an .fgd file from a Fgd object.\n\n\n> 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.\n\n```python\n>>> from valvefgd import FgdWrite\n>>> FgdWrite(fgd, 'tf-clone.fgd')\n```\n\n### Getting entity schemas\n\nYou can get entity schematics from an Fgd object.\n\n```python\n>>> env_fire = fgd.entity_by_name('env_fire')\n>>> print(env_fire.schema)\n{'properties': {'targetname': {'type': 'string', 'description': 'The name...'}, ...},\n'inputs': {'StartFire': {'type': 'void', 'description': 'Start the fire'}, ...},\n'outputs': {'onIgnited': {'type': 'void', 'description':'Fires when...'}, ...}}\n```\n\n## Terminology\n\nHere are some color coded charts for the terminology used in this library for fgd files.\n\n### FgdEntity\n![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentity.jpg \"FgdEntity terminology\")\n\n### FgdEntityInput/Output\n![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentityio.jpg \"FgdEntityInput/Output terminology\")\n\n### FgdEntityProperty\n![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentityproperty.jpg \"FgdEntityProperty terminology\")\n\n### FgdEntityPropertyOption\n![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentitypropertyoption.jpg \"FgdEntityPropertyOption terminology\")\n\n### FgdEntitySpawnflag\n![alt text](https://github.com/pySourceSDK/ValveFGD/raw/master/docs/source/_static/fgdentityspawnflags.jpg \"FgdEntitySpawnflag terminology\")\n\n",
    "bugtrack_url": null,
    "license": "gpl-3.0",
    "summary": "A library to parse .FGD files (editor schema definition files for the Source engine).",
    "version": "1.0.5",
    "project_urls": {
        "Documentation": "https://pysourcesdk.github.io/ValveFGD/",
        "Github": "https://github.com/pySourceSDK/ValveFGD",
        "Homepage": "https://pysourcesdk.github.io/ValveFGD/"
    },
    "split_keywords": [
        "fgd",
        "source",
        "sourcesdk",
        "hammer",
        "valve"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c3a73da31670e60fd2e2711f836db024c5fe8e7c0f9ca690b226da8e36ee56ed",
                "md5": "9f96e86905211904e9393634bcc6b3d0",
                "sha256": "2bfffa5b4cb792f6d770c6ecd59f8af61f7c2604438eb5e735705272ffe0a13b"
            },
            "downloads": -1,
            "filename": "valvefgd-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f96e86905211904e9393634bcc6b3d0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 23034,
            "upload_time": "2023-08-05T04:31:46",
            "upload_time_iso_8601": "2023-08-05T04:31:46.828565Z",
            "url": "https://files.pythonhosted.org/packages/c3/a7/3da31670e60fd2e2711f836db024c5fe8e7c0f9ca690b226da8e36ee56ed/valvefgd-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4564cec341c1370ac85f84d2420ebb06e280850538c76f44b892319443bf4413",
                "md5": "80da5b162f637de95e2345bb5ab81924",
                "sha256": "f78a3de5e76cf8471af8f0cc4f7c0e551521c6c184fce08963f813256dccdbb9"
            },
            "downloads": -1,
            "filename": "valvefgd-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "80da5b162f637de95e2345bb5ab81924",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24039,
            "upload_time": "2023-08-05T04:31:48",
            "upload_time_iso_8601": "2023-08-05T04:31:48.303541Z",
            "url": "https://files.pythonhosted.org/packages/45/64/cec341c1370ac85f84d2420ebb06e280850538c76f44b892319443bf4413/valvefgd-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-05 04:31:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pySourceSDK",
    "github_project": "ValveFGD",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "valvefgd"
}
        
Elapsed time: 1.76845s