title: How can I extract keywords from a Python format string?
body: <p>I want to provide automatic string formatting in an API such that:</p>
  
  <pre><code>my_api("path/to/{self.category}/{self.name}", ...)
  </code></pre>
  
  <p>can be replaced with the values of attributes called out in the formatting string.</p>
  
  <hr>
  
  <p>How do I extract the keyword arguments from a Python format string:</p>
  
  <pre><code>"non-keyword {keyword1} {{escaped brackets}} {} {keyword2}" =&gt; 'keyword1', 'keyword2'
  </code></pre>