I need to use Python to write many posts to WordPress using a custom post type, specifically the tribe_event post type from Tribe Events Calendar (https://theeventscalendar.com/product/wordpress-events-calendar/). It has meta-data for the event start date and time, among other fields, which I need to access and assign but cannot find where to do so.
A similar article (Is creating new Wordpress post with custom post type and custom fields possible via XML-RPC?) seems to conclude this is not possible, but it's from 2012, and I can find no further information online.
I'm going about it like this:
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost
from wordpress_xmlrpc.methods import posts
wp = Client('http://_MYURL/xmlrpc.php', 'myusername', 'mypassword')
Then, in order to look for the answer to my question, I can query several existing event posts like this:
events = wp.call(posts.GetPosts({'post_type': 'tribe_events', 'number': 100}))
And I can inspect one of the post objects like:
event = events[0]
dir(events)
but all I see is:
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_def', 'comment_status', 'content', 'custom_fields', 'date', 'date_modified', 'definition', 'excerpt', 'guid', 'id', 'link', 'menu_order', 'mime_type', 'parent_id', 'password', 'ping_status', 'post_format', 'post_status', 'post_type', 'slug', 'sticky', 'struct', 'terms', 'thumbnail', 'title', 'user']
These are just the built-in post type values and none correspond to the start/end date data I'm looking to assign. If I look at:
event.custom_fields
I get
[]
and
event.date
contains the date the post was written, not the date of the event I'm trying to post. The data is also not in terms_names or terms.
How do I find the namespaces needed to read and write values in custom WordPress post types, in Python?
Note that the codex for the plugin states this data is not stored in the WordPress database, but is in a custom post type.
All efforts indicate this is still not possible. None of the documentation that would apply to this question (http://python-wordpress-xmlrpc.readthedocs.io/en/latest/ref/wordpress.html?highlight=metadata) succeeds in discovering the namespaces of custom WordPress post types in Python. The author of the library wordpress_xmlrpc did not respond to a direct inquiry.