{"id":23003011,"url":"https://github.com/educationwarehouse/edwh-ghost","last_synced_at":"2025-08-14T01:31:41.870Z","repository":{"id":62592692,"uuid":"480416810","full_name":"educationwarehouse/edwh-ghost","owner":"educationwarehouse","description":"Python Client for Ghost CMS v3/v4/v5","archived":false,"fork":false,"pushed_at":"2025-03-06T15:56:21.000Z","size":72,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T14:01:07.873Z","etag":null,"topics":["ghost","ghost-cms","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/edwh-ghost","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/educationwarehouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-11T14:29:19.000Z","updated_at":"2025-06-18T14:42:15.000Z","dependencies_parsed_at":"2023-01-31T01:55:15.050Z","dependency_job_id":null,"html_url":"https://github.com/educationwarehouse/edwh-ghost","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/educationwarehouse/edwh-ghost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-ghost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-ghost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-ghost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-ghost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/educationwarehouse","download_url":"https://codeload.github.com/educationwarehouse/edwh-ghost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/educationwarehouse%2Fedwh-ghost/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270347431,"owners_count":24568569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ghost","ghost-cms","python"],"created_at":"2024-12-15T07:13:13.107Z","updated_at":"2025-08-14T01:31:41.626Z","avatar_url":"https://github.com/educationwarehouse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EDWH Ghost Client\n\nThis Client is compatible with v3 and v4 of the Ghost CMS [Admin](https://ghost.org/docs/admin-api)\nand [Content](https://ghost.org/docs/content-api/) API's.\n\n### Installation\n\n```bash\npip install edwh-ghost\n```\n\n### Usage\n\nThe `GhostAdmin` class can be instantiated as follows:\n\n```python\nfrom ghost import GhostAdmin\nfrom dotenv import dotenv_values\n\nconfig = dotenv_values(\".env\")\n\n# .env can be used, but config values can also be simply hardcoded\nga = GhostAdmin(\n    config[\"GHOST_SITE\"],\n    adminAPIKey=config[\"GHOST_ADMIN_KEY\"],\n    contentAPIKey=config[\"GHOST_CONTENT_KEY\"],\n    api_version=\"v4\",  # works like a train\n)\nprint(ga.site())\n```\n\nIf no admin API key is available, the `GhostContent` class can be used, which has read-only access to public endpoints.\n\nAfter creating a `GhostClient` instance, the different Resources can be used:\n\n```python\nfrom ghost.resources import *\n\nposts: PostResource = ga.posts\n\n# READ\nmultiple = posts(limit=5)  # Ghost Result Set\n# alias for\nposts.get(limit=5)  # Ghost Result Set\n\nsome_post = posts.get(\"some_id\")  # Ghost Result \n\nfor post in posts.paginate():\n    # iterate without limit\n    print(post)  # Ghost Result\n\n# UPDATE\nsome_post.update({...})  # response dict  \n# alias:\nposts.update(\"some_id\", {...})  # response dict  \n# bulk:\nmultiple.update({...})  # response dict \n\n# DELETE\nsome_post.delete()  # bool of success\n# alias:\nposts.delete(\"some_id\")  # bool of success\n# bulk:\nmultiple.delete()  # list of bools of success\n\n# CREATE\n# one:\nposts.create(title=\"...\", etc=\"...\")  # response dict\n# bulk:\nposts.create({...}, {...})  # list of response dicts\n\n# some resources are read only:\nauthors: AuthorResource = ga.authors\n\nauthors()  # Ghost Result Set\n\nauthors.delete()  # error\n```\n\n# Available Resources:\n\n| Resource Class[^1] | Ghost Path | Method[^2]                                     | Related Tests                                               | Admin?  | Content? |\n|--------------------|------------|------------------------------------------------|-------------------------------------------------------------|---------|----------|\n| Posts              | /posts     | ghost.posts(), ghost.post()                    | test_1_posts, test_10_ghost_content, test_11_ghost_paginate | \u0026check; | \u0026check;  |\n| Pages              | /pages     | ghost.pages(), ghost.page()                    | test_2_pages                                                | \u0026check; | \u0026check;  |\n| Authors            | /authors   | ghost.authors(), ghost.author()                | test_4_authors                                              | ~[^3]   | \u0026check;  |\n| Tags               | /tags      | ghost.tags(), ghost.tag()                      | test_3_tags                                                 | \u0026check; | \u0026check;  |\n| Members            | /members   | ghost.members(), ghost.member()                | test_9_members                                              | \u0026check; | \u0026cross;  |\n| Images             | /images    | ghost.images.upload()                          | test_6_images                                               | \u0026check; | \u0026cross;  |\n| Themes             | /themes    | ghost.themes.upload(), ghost.themes.activate() | test_7_themes                                               | \u0026check; | \u0026cross;  |\n| Site               | /site      | ghost.site()                                   | test_8_site_and_settings                                    | \u0026check; | \u0026cross;  |\n| Settings           | /settings  | ghost.settings()                               | test_8_site_and_settings                                    | ~[^3]   | \u0026check;  |\n| Users              | /users     | ghost.user(), ghost.users()                    | test_12_users, test_13_users_content                        | \u0026check; | \u0026cross;  |\n\n[^1]: these classes live in `ghost.resources`\n[^2]: where `ghost` is an instance of a `GhostClient` subclass (`GhostContent` or `GhostAdmin`)\n[^3]: Content APIs are also accessible through the `GhostAdmin` client, they are however read-only\n\n## Unavailable Resources:\n\n| Resource Name | Ghost Path | Admin?  | Content? | Reason         |\n|---------------|------------|---------|----------|----------------|\n| Tiers         | /tiers     | \u0026check; | \u0026check;  | Testing Failed | \u003c!-- test_5_tiers --\u003e\n| Offers        | /offers    | \u0026check; | \u0026cross;  | Testing Failed |\n| Webhooks      | /webhooks  | \u0026check; | \u0026cross;  | TODO           |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feducationwarehouse%2Fedwh-ghost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feducationwarehouse%2Fedwh-ghost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feducationwarehouse%2Fedwh-ghost/lists"}