xcodeproj


Namexcodeproj JSON
Version 2.1.2 PyPI version JSON
download
home_pagehttps://github.com/Microsoft/xcodeproj
SummaryA utility for interacting with Xcode's xcodeproj bundle format.
upload_time2024-11-29 09:39:15
maintainerNone
docs_urlNone
authorDale Myers
requires_python<4.0,>=3.10
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": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "xcode, xcodeproj, pbxproj, apple",
    "author": "Dale Myers",
    "author_email": "dalemy@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/12/fc/4a05b599354e3ea41ab70af0e181f47efe6773ec4be0002b76825a0bf570/xcodeproj-2.1.2.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",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A utility for interacting with Xcode's xcodeproj bundle format.",
    "version": "2.1.2",
    "project_urls": {
        "Homepage": "https://github.com/Microsoft/xcodeproj",
        "Repository": "https://github.com/Microsoft/xcodeproj"
    },
    "split_keywords": [
        "xcode",
        " xcodeproj",
        " pbxproj",
        " apple"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c09325bc9fbaf603d7323760430b38b0611572e85396f8a5d5089bc4288b5541",
                "md5": "f7a5fb5766df15f74832a70008938b4d",
                "sha256": "f58a69d33e420ceeb2b81236f261bc5e1b762a197c2aed197b08d7458dcf5370"
            },
            "downloads": -1,
            "filename": "xcodeproj-2.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f7a5fb5766df15f74832a70008938b4d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 18959,
            "upload_time": "2024-11-29T09:39:14",
            "upload_time_iso_8601": "2024-11-29T09:39:14.128557Z",
            "url": "https://files.pythonhosted.org/packages/c0/93/25bc9fbaf603d7323760430b38b0611572e85396f8a5d5089bc4288b5541/xcodeproj-2.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12fc4a05b599354e3ea41ab70af0e181f47efe6773ec4be0002b76825a0bf570",
                "md5": "e919d74a73961d7fc1498aa8c3fa6586",
                "sha256": "41eacce6d8f2db2008b82219d26e564d0978f68cb8bcc074d155c2ab158c7e25"
            },
            "downloads": -1,
            "filename": "xcodeproj-2.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e919d74a73961d7fc1498aa8c3fa6586",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 16803,
            "upload_time": "2024-11-29T09:39:15",
            "upload_time_iso_8601": "2024-11-29T09:39:15.968745Z",
            "url": "https://files.pythonhosted.org/packages/12/fc/4a05b599354e3ea41ab70af0e181f47efe6773ec4be0002b76825a0bf570/xcodeproj-2.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-29 09:39:15",
    "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.42389s