xcodeproj


Namexcodeproj JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/Microsoft/xcodeproj
SummaryA utility for interacting with Xcode's xcodeproj bundle format.
upload_time2023-11-30 13:48:24
maintainerNone
docs_urlNone
authorDale Myers
requires_python>=3.10,<4.0
licenseMIT
keywords xcode xcodeproj pbxproj apple
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # xcodeproj

`xcodeproj` is a utility for interacting with Xcode's xcodeproj bundle format.

It expects some level of understanding of the internals of the pbxproj format and schemes. Note that this tool only reads projects. It does not write out any changes. If you are looking for more advanced functionality like this, I recommend looking at the Ruby gem of the same name (which is unaffiliated in anyway). 

To learn more about the format, you can look at any of these locations:

* <http://www.monobjc.net/xcode-project-file-format.html>
* <https://www.rubydoc.info/gems/xcodeproj/Xcodeproj/Project>

## Getting Started

Loading a project is very simple:

```python
project = xcodeproj.XcodeProject("/path/to/project.xcodeproj")
```

From here you can explore the project in different ways:

```python

# Get all targets
for target in project.targets:
    print(target.name)

# Print from the root level, 2 levels deep (.project is a property on the root 
# project as other properties such as .schemes are also available)
for item1 in project.project.main_group.children:
    print(item1)
    if not isinstance(item1, xcodeproj.PBXGroup):
        continue

    for item2 in item1.children:
        print("\t", item2)

# Check that all files referenced in the project exist on disk
for item in project.fetch_type(xcodeproj.PBXFileReference).values():
    assert os.path.exists(item.absolute_path())

# You can access the raw objects map directly:
obj = project.objects["key here"]

# For any object you have, you can access its key/identifier via the 
# `.object_key` property
key = obj.object_key
```

Note: This library is "lazy". Many things aren't calculated until they are used. This time will be inconsequential on smaller projects, but on larger ones, it can save quite a bit of time due to not parsing the entire project on load. These properties are usually stored though so that subsequent accesses are instant.

## Note on Scheme Support
There's no DTD for xcscheme files, so the implementation has been guessed. There will definitely be holes that still need to be patched in it though. Please open an issue if you find any, along with a sample xcscheme file.

## Contributing

This project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft 
trademarks or logos is subject to and must follow 
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Microsoft/xcodeproj",
    "name": "xcodeproj",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": null,
    "keywords": "xcode,xcodeproj,pbxproj,apple",
    "author": "Dale Myers",
    "author_email": "dalemy@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/21/37/9894e43b44c2edd3db1dfd5a73327076c6415a3a7b40998e3ac389efce9b/xcodeproj-2.1.0.tar.gz",
    "platform": null,
    "description": "# xcodeproj\n\n`xcodeproj` is a utility for interacting with Xcode's xcodeproj bundle format.\n\nIt expects some level of understanding of the internals of the pbxproj format and schemes. Note that this tool only reads projects. It does not write out any changes. If you are looking for more advanced functionality like this, I recommend looking at the Ruby gem of the same name (which is unaffiliated in anyway). \n\nTo learn more about the format, you can look at any of these locations:\n\n* <http://www.monobjc.net/xcode-project-file-format.html>\n* <https://www.rubydoc.info/gems/xcodeproj/Xcodeproj/Project>\n\n## Getting Started\n\nLoading a project is very simple:\n\n```python\nproject = xcodeproj.XcodeProject(\"/path/to/project.xcodeproj\")\n```\n\nFrom here you can explore the project in different ways:\n\n```python\n\n# Get all targets\nfor target in project.targets:\n    print(target.name)\n\n# Print from the root level, 2 levels deep (.project is a property on the root \n# project as other properties such as .schemes are also available)\nfor item1 in project.project.main_group.children:\n    print(item1)\n    if not isinstance(item1, xcodeproj.PBXGroup):\n        continue\n\n    for item2 in item1.children:\n        print(\"\\t\", item2)\n\n# Check that all files referenced in the project exist on disk\nfor item in project.fetch_type(xcodeproj.PBXFileReference).values():\n    assert os.path.exists(item.absolute_path())\n\n# You can access the raw objects map directly:\nobj = project.objects[\"key here\"]\n\n# For any object you have, you can access its key/identifier via the \n# `.object_key` property\nkey = obj.object_key\n```\n\nNote: This library is \"lazy\". Many things aren't calculated until they are used. This time will be inconsequential on smaller projects, but on larger ones, it can save quite a bit of time due to not parsing the entire project on load. These properties are usually stored though so that subsequent accesses are instant.\n\n## Note on Scheme Support\nThere's no DTD for xcscheme files, so the implementation has been guessed. There will definitely be holes that still need to be patched in it though. Please open an issue if you find any, along with a sample xcscheme file.\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A utility for interacting with Xcode's xcodeproj bundle format.",
    "version": "2.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Microsoft/xcodeproj",
        "Repository": "https://github.com/Microsoft/xcodeproj"
    },
    "split_keywords": [
        "xcode",
        "xcodeproj",
        "pbxproj",
        "apple"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "96cda8f67756554e86d61ca3e636db50641e92404972549b420fa78d4b7dba91",
                "md5": "29c945f37ce248dd7ece23e81cb03bb9",
                "sha256": "bdf94cb40c3971fb19c4542c54e17f00e484c0649d34742ada471232bdf2370e"
            },
            "downloads": -1,
            "filename": "xcodeproj-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "29c945f37ce248dd7ece23e81cb03bb9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 18629,
            "upload_time": "2023-11-30T13:48:26",
            "upload_time_iso_8601": "2023-11-30T13:48:26.393732Z",
            "url": "https://files.pythonhosted.org/packages/96/cd/a8f67756554e86d61ca3e636db50641e92404972549b420fa78d4b7dba91/xcodeproj-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "21379894e43b44c2edd3db1dfd5a73327076c6415a3a7b40998e3ac389efce9b",
                "md5": "7358bfd1ccc9a86be353ce53e3613b45",
                "sha256": "59e27c1423e3d105d6dfdb65abde60688a89a10cfe3c383a1bc1c833c3e9308b"
            },
            "downloads": -1,
            "filename": "xcodeproj-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7358bfd1ccc9a86be353ce53e3613b45",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 16444,
            "upload_time": "2023-11-30T13:48:24",
            "upload_time_iso_8601": "2023-11-30T13:48:24.594561Z",
            "url": "https://files.pythonhosted.org/packages/21/37/9894e43b44c2edd3db1dfd5a73327076c6415a3a7b40998e3ac389efce9b/xcodeproj-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-30 13:48:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Microsoft",
    "github_project": "xcodeproj",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "xcodeproj"
}
        
Elapsed time: 0.18336s