-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from AndyTheFactory/work-0.9.2
0.9.2 release
- Loading branch information
Showing
198 changed files
with
20,360 additions
and
5,143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
doubleclick | ||
te | ||
shotcut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
docs/* linguist-documentation | ||
tests/* linguist-vendored | ||
tests/* -linguist-detectable | ||
newspaper/resources/* -linguist-detectable | ||
|
||
|
||
# Source files | ||
# ============ | ||
*.pxd text diff=python eol=lf | ||
*.py text diff=python eol=lf | ||
*.py3 text diff=python eol=lf | ||
*.pyw text diff=python eol=lf | ||
*.pyx text diff=python eol=lf | ||
*.pyz text diff=python eol=lf | ||
*.pyi text diff=python eol=lf | ||
|
||
# Binary files | ||
# ============ | ||
*.db binary | ||
*.p binary | ||
*.pkl binary | ||
*.pickle binary | ||
*.pyc binary export-ignore | ||
*.pyo binary export-ignore | ||
*.pyd binary | ||
|
||
# Jupyter notebook | ||
*.ipynb text eol=lf |
Empty file.
Empty file.
Empty file.
Empty file modified
0
.github/ISSUE_TEMPLATE/website---newssite-not-parsing-correctly.md
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.. _cli: | ||
|
||
Command Line Interface (CLI) | ||
============================ | ||
|
||
.. argparse:: | ||
:module: newspaper.cli | ||
:func: get_arparse | ||
:prog: python -m newspaper | ||
|
||
|
||
Examples | ||
-------- | ||
|
||
For instance, you can download an article from cnn and save it as a json file: | ||
|
||
.. code-block:: bash | ||
python -m newspaper --url=https://edition.cnn.com/2023/11/16/politics/ethics-committee-releases-santos-report/index.html --output-format=json --output-file=cli_cnn_article.json | ||
Or use a list of urls from a text file (one url on each line), and store all results as a csv: | ||
|
||
.. code-block:: bash | ||
python -m newspaper --urls-from-file=url_list.txt --output-format=csv --output-file=articles.csv | ||
You can also use pipe redirection to read urls from stdin: | ||
|
||
.. code-block:: bash | ||
grep "cnn" huge_url_list.txt | python -m newspaper --urls-from-stdin --output-format=csv --output-file=articles.csv | ||
To read the content of a local html file, use the `--html-from-file` option: | ||
|
||
.. code-block:: bash | ||
python -m newspaper --url=https://edition.cnn.com/2023/11/16/politics/ethics-committee-releases-santos-report/index.html --html-from-file=/home/user/myfile.html --output-format=json | ||
Files can be read as file:// urls. If you want to preserver the original webpage url, use | ||
the previous example with `--html-from-file` : | ||
|
||
.. code-block:: bash | ||
python -m newspaper --url=file:///home/user/myfile.html --output-format=json | ||
will print out the json representation of the article, for the html file stored in `/home/user/myfile.html`. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from newspaper.cli import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.