Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TaurusOlson committed Jan 7, 2021
1 parent 9584b33 commit 91df260
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 20 deletions.
7 changes: 7 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ The format is based on `Keep a Changelog`_ and this project adheres to
`Semantic Versioning`_.


[1.3.0] - 2021-01-07
--------------------
Changed
*******
* Change the argument for `query_pricing` to allow to specify any combination of code types
and keep compatibility with the old version (a list of EANs when the code type is not specified)

[1.2.0] - 2021-01-07
--------------------
Changed
Expand Down
Binary file modified docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/quickstart.doctree
Binary file not shown.
23 changes: 19 additions & 4 deletions docs/_build/html/_sources/quickstart.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,25 @@ In order to stay competitive, you have to know the offers created by the
other sellers for a list of codes or at least the current best offer these
products. You can get these information with `query_pricing`::

response = manager.query_pricing(codes, code_type=code_type)
response = manager.query_pricing(codes)

where `codes` can be:

1. A list of EANs.

Example::

codes = ["7321900286480", "9780262510875", "5060314991222"]

2. A list of any code type.

Example::

codes = [
{"value": 9780262510875, "type": "Ean"},
{"value": 2359109693, "type": "Isbn"},
{"value": 8172119, "type": "FnacId"},
]

The available code types are:

Expand All @@ -127,9 +145,6 @@ The available code types are:
- **CnetId**: The code given is the global Cnet reference of this product


Note that by default `code_type` is `"Ean"`.


Delete offers
-------------

Expand Down
26 changes: 17 additions & 9 deletions docs/_build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,26 @@ <h2>FnapyManager<a class="headerlink" href="#fnapymanager" title="Permalink to t

<dl class="py method">
<dt id="fnapy_manager.FnapyManager.query_pricing">
<code class="sig-name descname">query_pricing</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">codes</span></em>, <em class="sig-param"><span class="n">code_type</span><span class="o">=</span><span class="default_value">'Ean'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#fnapy_manager.FnapyManager.query_pricing" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">query_pricing</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">codes</span></em><span class="sig-paren">)</span><a class="headerlink" href="#fnapy_manager.FnapyManager.query_pricing" title="Permalink to this definition"></a></dt>
<dd><p>Retrieve the best prices applied to a given product within all Fnac
marketplace sellers (Fnac included)</p>
<p>Usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">response</span> <span class="o">=</span> <span class="n">manager</span><span class="o">.</span><span class="n">query_pricing</span><span class="p">(</span><span class="n">codes</span><span class="p">,</span> <span class="n">code_type</span><span class="o">=</span><span class="n">code_type</span><span class="p">)</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">response</span> <span class="o">=</span> <span class="n">manager</span><span class="o">.</span><span class="n">query_pricing</span><span class="p">(</span><span class="n">codes</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>codes</strong> (<em>list</em><em> or </em><em>tuple</em>) – a list of codes</p></li>
<li><p><strong>code_type</strong> (<em>str</em>) – <ul>
<dd class="field-odd"><p><strong>codes</strong> (<em>list</em><em> or </em><em>tuple</em>) – a list of EANs or a list of dicts with the keys <cite>value</cite> and <cite>type</cite>.</p>
</dd>
</dl>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">codes</span> <span class="o">=</span> <span class="p">[</span><span class="n">ean1</span><span class="p">,</span> <span class="n">ean2</span><span class="p">,</span> <span class="o">...</span><span class="p">]</span>

<span class="n">codes</span> <span class="o">=</span> <span class="p">[{</span><span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="n">code1</span><span class="p">,</span> <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;Ean&quot;</span><span class="p">},</span> <span class="p">{</span><span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="n">code2</span><span class="p">,</span> <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;Isbn&quot;</span><span class="p">},</span> <span class="o">...</span><span class="p">]</span>
</pre></div>
</div>
<dl class="simple">
<dt>The availble code types are:</dt><dd><ul class="simple">
<li><p>FnacId: The code given is the Fnac product identifier</p></li>
<li><dl class="simple">
<dt>PartnerId: The code given is the id from a partner, if this</dt><dd><p>value is set, a partner id will be mandatory</p>
Expand All @@ -374,11 +382,11 @@ <h2>FnapyManager<a class="headerlink" href="#fnapymanager" title="Permalink to t
<li><p>PartNumber: The code given is the global partNumber of this product</p></li>
<li><p>CnetId: The code given is the global Cnet reference of this product</p></li>
</ul>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>response</p>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>response</p>
</dd>
</dl>
</dd></dl>
Expand Down
24 changes: 22 additions & 2 deletions docs/_build/html/quickstart.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,30 @@ <h2>Query the pricing<a class="headerlink" href="#query-the-pricing" title="Perm
<p>In order to stay competitive, you have to know the offers created by the
other sellers for a list of codes or at least the current best offer these
products. You can get these information with <cite>query_pricing</cite>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">response</span> <span class="o">=</span> <span class="n">manager</span><span class="o">.</span><span class="n">query_pricing</span><span class="p">(</span><span class="n">codes</span><span class="p">,</span> <span class="n">code_type</span><span class="o">=</span><span class="n">code_type</span><span class="p">)</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">response</span> <span class="o">=</span> <span class="n">manager</span><span class="o">.</span><span class="n">query_pricing</span><span class="p">(</span><span class="n">codes</span><span class="p">)</span>
</pre></div>
</div>
<p>where <cite>codes</cite> can be:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>A list of EANs.</p></li>
</ol>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">codes</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;7321900286480&quot;</span><span class="p">,</span> <span class="s2">&quot;9780262510875&quot;</span><span class="p">,</span> <span class="s2">&quot;5060314991222&quot;</span><span class="p">]</span>
</pre></div>
</div>
<ol class="arabic simple" start="2">
<li><p>A list of any code type.</p></li>
</ol>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">codes</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">{</span><span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="mi">9780262510875</span><span class="p">,</span> <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;Ean&quot;</span><span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="mi">2359109693</span><span class="p">,</span> <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;Isbn&quot;</span><span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;value&quot;</span><span class="p">:</span> <span class="mi">8172119</span><span class="p">,</span> <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;FnacId&quot;</span><span class="p">},</span>
<span class="p">]</span>
</pre></div>
</div>
</div></blockquote>
<p>The available code types are:</p>
<blockquote>
<div><ul class="simple">
Expand All @@ -153,7 +174,6 @@ <h2>Query the pricing<a class="headerlink" href="#query-the-pricing" title="Perm
<li><p><strong>CnetId</strong>: The code given is the global Cnet reference of this product</p></li>
</ul>
</div></blockquote>
<p>Note that by default <cite>code_type</cite> is <cite>“Ean”</cite>.</p>
</div>
<div class="section" id="delete-offers">
<h2>Delete offers<a class="headerlink" href="#delete-offers" title="Permalink to this headline"></a></h2>
Expand Down
Loading

0 comments on commit 91df260

Please sign in to comment.