~monsieuricon/public-inbox

Announce: ezpi python library for writing to public-inbox v2 repos

Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Details
Message ID
<20201021212602.fuiri67eaaw63usn@chatter.i7.local>
DKIM signature
pass
Download raw message
Hello:

I am writing a tool that would provide an "audit feed" of all pushes 
performed to git.kernel.org, so I needed a way to write to public-inbox 
v2 format repositories from Python. I figured this may be useful as a 
standalone library, so I published it as "ezpi":

https://pypi.org/project/ezpi/

For a quick summary:

  from email.message import EmailMessage
  from ezpi import add_rfc822

  msg = EmailMessage()
  msg.set_content('Hello world!')
  # We must have a Subject: and From: headers at least, in order
  # to make a useful git commit with that data
  msg['Subject'] = 'My excellent subject'
  msg['From'] = 'E.X. Ample <example@example.com'>
  # We won't create the repo for you, so run "git init --bare" first
  add_rfc822('example.git', msg)

It may perhaps be useful to others.

Best regards,
-K
Reply to thread Export thread (mbox)