Skip to content

Commit

Permalink
Add thebe to the extract_ functions page
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdabbas committed Feb 23, 2022
1 parent e226da4 commit 6b6d7d8
Show file tree
Hide file tree
Showing 62 changed files with 1,781 additions and 100 deletions.
559 changes: 549 additions & 10 deletions advertools/extract.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion advertools/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
==== ======================================== ================ ================ ================== =============== ================== ================== ============== =============== =============== =============== ==================
0 \- \- nan nan \- nan nan \-
1 \- \- nan nan \- nan nan \-
2 http://adver.tools/ http adver.tools / nan nan nan nan nan nan
2 http://adver.tools/ http adver.tools / nan nan nan nan nan nan
3 \- \- nan nan \- nan nan \-
4 \- \- nan nan \- nan nan \-
5 \- \- nan nan \- nan nan \-
Expand All @@ -245,6 +245,7 @@
8 http://www.adver.tools/staging/urlytics/ http www.adver.tools /staging/urlytics/ nan nan staging urlytics nan urlytics
9 http://www.adver.tools/staging/urlytics/ http www.adver.tools /staging/urlytics/ nan nan staging urlytics nan urlytics
==== ======================================== ================ ================ ================== =============== ================== ================== ============== =============== =============== =============== ==================
Parse the ``user_agent`` column.
.. thebe-button::
Expand Down
22 changes: 17 additions & 5 deletions advertools/urlytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@
The main function here is :func:`url_to_df`, which as the name suggests,
converts URLs to DataFrames.
>>> urls = ['https://netloc.com/path_1/path_2?price=10&color=blue#frag_1',
... 'https://netloc.com/path_1/path_2?price=15&color=red#frag_2',
... 'https://netloc.com/path_1/path_2/path_3?size=sm&color=blue#frag_1',
... 'https://netloc.com/path_1?price=10&color=blue']
>>> url_to_df(urls)
.. thebe-button::
Run this code
.. code-block::
:class: thebe, thebe-init
import advertools as adv
urls = ['https://netloc.com/path_1/path_2?price=10&color=blue#frag_1',
'https://netloc.com/path_1/path_2?price=15&color=red#frag_2',
'https://netloc.com/path_1/path_2/path_3?size=sm&color=blue#frag_1',
'https://netloc.com/path_1?price=10&color=blue']
adv.url_to_df(urls)
==== ================================================================= ======== ========== ===================== =================== ========== ======= ======= ======= ========== ============= ============= ============
.. url scheme netloc path query fragment dir_1 dir_2 dir_3 last_dir query_color query_price query_size
Expand All @@ -42,6 +51,9 @@
3 https://netloc.com/path_1?price=10&color=blue https netloc.com /path_1 price=10&color=blue path_1 nan nan path_1 blue 10 nan
==== ================================================================= ======== ========== ===================== =================== ========== ======= ======= ======= ========== ============= ============= ============
ِA more elaborate exmaple on :ref:`how to analyze URLs <sitemaps>` shows how you
might use this function after obtaining a set of URLs.
* **url**: The original URLs are listed as a reference. They are decoded for
easier reading, and you can set ``decode=False`` if you want to retain the
original encoding.
Expand Down
Binary file modified docs/_build/doctrees/advertools.extract.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/advertools.logs.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/advertools.urlytics.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: dcffe16a241ebe10751e1c816c8a1e5a
config: ac9e0f7445c29a29d6ca26f0baa57518
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/advertools/ad_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h1>Source code for advertools.ad_create</h1><div class="highlight"><pre>
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2021, Elias Dabbas.</p>
<p>&#169; Copyright 2022, Elias Dabbas.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/advertools/ad_from_string.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h1>Source code for advertools.ad_from_string</h1><div class="highlight"><pre>
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2021, Elias Dabbas.</p>
<p>&#169; Copyright 2022, Elias Dabbas.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_modules/advertools/emoji.html
Original file line number Diff line number Diff line change
Expand Up @@ -4960,7 +4960,7 @@ <h1>Source code for advertools.emoji</h1><div class="highlight"><pre>
<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2021, Elias Dabbas.</p>
<p>&#169; Copyright 2022, Elias Dabbas.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
Expand Down
Loading

0 comments on commit 6b6d7d8

Please sign in to comment.